mirror of https://github.com/arendst/Tasmota.git
Add ESP32 optional brownout disable
Add ESP32 brownout disable for weak onboard LDO's - eventually you'll need to change the LDO to a better one.
This commit is contained in:
parent
3f9fdc09ce
commit
8ada812218
|
@ -109,3 +109,12 @@ uint32_t ESP_getSketchSize(void)
|
||||||
}
|
}
|
||||||
return sketchsize;
|
return sketchsize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#include "soc/soc.h"
|
||||||
|
#include "soc/rtc_cntl_reg.h"
|
||||||
|
|
||||||
|
void DisableBrownout(void)
|
||||||
|
{
|
||||||
|
// https://github.com/espressif/arduino-esp32/issues/863#issuecomment-347179737
|
||||||
|
WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); // Disable brownout detector
|
||||||
|
}
|
||||||
|
|
|
@ -43,6 +43,7 @@ uint32_t ESP_getFlashChipId();
|
||||||
uint32_t ESP_getChipId();
|
uint32_t ESP_getChipId();
|
||||||
String String_ESP_getChipId();
|
String String_ESP_getChipId();
|
||||||
uint32_t ESP_getSketchSize();
|
uint32_t ESP_getSketchSize();
|
||||||
|
void DisableBrownout(void);
|
||||||
|
|
||||||
// Analog
|
// Analog
|
||||||
inline void analogWrite(uint8_t pin, int val)
|
inline void analogWrite(uint8_t pin, int val)
|
||||||
|
|
|
@ -192,6 +192,12 @@ void setup(void)
|
||||||
{
|
{
|
||||||
global_state.data = 3; // Init global state (wifi_down, mqtt_down) to solve possible network issues
|
global_state.data = 3; // Init global state (wifi_down, mqtt_down) to solve possible network issues
|
||||||
|
|
||||||
|
#ifdef ESP32
|
||||||
|
#ifdef DISABLE_BROWNOUT
|
||||||
|
DisableBrownout();
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
RtcRebootLoad();
|
RtcRebootLoad();
|
||||||
if (!RtcRebootValid()) {
|
if (!RtcRebootValid()) {
|
||||||
RtcReboot.fast_reboot_count = 0;
|
RtcReboot.fast_reboot_count = 0;
|
||||||
|
|
Loading…
Reference in New Issue