mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-22 00:28:30 -04:00
HAL_Linux: fixed storage bug in Linux too
This commit is contained in:
parent
74525cad89
commit
d238ff7c5d
@ -90,10 +90,10 @@ void LinuxStorage::_storage_open(void)
|
||||
void LinuxStorage::_mark_dirty(uint16_t loc, uint16_t length)
|
||||
{
|
||||
uint16_t end = loc + length;
|
||||
while (loc < end) {
|
||||
uint8_t line = (loc >> LINUX_STORAGE_LINE_SHIFT);
|
||||
_dirty_mask |= 1 << line;
|
||||
loc += LINUX_STORAGE_LINE_SIZE;
|
||||
for (uint8_t line=loc>>LINUX_STORAGE_LINE_SHIFT;
|
||||
line <= end>>LINUX_STORAGE_LINE_SHIFT;
|
||||
line++) {
|
||||
_dirty_mask |= 1U << line;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -83,11 +83,11 @@ void LinuxStorage::_storage_open(void)
|
||||
void LinuxStorage::_mark_dirty(uint16_t loc, uint16_t length)
|
||||
{
|
||||
uint16_t end = loc + length;
|
||||
while (loc < end) {
|
||||
uint8_t line = (loc >> LINUX_STORAGE_LINE_SHIFT);
|
||||
_dirty_mask |= 1 << line;
|
||||
loc += LINUX_STORAGE_LINE_SIZE;
|
||||
}
|
||||
for (uint8_t line=loc>>LINUX_STORAGE_LINE_SHIFT;
|
||||
line <= end>>LINUX_STORAGE_LINE_SHIFT;
|
||||
line++) {
|
||||
_dirty_mask |= 1U << line;
|
||||
}
|
||||
}
|
||||
|
||||
void LinuxStorage::read_block(void *dst, uint16_t loc, size_t n)
|
||||
|
Loading…
Reference in New Issue
Block a user