You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The bits are the same as m5pm1_wake_src_t, for example 0x01 for the timer and 0x04 for the power button. It returns 0 when no reason was recorded, for example after a reset.
Why the value was 0
M5.begin() has to clear the PM1 WAKE_SRC register on ToughC5, because the PM1 IRQ output stays low until it is cleared. Anything that reads the register afterwards gets 0.
M5Unified now keeps the value before clearing it, and getWakeSource() above returns that kept value. The register itself is still cleared, so this behavior does not change.
About M5PM1.h
M5PM1.h belongs to the separate M5PM1 library, which is not part of M5Unified. M5Unified does not use it, so pm1.getWakeSource() from that library still reads the register directly and still returns 0 after M5.begin(). Reading it before M5.begin() is not something M5Unified supports.
Details are in #432. The M-Bus pins of ToughC5 were also added to getPin() there.
thank you for the quick fix and the detailed explanation. I appreciate it.
I tested and verified the fix using M5Unified 0.3.0 (alongside M5GFX 0.3.0) and I can confirm that reading the wake source via M5.Power.M5pm1.getWakeSource(); reports the correct wake source.
Activity
ainyan03 commentedon Nov 5, 2026
Thank you for the report. The fix is merged into the
developbranch and will be part of the next M5Unified release. It is not in a release yet.What to do after updating
Read the wake source through M5Unified instead of the M5PM1 library:
The bits are the same as
m5pm1_wake_src_t, for example0x01for the timer and0x04for the power button. It returns 0 when no reason was recorded, for example after a reset.Why the value was 0
M5.begin()has to clear the PM1WAKE_SRCregister on ToughC5, because the PM1 IRQ output stays low until it is cleared. Anything that reads the register afterwards gets 0.M5Unified now keeps the value before clearing it, and
getWakeSource()above returns that kept value. The register itself is still cleared, so this behavior does not change.About
M5PM1.hM5PM1.hbelongs to the separate M5PM1 library, which is not part of M5Unified. M5Unified does not use it, sopm1.getWakeSource()from that library still reads the register directly and still returns 0 afterM5.begin(). Reading it beforeM5.begin()is not something M5Unified supports.Details are in #432. The M-Bus pins of ToughC5 were also added to
getPin()there.felmue commentedon Nov 6, 2026
Hello @ainyan03
thank you for the quick fix and the detailed explanation. I appreciate it.
I tested and verified the fix using M5Unified 0.3.0 (alongside M5GFX 0.3.0) and I can confirm that reading the wake source via
M5.Power.M5pm1.getWakeSource();reports the correct wake source.Thanks
Felix