local sever ota

This commit is contained in:
Mit4el
2024-11-26 23:30:16 +03:00
parent 247cb51169
commit d726e661c0
9 changed files with 47 additions and 25 deletions

View File

@@ -52,7 +52,7 @@ void elementsLoop() {
#define COUNTER_ERRORMARKER 4 // количество шагов счетчика
#define STEPPER_ERRORMARKER 100000 // размер шага счетчика интервала доверия выполнения блока кода мкс
#if defined(esp32_4mb) || defined(esp32_16mb) || defined(esp32cam_4mb)
#if defined(esp32_4mb) || defined(esp32_4mb3f) || defined(esp32_16mb) || defined(esp32cam_4mb)
static int IRAM_ATTR initErrorMarkerId = 0; // ИД маркера
static int IRAM_ATTR errorMarkerId = 0;
@@ -71,14 +71,14 @@ void IRAM_ATTR onTimer() {
#endif
void initErrorMarker(int id) {
#if defined(esp32_4mb) || defined(esp32_16mb) || defined(esp32cam_4mb)
#if defined(esp32_4mb) || defined(esp32_4mb3f) || defined(esp32_16mb) || defined(esp32cam_4mb)
initErrorMarkerId = id;
errorMarkerCounter = 0;
#endif
}
void stopErrorMarker(int id) {
#if defined(esp32_4mb) || defined(esp32_16mb) || defined(esp32cam_4mb)
#if defined(esp32_4mb) || defined(esp32_4mb3f) || defined(esp32_16mb) || defined(esp32cam_4mb)
errorMarkerCounter = -1;
if (errorMarkerId)
SerialPrint("I", "WARNING!", "A lazy (freezing loop more than " + (String)(COUNTER_ERRORMARKER * STEPPER_ERRORMARKER / 1000) + " ms) section has been found! With ID=" + (String)errorMarkerId);
@@ -91,7 +91,7 @@ void setup() {
#if defined(esp32s2_4mb) || defined(esp32s3_16mb)
USB.begin();
#endif
#if defined(esp32_4mb) || defined(esp32_16mb) || defined(esp32cam_4mb)
#if defined(esp32_4mb) || defined(esp32_4mb3f) || defined(esp32_16mb) || defined(esp32cam_4mb)
My_timer = timerBegin(0, 80, true);
timerAttachInterrupt(My_timer, &onTimer, true);
timerAlarmWrite(My_timer, STEPPER_ERRORMARKER, true);