Skip to content

Commit d279b97

Browse files
committed
Removing While Loop and int fixes
1 parent bd87ff8 commit d279b97

File tree

2 files changed

+8
-18
lines changed

2 files changed

+8
-18
lines changed

src/init.h

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,17 @@
2323

2424
#include <Arduino.h>
2525
#ifdef ESP8266
26-
#include <user_interface.h> // Include this to define rst_info
27-
26+
#include <user_interface.h> // Include this to define rst_info
2827

2928
typedef struct rtc_mem {
30-
uint32_t version; // RTC memory version
29+
uint32_t version; // RTC memory version
3130
uint32_t rebootCount; // Number of reboots
3231
} rtc_mem_t;
3332

3433
// Constructor function that runs during static initialization (before setup)
35-
__attribute__((constructor))
36-
void checkrebootcount(){
34+
__attribute__((constructor)) void checkrebootcount() {
3735
Serial.begin(115200);
38-
struct rst_info *resetreason;
36+
struct rst_info* resetreason;
3937
rtc_mem_t rtcMem;
4038
resetreason = ESP.getResetInfoPtr();
4139
Serial.println("Reset reason code: " + String(resetreason->reason));
@@ -48,9 +46,9 @@ void checkrebootcount(){
4846
rtcMem.version = 0x01;
4947
rtcMem.rebootCount = 0;
5048
}
51-
if (resetreason->reason != REASON_SOFT_WDT_RST &&
52-
resetreason->reason != REASON_EXCEPTION_RST &&
53-
resetreason->reason != REASON_WDT_RST) {
49+
if (resetreason->reason != REASON_SOFT_WDT_RST
50+
&& resetreason->reason != REASON_EXCEPTION_RST
51+
&& resetreason->reason != REASON_WDT_RST) {
5452
// Not a crash, reset reboot counter
5553
rtcMem.rebootCount = 0;
5654
} else {
@@ -75,8 +73,6 @@ void checkrebootcount(){
7573
}
7674
Serial.println("Reboot Count: " + String(rtcMem.rebootCount));
7775
ESP.rtcUserMemoryWrite(33, (uint32_t*)&rtcMem, sizeof(struct rtc_mem));
78-
79-
8076
}
8177

8278
#endif

src/main.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#endif
2727

2828
#include <i2cscan.h>
29+
2930
#include "GlobalVars.h"
3031
#include "Wire.h"
3132
#include "batterymonitor.h"
@@ -62,10 +63,6 @@ BatteryMonitor battery;
6263
TPSCounter tpsCounter;
6364

6465
void setup() {
65-
while (true) {
66-
67-
68-
}
6966
Serial.begin(serialBaudRate);
7067
globalTimer = timer_create_default();
7168

@@ -166,9 +163,6 @@ void loop() {
166163
OTA::otaUpdate();
167164
networkManager.update();
168165

169-
// Process buffered logs
170-
SlimeVR::Logging::LogBuffer::getInstance().processCycle();
171-
172166
#if DEBUG_MEASURE_SENSOR_TIME_TAKEN
173167
sensorMeasurer.before();
174168
#endif

0 commit comments

Comments
 (0)