Skip to content

Commit

Permalink
fix: only clear storageDirtyMsk bits when no errors, extend RTOS queu…
Browse files Browse the repository at this point in the history
…es (#5923)
  • Loading branch information
3djc authored Feb 19, 2025
1 parent 6755d3d commit 75d5809
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions radio/src/FreeRTOSConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ extern uint32_t SystemCoreClock;

/* Software timer definitions. */
#define configTIMER_TASK_PRIORITY ( 2 )
#define configTIMER_QUEUE_LENGTH 10
#define configTIMER_TASK_STACK_DEPTH ( 512 )
#define configTIMER_QUEUE_LENGTH 20
#define configTIMER_TASK_STACK_DEPTH ( 1024 )

/* Set the following definitions to 1 to include the API function, or zero
to exclude the API function. */
Expand Down
12 changes: 9 additions & 3 deletions radio/src/storage/sdcard_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,34 +82,40 @@ void storageCheck(bool immediately)

if (storageDirtyMsk & EE_GENERAL) {
TRACE("eeprom write general");
storageDirtyMsk &= ~EE_GENERAL;
const char * error = writeGeneralSettings();
if (error) {
TRACE("writeGeneralSettings error=%s", error);
}
else {
storageDirtyMsk &= ~EE_GENERAL;
}
}

#if defined(STORAGE_MODELSLIST)
if (storageDirtyMsk & EE_LABELS) {
TRACE("SD card write labels");
storageDirtyMsk &= ~EE_LABELS;
const char * error = modelslist.save();
if (error) {
TRACE("writeLabels error=%s", error);
}
else {
storageDirtyMsk &= ~EE_LABELS;
}
}
#endif

if (storageDirtyMsk & EE_MODEL) {
TRACE("eeprom write model");
storageDirtyMsk &= ~EE_MODEL;
const char * error = writeModel();
#if defined(STORAGE_MODELSLIST)
modelslist.updateCurrentModelCell();
#endif
if (error) {
TRACE("writeModel error=%s", error);
}
else {
storageDirtyMsk &= ~EE_MODEL;
}
}
}

Expand Down

0 comments on commit 75d5809

Please sign in to comment.