mirror of https://github.com/rusefi/rusefi.git
OpenBLT: blink yellow LED faster if bad nBank status is detected https://github.com/rusefi/rusefi/issues/5921
This commit is contained in:
parent
eb26152655
commit
f508d98288
|
@ -22,7 +22,8 @@ protected:
|
|||
|
||||
while (true) {
|
||||
palTogglePad(yellowPort, yellowPin);
|
||||
chThdSleepMilliseconds(250);
|
||||
// blink 3 times faster if Dual Bank is not enabled
|
||||
chThdSleepMilliseconds(isFlashDualBank() ? 250 : 80);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -39,7 +39,7 @@ blt_bool FlashWriteChecksum(void);
|
|||
blt_bool FlashVerifyChecksum(void);
|
||||
blt_bool FlashDone(void);
|
||||
blt_addr FlashGetUserProgBaseAddress(void);
|
||||
|
||||
bool isFlashDualBank(void);
|
||||
|
||||
#endif /* FLASH_H */
|
||||
/*********************************** end of flash.h ************************************/
|
||||
|
|
|
@ -44,3 +44,12 @@ blt_bool FlashVerifyChecksum() {
|
|||
// Naive check: if the first block is blank, there's no code there
|
||||
return intFlashIsErased(FlashGetUserProgBaseAddress(), 4) ? BLT_FALSE : BLT_TRUE;
|
||||
}
|
||||
|
||||
bool isFlashDualBank(void) {
|
||||
#ifdef STM32F7XX
|
||||
// cleared bit indicates dual bank
|
||||
return (FLASH->OPTCR & FLASH_OPTCR_nDBANK) == 0;
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue