How devices detect state of "powering on"?

The bluetooth speaker say "Power on" when we press again it say "Power off". i wonder power off means its going deep sleep? Used esp32 and can differentiate between timer deep sleep and reset button wake up but how can i detect state of powering on?
This class is use "user_interface.h"

enum rst_reason {
    REASON_DEFAULT_RST      = 0,    /* normal startup by power on */
    REASON_WDT_RST          = 1,    /* hardware watch dog reset */
    REASON_EXCEPTION_RST    = 2,    /* exception reset, GPIO status won’t change */
    REASON_SOFT_WDT_RST     = 3,    /* software watch dog reset, GPIO status won’t change */
    REASON_SOFT_RESTART     = 4,    /* software restart ,system_restart , GPIO status won’t change */
    REASON_DEEP_SLEEP_AWAKE = 5,    /* wake up from deep-sleep */
    REASON_EXT_SYS_RST      = 6     /* external system reset */
};

when the wake up reason is REASON_DEFAULT_RST (meaning it was not one of the other)

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.