Skip to content

Commit

Permalink
[rtl872x] disable periodic backup ram sync
Browse files Browse the repository at this point in the history
  • Loading branch information
avtolstoy committed Apr 22, 2024
1 parent 400fc20 commit 068a1db
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions hal/src/rtl872x/backup_ram_hal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ extern SessionPersistDataOpaque session;

namespace {

system_tick_t lastSyncTimeMs = 0;
//system_tick_t lastSyncTimeMs = 0;
constexpr system_tick_t syncIntervalMs = 10000;

StaticRecursiveMutex backupMutex;
Expand Down Expand Up @@ -155,10 +155,12 @@ int hal_backup_ram_sync(void* reserved) {
}

int hal_backup_ram_routine(void) {
auto now = hal_timer_millis(nullptr);
if (now - lastSyncTimeMs >= syncIntervalMs) {
lastSyncTimeMs = now;
return hal_backup_ram_sync(nullptr);
}
// Only explicit System.backupRamSync() or entry into hibernate trigger sync into flash

// auto now = hal_timer_millis(nullptr);
// if (now - lastSyncTimeMs >= syncIntervalMs) {
// lastSyncTimeMs = now;
// return hal_backup_ram_sync(nullptr);
// }
return SYSTEM_ERROR_NONE;
}

0 comments on commit 068a1db

Please sign in to comment.