AP_IOMCU: fixes for modified AP_ROMFS API
need to use AP_ROMFS::free()
This commit is contained in:
parent
1a1d7e0525
commit
ef1aaa6db0
@ -781,7 +781,7 @@ bool AP_IOMCU::check_crc(void)
|
|||||||
if (io_crc == crc) {
|
if (io_crc == crc) {
|
||||||
hal.console->printf("IOMCU: CRC ok\n");
|
hal.console->printf("IOMCU: CRC ok\n");
|
||||||
crc_is_ok = true;
|
crc_is_ok = true;
|
||||||
free(fw);
|
AP_ROMFS::free(fw);
|
||||||
fw = nullptr;
|
fw = nullptr;
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
@ -792,12 +792,12 @@ bool AP_IOMCU::check_crc(void)
|
|||||||
write_registers(PAGE_SETUP, PAGE_REG_SETUP_REBOOT_BL, 1, &magic);
|
write_registers(PAGE_SETUP, PAGE_REG_SETUP_REBOOT_BL, 1, &magic);
|
||||||
|
|
||||||
if (!upload_fw()) {
|
if (!upload_fw()) {
|
||||||
free(fw);
|
AP_ROMFS::free(fw);
|
||||||
fw = nullptr;
|
fw = nullptr;
|
||||||
AP_BoardConfig::sensor_config_error("Failed to update IO firmware");
|
AP_BoardConfig::sensor_config_error("Failed to update IO firmware");
|
||||||
}
|
}
|
||||||
|
|
||||||
free(fw);
|
AP_ROMFS::free(fw);
|
||||||
fw = nullptr;
|
fw = nullptr;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -215,7 +215,7 @@ private:
|
|||||||
|
|
||||||
// firmware upload
|
// firmware upload
|
||||||
const char *fw_name = "io_firmware.bin";
|
const char *fw_name = "io_firmware.bin";
|
||||||
uint8_t *fw;
|
const uint8_t *fw;
|
||||||
uint32_t fw_size;
|
uint32_t fw_size;
|
||||||
|
|
||||||
size_t write_wait(const uint8_t *pkt, uint8_t len);
|
size_t write_wait(const uint8_t *pkt, uint8_t len);
|
||||||
|
Loading…
Reference in New Issue
Block a user