This commit is contained in:
Oleg Kalachev
2026-08-12 00:06:17 +03:00
parent b8c687f3ed
commit 5ee828dc01
+4
View File
@@ -3,8 +3,10 @@
// Power management
#ifdef ESP32
#include <soc/soc.h>
#include <soc/rtc_cntl_reg.h>
#endif
#include "lpf.h"
#include "util.h"
@@ -14,7 +16,9 @@ int voltagePin = -1;
float voltageScale = 2;
void setupPower() {
#ifdef ESP32
REG_CLR_BIT(RTC_CNTL_BROWN_OUT_REG, RTC_CNTL_BROWN_OUT_ENA); // disable reset on low voltage
#endif
if (digitalPinToAnalogChannel(voltagePin) == -1) voltagePin = -1; // test ADC pin
}