HAL_ChibiOS: fixed bitmask error on storage erase

This commit is contained in:
Andrew Tridgell 2020-01-30 17:09:29 +11:00
parent bff97eb150
commit 27c114828b
1 changed files with 4 additions and 1 deletions

View File

@ -131,7 +131,10 @@ void Storage::_save_backup(void)
*/
void Storage::_mark_dirty(uint16_t loc, uint16_t length)
{
uint16_t end = loc + length;
if (length == 0) {
return;
}
uint16_t end = loc + length - 1;
for (uint16_t line=loc>>CH_STORAGE_LINE_SHIFT;
line <= end>>CH_STORAGE_LINE_SHIFT;
line++) {