AP_IOMCU: fixes for modified AP_ROMFS API

need to use AP_ROMFS::free()
This commit is contained in:
Andrew Tridgell 2019-10-23 20:58:01 +11:00
parent 99f5e532f0
commit 5be08625df
2 changed files with 4 additions and 4 deletions

View File

@ -788,7 +788,7 @@ bool AP_IOMCU::check_crc(void)
if (io_crc == crc) {
hal.console->printf("IOMCU: CRC ok\n");
crc_is_ok = true;
free(fw);
AP_ROMFS::free(fw);
fw = nullptr;
return true;
} else {
@ -799,12 +799,12 @@ bool AP_IOMCU::check_crc(void)
write_registers(PAGE_SETUP, PAGE_REG_SETUP_REBOOT_BL, 1, &magic);
if (!upload_fw()) {
free(fw);
AP_ROMFS::free(fw);
fw = nullptr;
AP_BoardConfig::sensor_config_error("Failed to update IO firmware");
}
free(fw);
AP_ROMFS::free(fw);
fw = nullptr;
return false;
}

View File

@ -217,7 +217,7 @@ private:
// firmware upload
const char *fw_name = "io_firmware.bin";
uint8_t *fw;
const uint8_t *fw;
uint32_t fw_size;
size_t write_wait(const uint8_t *pkt, uint8_t len);