mirror of
https://github.com/okalachev/flix.git
synced 2026-09-05 16:00:56 +00:00
New method of disabling brownout
This commit is contained in:
+2
-7
@@ -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 +0,0 @@
|
||||
// Dummy file to make it possible to compile simulator with Flix' util.h
|
||||
Reference in New Issue
Block a user