mirror of
https://github.com/okalachev/flix.git
synced 2026-09-06 00:10:58 +00:00
New method of disabling brownout
This commit is contained in:
+2
-7
@@ -3,10 +3,7 @@
|
|||||||
|
|
||||||
// Power management
|
// Power management
|
||||||
|
|
||||||
#ifndef CONFIG_IDF_TARGET_ESP32S31
|
#include "esp_private/brownout.h"
|
||||||
#include <soc/soc.h>
|
|
||||||
#include <soc/rtc_cntl_reg.h>
|
|
||||||
#endif
|
|
||||||
#include "filter.h"
|
#include "filter.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
@@ -16,9 +13,7 @@ int voltagePin = -1;
|
|||||||
float voltageScale = 2;
|
float voltageScale = 2;
|
||||||
|
|
||||||
void setupPower() {
|
void setupPower() {
|
||||||
#ifndef CONFIG_IDF_TARGET_ESP32S31
|
esp_brownout_disable(); // disable reset on low voltage
|
||||||
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
|
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
|
// 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