HAL_VRBRAIN: fixed storage bug in VRBRAIN too

This commit is contained in:
Andrew Tridgell 2014-09-11 18:57:41 +10:00
parent d238ff7c5d
commit 593a97afd6

View File

@ -177,11 +177,11 @@ void VRBRAINStorage::_storage_open(void)
void VRBRAINStorage::_mark_dirty(uint16_t loc, uint16_t length)
{
uint16_t end = loc + length;
while (loc < end) {
uint8_t line = (loc >> VRBRAIN_STORAGE_LINE_SHIFT);
_dirty_mask |= 1 << line;
loc += VRBRAIN_STORAGE_LINE_SIZE;
}
for (uint8_t line=loc>>VRBRAIN_STORAGE_LINE_SHIFT;
line <= end>>VRBRAIN_STORAGE_LINE_SHIFT;
line++) {
_dirty_mask |= 1U << line;
}
}
void VRBRAINStorage::read_block(void *dst, uint16_t loc, size_t n)