Created
May 16, 2022 17:33
-
-
Save ermacv/6946e0165006a1c640064f3901341c4b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include "freertos/FreeRTOS.h" | |
#include "freertos/task.h" | |
#include "esp_pm.h" | |
void app_main(void) { | |
static const esp_pm_config_esp32c3_t pm_config = { | |
.max_freq_mhz = 160, | |
.min_freq_mhz = 40, | |
.light_sleep_enable = true, | |
}; | |
esp_err_t err; | |
err = esp_pm_configure(&pm_config); | |
assert(err == ESP_OK); | |
esp_deep_sleep(1 * 1000000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment