flash_main: fix STM32F7 2Mb single bank never write pending settings

This commit is contained in:
Andrey Gusakov 2024-08-10 00:16:07 +03:00 committed by rusefillc
parent 3557d96d3b
commit 2173b2a18a
1 changed files with 6 additions and 3 deletions

View File

@ -116,10 +116,13 @@ bool getNeedToWriteConfiguration() {
void writeToFlashIfPending() {
#if (EFI_FLASH_WRITE_THREAD == TRUE)
// with a flash write thread, the schedule happens directly from
// setNeedToWriteConfiguration, so there's nothing to do here
return;
// setNeedToWriteConfiguration and writing happens from flash thread,
// so there's nothing to do here
if (allowFlashWhileRunning()) {
return;
}
#endif
if (allowFlashWhileRunning() || !getNeedToWriteConfiguration()) {
if (!getNeedToWriteConfiguration()) {
// Allow sensor timeouts again now that we're done (and a little time has passed)
Sensor::inhibitTimeouts(false);
return;