mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-22 07:44:03 -04:00
Revert "HAL_PX4: read from FRAM in 128 byte chunks"
This reverts commit a92366c455
.
This commit may be associated with FRAM corruption on Pixhawk. Revert
until we understand why
This commit is contained in:
parent
afb9c0a5c7
commit
db6b96caa0
@ -154,15 +154,8 @@ void PX4Storage::_storage_open(void)
|
|||||||
if (fd == -1) {
|
if (fd == -1) {
|
||||||
hal.scheduler->panic("Failed to open " MTD_PARAMS_FILE);
|
hal.scheduler->panic("Failed to open " MTD_PARAMS_FILE);
|
||||||
}
|
}
|
||||||
const uint16_t chunk_size = 128;
|
if (read(fd, _buffer, sizeof(_buffer)) != sizeof(_buffer)) {
|
||||||
for (uint16_t ofs=0; ofs<sizeof(_buffer); ofs += chunk_size) {
|
hal.scheduler->panic("Failed to read " MTD_PARAMS_FILE);
|
||||||
ssize_t ret = read(fd, &_buffer[ofs], chunk_size);
|
|
||||||
if (ret != chunk_size) {
|
|
||||||
::printf("storage read of %u bytes at %u to %p failed - got %d errno=%d\n",
|
|
||||||
(unsigned)sizeof(_buffer), (unsigned)ofs, &_buffer[ofs], (int)ret, (int)errno);
|
|
||||||
hal.scheduler->panic("Failed to read " MTD_PARAMS_FILE);
|
|
||||||
}
|
|
||||||
ofs += chunk_size;
|
|
||||||
}
|
}
|
||||||
close(fd);
|
close(fd);
|
||||||
_initialised = true;
|
_initialised = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user