From d279b975439fefb61ca09b05f6f58606b082b5a9 Mon Sep 17 00:00:00 2001 From: unlogisch04 <98281608+unlogisch04@users.noreply.github.com> Date: Sun, 11 Jan 2026 15:54:45 +0100 Subject: [PATCH] Removing While Loop and int fixes --- src/init.h | 18 +++++++----------- src/main.cpp | 8 +------- 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/src/init.h b/src/init.h index 7b7c862..433ed7e 100644 --- a/src/init.h +++ b/src/init.h @@ -23,19 +23,17 @@ #include #ifdef ESP8266 -#include // Include this to define rst_info - +#include // Include this to define rst_info typedef struct rtc_mem { - uint32_t version; // RTC memory version + uint32_t version; // RTC memory version uint32_t rebootCount; // Number of reboots } rtc_mem_t; // Constructor function that runs during static initialization (before setup) -__attribute__((constructor)) -void checkrebootcount(){ +__attribute__((constructor)) void checkrebootcount() { Serial.begin(115200); - struct rst_info *resetreason; + struct rst_info* resetreason; rtc_mem_t rtcMem; resetreason = ESP.getResetInfoPtr(); Serial.println("Reset reason code: " + String(resetreason->reason)); @@ -48,9 +46,9 @@ void checkrebootcount(){ rtcMem.version = 0x01; rtcMem.rebootCount = 0; } - if (resetreason->reason != REASON_SOFT_WDT_RST && - resetreason->reason != REASON_EXCEPTION_RST && - resetreason->reason != REASON_WDT_RST) { + if (resetreason->reason != REASON_SOFT_WDT_RST + && resetreason->reason != REASON_EXCEPTION_RST + && resetreason->reason != REASON_WDT_RST) { // Not a crash, reset reboot counter rtcMem.rebootCount = 0; } else { @@ -75,8 +73,6 @@ void checkrebootcount(){ } Serial.println("Reboot Count: " + String(rtcMem.rebootCount)); ESP.rtcUserMemoryWrite(33, (uint32_t*)&rtcMem, sizeof(struct rtc_mem)); - - } #endif diff --git a/src/main.cpp b/src/main.cpp index 93466ec..4c0d0e0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -26,6 +26,7 @@ #endif #include + #include "GlobalVars.h" #include "Wire.h" #include "batterymonitor.h" @@ -62,10 +63,6 @@ BatteryMonitor battery; TPSCounter tpsCounter; void setup() { - while (true) { - - - } Serial.begin(serialBaudRate); globalTimer = timer_create_default(); @@ -166,9 +163,6 @@ void loop() { OTA::otaUpdate(); networkManager.update(); - // Process buffered logs - SlimeVR::Logging::LogBuffer::getInstance().processCycle(); - #if DEBUG_MEASURE_SENSOR_TIME_TAKEN sensorMeasurer.before(); #endif