Browse Source

HAL_SITL: fixed bitmask error on storage erase

celiu-4.0.17-rc8
Andrew Tridgell 5 years ago committed by Randy Mackay
parent
commit
2612fe50f7
  1. 5
      libraries/AP_HAL_SITL/Storage.cpp

5
libraries/AP_HAL_SITL/Storage.cpp

@ -69,7 +69,10 @@ void Storage::_storage_open(void) @@ -69,7 +69,10 @@ void Storage::_storage_open(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>>STORAGE_LINE_SHIFT;
line <= end>>STORAGE_LINE_SHIFT;
line++) {

Loading…
Cancel
Save