Created
March 15, 2021 17:33
-
-
Save Nemo64/5b82ba6bd68de7339e280492c97f833c to your computer and use it in GitHub Desktop.
Untested way of disabling power management of an esp32
This file contains 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 <Arduino.h> | |
#include <esp_pm.h> | |
void setup() | |
{ | |
Serial.begin(115200); | |
Serial.setDebugOutput(true); | |
esp_pm_lock_handle_t powerLock; | |
if (esp_pm_lock_create(ESP_PM_CPU_FREQ_MAX, 0, "", &powerLock) != ESP_OK) { | |
Serial.println("failed to create lock"); | |
} | |
if (esp_pm_lock_acquire(powerLock) != ESP_OK) { | |
Serial.println("failed to aquire lock"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment