New method of disabling brownout

This commit is contained in:
Oleg Kalachev
2026-08-25 22:43:25 +03:00
parent 3f7e45fb1b
commit a375cb5a6e
3 changed files with 3 additions and 9 deletions
+2 -7
View File
@@ -3,10 +3,7 @@
// Power management
#ifndef CONFIG_IDF_TARGET_ESP32S31
#include <soc/soc.h>
#include <soc/rtc_cntl_reg.h>
#endif
#include "esp_private/brownout.h"
#include "filter.h"
#include "util.h"
@@ -16,9 +13,7 @@ int voltagePin = -1;
float voltageScale = 2;
void setupPower() {
#ifndef CONFIG_IDF_TARGET_ESP32S31
REG_CLR_BIT(RTC_CNTL_BROWN_OUT_REG, RTC_CNTL_BROWN_OUT_ENA); // disable reset on low voltage
#endif
esp_brownout_disable(); // disable reset on low voltage
if (digitalPinToAnalogChannel(voltagePin) == -1) voltagePin = -1; // test ADC pin
}
@@ -1,3 +1,3 @@
// Dummy file to make it possible to compile simulator with Flix' util.h
#define REG_CLR_BIT(_r, _b) {}
void esp_brownout_disable() {};
-1
View File
@@ -1 +0,0 @@
// Dummy file to make it possible to compile simulator with Flix' util.h