diff --git a/platforms/chibios/drivers/wear_leveling/wear_leveling_sn32.c b/platforms/chibios/drivers/wear_leveling/wear_leveling_sn32.c index e89b2eb7d35a..f7ec1cc59582 100644 --- a/platforms/chibios/drivers/wear_leveling/wear_leveling_sn32.c +++ b/platforms/chibios/drivers/wear_leveling/wear_leveling_sn32.c @@ -25,7 +25,7 @@ bool backing_store_erase(void) { FLASH_Status status; for (int i = 0; i < (WEAR_LEVELING_SN32_EMULATION_PAGE_COUNT); ++i) { status = FLASH_EraseSector(WEAR_LEVELING_SN32_EMULATION_BASE_PAGE_ADDRESS + (i * WEAR_LEVELING_SN32_PAGE_SIZE)); - if (status != FLASH_FAIL) { + if (status == FLASH_FAIL) { ret = false; } }