Skip to content

Commit 04b80e7

Browse files
committed
Fix factory reset from rolling reset.
Increase readTaskStackSize 2000 to 2500 to prevent factoryReset from failing. Change uart2Pinned var to volatile as it is accessed by both cores.
1 parent c4165cb commit 04b80e7

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

Firmware/RTK_Surveyor/RTK_Surveyor.ino

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ TaskHandle_t pinUART2TaskHandle = NULL; //Dummy task to start UART2 on core 0.
224224
bool uart2pinned = false;
225225

226226
//Reduced stack size from 10,000 to 2,000 to make room for WiFi/NTRIP server capabilities
227-
const int readTaskStackSize = 2000;
227+
const int readTaskStackSize = 2500;
228228
const int writeTaskStackSize = 2000;
229229

230230
char incomingBTTest = 0; //Stores incoming text over BT when in test mode
@@ -282,7 +282,7 @@ unsigned long lastRockerSwitchChange = 0; //If quick toggle is detected (less th
282282
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
283283
#ifdef COMPILE_WIFI
284284

285-
#include "ESPAsyncWebServer.h"
285+
#include "ESPAsyncWebServer.h" //Get from: https://github.com/me-no-dev/ESPAsyncWebServer
286286
#include "form.h"
287287

288288
AsyncWebServer server(80);
@@ -356,7 +356,7 @@ void setup()
356356
Serial.begin(115200); //UART0 for programming and debugging
357357

358358
Wire.begin(); //Start I2C on core 1
359-
Wire.setClock(100000); //Confirm we are at 100kHz
359+
Wire.setClock(400000); //Increase bus rate to 400kHz
360360

361361
beginGNSS(); //Connect to GNSS
362362

@@ -483,6 +483,7 @@ void updateLogs()
483483
}
484484
}
485485
}
486+
// }
486487
}
487488

488489
//Once we have a fix, sync system clock to GNSS

Firmware/RTK_Surveyor/System.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -597,9 +597,9 @@ bool createTestFile()
597597
SdFile testFile;
598598
char testFileName[40] = "testfile.txt";
599599

600-
if(online.microSD == false)
600+
if(xFATSemaphore == NULL)
601601
{
602-
Serial.println(F("SD card offline"));
602+
ESP_LOGD(TAG, "xFATSemaphote is Null");
603603
return(false);
604604
}
605605

Firmware/RTK_Surveyor/menuMain.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,10 @@ void factoryReset()
122122
} //End xFATSemaphore
123123
}
124124

125-
i2cGNSS.factoryReset(); //Reset everything: baud rate, I2C address, update rate, everything.
126-
127125
displaySytemReset(); //Display friendly message on OLED
128126

127+
i2cGNSS.factoryReset(); //Reset everything: baud rate, I2C address, update rate, everything.
128+
129129
Serial.println(F("Settings erased successfully. Rebooting. Good bye!"));
130130
delay(2000);
131131
ESP.restart();

0 commit comments

Comments
 (0)