examples/basic_rtc/main/main.cpp
//Function that prints the reason by which ESP32 has been awaken from sleep
Function that prints the reason by which ESP32 has been awaken from sleep
Function that prints the reason by which ESP32 has been awaken from sleep
void print_wakeup_reason(){
    esp_sleep_source_t wakeup_reason;
    wakeup_reason = esp_sleep_get_wakeup_cause();
    switch(wakeup_reason)
    {
        case 1  : ESP_LOGI(TAG, "Wakeup caused by external signal using RTC_IO"); break;
        case 2  : ESP_LOGI(TAG, "Wakeup caused by external signal using RTC_CNTL"); break;
        case 3  : ESP_LOGI(TAG, "Wakeup caused by timer"); break;
        case 4  : ESP_LOGI(TAG, "Wakeup caused by touchpad"); break;
        case 5  : ESP_LOGI(TAG, "Wakeup caused by ULP program"); break;
        default : ESP_LOGI(TAG, "Wakeup was not caused by deep sleep"); break;
    }
}
void print_wakeup_reason ( ) { esp_sleep_source_t wakeup_reason ; wakeup_reason = esp_sleep_get_wakeup_cause ( ) ; switch ( wakeup_reason ) { case 1 : ESP_LOGI ( TAG , " " ) ; break ; case 2 : ESP_LOGI ( TAG , " " ) ; break ; case 3 : ESP_LOGI ( TAG , " " ) ; break ; case 4 : ESP_LOGI ( TAG , " " ) ; break ; case 5 : ESP_LOGI ( TAG , " " ) ; break ; default : ESP_LOGI ( TAG , " " ) ; break ; } }
Function that prints the reason by which ESP32 has been awaken from sleep
Function that prints the reason by which ESP32 has been awaken from sleep