CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
Loading...
Searching...
No Matches
SleepController.cpp File Reference
#include "cdc_hal/ISleepController.h"
#include "cdc_hal/IKeypad.h"
#include "cdc_hal/hw_config.h"
#include "cdc_log.h"
#include "esp_sleep.h"
#include "esp_attr.h"
#include "esp_system.h"
#include "esp_task_wdt.h"
#include "driver/gpio.h"
#include "nvs_flash.h"
#include "nvs.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include <cstring>

Go to the source code of this file.

Classes

class  cdc::hal::Esp32SleepController

Namespaces

namespace  cdc
namespace  cdc::hal

Functions

ISleepControllercdc::hal::getSleepControllerInstance ()
 Returns the singleton sleep controller service instance.

Variables

static const char * TAG = "SLEEP"
static constexpr uint32_t cdc::hal::DEFAULT_LIGHT_SLEEP_INTERVAL_S = 60
 Default light-sleep timer interval in seconds.
static constexpr const char * cdc::hal::NVS_NAMESPACE = "sleep"
 NVS namespace/key for persisted sleep interval.
static constexpr const char * cdc::hal::NVS_KEY_INTERVAL = "interval"
static constexpr size_t cdc::hal::MAX_CALLBACKS = 8
 Maximum number of registered callbacks per callback list.
static RTC_DATA_ATTR bool cdc::hal::g_was_in_deep_sleep = false
 RTC-retained flag indicating previous deep-sleep state.
static RTC_DATA_ATTR uint32_t cdc::hal::g_diag_boot_count = 0
static RTC_DATA_ATTR uint32_t cdc::hal::g_diag_deep_sleep_count = 0
static Esp32SleepController cdc::hal::g_sleepController
 Singleton sleep-controller instance.

Variable Documentation

◆ TAG

const char* TAG = "SLEEP"
static

ESP32-S3 Sleep Controller Implementation

Manages light sleep and deep sleep modes.

Light Sleep: CPU paused, fast wake, preserves state Deep Sleep: Full power down, causes reset, state in RTC memory only

Based on: ~/GIT/cdc-badge-os-legacy/main/app_power.cpp

Definition at line 27 of file SleepController.cpp.