diff --git a/flix/power.ino b/flix/power.ino index 906bc09..95d8126 100644 --- a/flix/power.ino +++ b/flix/power.ino @@ -3,10 +3,7 @@ // Power management -#ifndef CONFIG_IDF_TARGET_ESP32S31 -#include -#include -#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 } diff --git a/gazebo/soc/soc.h b/gazebo/esp_private/brownout.h similarity index 69% rename from gazebo/soc/soc.h rename to gazebo/esp_private/brownout.h index f9817f6..4748340 100644 --- a/gazebo/soc/soc.h +++ b/gazebo/esp_private/brownout.h @@ -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() {}; diff --git a/gazebo/soc/rtc_cntl_reg.h b/gazebo/soc/rtc_cntl_reg.h deleted file mode 100644 index b41211d..0000000 --- a/gazebo/soc/rtc_cntl_reg.h +++ /dev/null @@ -1 +0,0 @@ -// Dummy file to make it possible to compile simulator with Flix' util.h