8static const char *
const TAG =
"deep_sleep";
10static const uint32_t TEARDOWN_TIMEOUT_DEEP_SLEEP_MS = 5000;
15 ESP_LOGCONFIG(TAG,
"Running setup");
20 ESP_LOGI(TAG,
"Scheduling in %" PRIu32
" ms", *run_duration);
23 ESP_LOGD(TAG,
"Not scheduling; no run duration configured");
28 ESP_LOGCONFIG(TAG,
"Deep sleep:");
31 ESP_LOGCONFIG(TAG,
" Sleep Duration: %" PRIu32
" ms",
duration);
34 ESP_LOGCONFIG(TAG,
" Run Duration: %" PRIu32
" ms", *this->
run_duration_);
62 ESP_LOGI(TAG,
"Beginning sleep");
void teardown_components(uint32_t timeout_ms)
Teardown all components with a timeout.
void run_safe_shutdown_hooks()
void run_powerdown_hooks()
void set_timeout(const std::string &name, uint32_t timeout, std::function< void()> &&f)
Set a timeout function with a unique name.
void set_run_duration(WakeupCauseToRunDuration wakeup_cause_to_run_duration)
void dump_config() override
optional< uint64_t > sleep_duration_
optional< uint32_t > get_run_duration_() const
void prevent_deep_sleep()
bool next_enter_deep_sleep_
void begin_sleep(bool manual=false)
Helper to enter deep sleep mode.
float get_loop_priority() const override
void set_sleep_duration(uint32_t time_ms)
Set the duration in ms the component should sleep once it's in deep sleep mode.
optional< uint32_t > run_duration_
void dump_config_platform_()
float get_setup_priority() const override
bool global_has_deep_sleep
const float LATE
For components that should be initialized at the very end of the setup process.
Providing packet encoding functions for exchanging data with a remote host.
Application App
Global storage of Application pointer - only one Application can exist.