Skip to content

Instantly share code, notes, and snippets.

@Nemo64
Created March 15, 2021 17:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nemo64/5b82ba6bd68de7339e280492c97f833c to your computer and use it in GitHub Desktop.
Save Nemo64/5b82ba6bd68de7339e280492c97f833c to your computer and use it in GitHub Desktop.
Untested way of disabling power management of an esp32
#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