Skip to content

Instantly share code, notes, and snippets.

@ermacv
Created May 16, 2022 17:36
Show Gist options
  • Save ermacv/a746dce0c788e4c332af953a4dd62b19 to your computer and use it in GitHub Desktop.
Save ermacv/a746dce0c788e4c332af953a4dd62b19 to your computer and use it in GitHub Desktop.
#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);
vTaskDelay(pdMS_TO_TICKS(100));
esp_deep_sleep_start();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment