Reduce number of flash writes (#190)

This commit is contained in:
J. Nick Koston 2024-01-20 15:15:06 -10:00 committed by GitHub
parent 727759eacb
commit 17fad73613
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 4 deletions

View File

@ -7,7 +7,7 @@ external_components:
refresh: 1s refresh: 1s
preferences: preferences:
flash_write_interval: 5s flash_write_interval: 1min
ratgdo: ratgdo:
id: ${id_prefix} id: ${id_prefix}

View File

@ -7,7 +7,7 @@ external_components:
refresh: 1s refresh: 1s
preferences: preferences:
flash_write_interval: 5s flash_write_interval: 1min
ratgdo: ratgdo:
id: ${id_prefix} id: ${id_prefix}

View File

@ -15,14 +15,14 @@ namespace ratgdo {
namespace secplus2 { namespace secplus2 {
// MAX_CODES_WITHOUT_FLASH_WRITE is a bit of a guess // MAX_CODES_WITHOUT_FLASH_WRITE is a bit of a guess
// since we write the flash at most every every 5s // since we write the flash at most every every 1min
// //
// We want the rolling counter to be high enough that the // We want the rolling counter to be high enough that the
// GDO will accept the command after an unexpected reboot // GDO will accept the command after an unexpected reboot
// that did not save the counter to flash in time which // that did not save the counter to flash in time which
// results in the rolling counter being behind what the GDO // results in the rolling counter being behind what the GDO
// expects. // expects.
static const uint8_t MAX_CODES_WITHOUT_FLASH_WRITE = 10; static const uint8_t MAX_CODES_WITHOUT_FLASH_WRITE = 60;
static const char* const TAG = "ratgdo_secplus2"; static const char* const TAG = "ratgdo_secplus2";