mirror of
https://github.com/okalachev/flix.git
synced 2025-07-27 17:49:33 +00:00
Disable ESP32 reset on low voltage
This commit is contained in:
parent
4ec6ff3f37
commit
482bb8ed71
@ -36,6 +36,7 @@ float motors[4]; // normalized motors thrust in range [-1..1]
|
|||||||
void setup() {
|
void setup() {
|
||||||
Serial.begin(SERIAL_BAUDRATE);
|
Serial.begin(SERIAL_BAUDRATE);
|
||||||
Serial.println("Initializing flix");
|
Serial.println("Initializing flix");
|
||||||
|
disableBrownOut();
|
||||||
setupLED();
|
setupLED();
|
||||||
setupMotors();
|
setupMotors();
|
||||||
setLED(true);
|
setLED(true);
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
// Utility functions
|
// Utility functions
|
||||||
|
|
||||||
#include "math.h"
|
#include "math.h"
|
||||||
|
#include <soc/soc.h>
|
||||||
|
#include <soc/rtc_cntl_reg.h>
|
||||||
|
|
||||||
float mapf(long x, long in_min, long in_max, float out_min, float out_max) {
|
float mapf(long x, long in_min, long in_max, float out_min, float out_max) {
|
||||||
return (float)(x - in_min) * (out_max - out_min) / (float)(in_max - in_min) + out_min;
|
return (float)(x - in_min) * (out_max - out_min) / (float)(in_max - in_min) + out_min;
|
||||||
@ -41,3 +43,8 @@ void printArray(T arr[], int size) {
|
|||||||
}
|
}
|
||||||
Serial.println("}");
|
Serial.println("}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Disable reset on low voltage
|
||||||
|
void disableBrownOut() {
|
||||||
|
WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0);
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user