HAL_ChibiOS: run storage writes at 1kHz not 100Hz

The 100Hz update rate means there is a significant chance of an arming
failure after mission upload if you try to arm shortly after the
update.

Each mission item is 15 bytes, so with a 1200 item mission we need to
write 18000 bytes to storage. At 100Hz, with 8 bytes per storage line,
that takes over 22 seconds.
This commit is contained in:
Andrew Tridgell 2021-07-02 07:26:43 +10:00 committed by Randy Mackay
parent c4dbbfcc07
commit 0a04bb4b05
1 changed files with 3 additions and 3 deletions

View File

@ -572,16 +572,16 @@ void Scheduler::_storage_thread(void* arg)
sched->delay_microseconds(10000);
}
#if defined STM32H7
uint8_t memcheck_counter=0;
uint16_t memcheck_counter=0;
#endif
while (true) {
sched->delay_microseconds(10000);
sched->delay_microseconds(1000);
// process any pending storage writes
hal.storage->_timer_tick();
#if defined STM32H7
if (memcheck_counter++ % 50 == 0) {
if (memcheck_counter++ % 500 == 0) {
// run check at 2Hz
sched->check_low_memory_is_zero();
}