mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
AP_OSD: fixes for modified AP_ROMFS API
need to use AP_ROMFS::free()
This commit is contained in:
parent
ef1aaa6db0
commit
c4d78a7d8c
@ -161,7 +161,7 @@ bool AP_OSD_MAX7456::update_font()
|
||||
char fontname[] = "font0.bin";
|
||||
last_font = get_font_num();
|
||||
fontname[4] = last_font + '0';
|
||||
uint8_t *font_data = AP_ROMFS::find_decompress(fontname, font_size);
|
||||
const uint8_t *font_data = AP_ROMFS::find_decompress(fontname, font_size);
|
||||
if (font_data == nullptr || font_size != NVM_RAM_SIZE * 256) {
|
||||
return false;
|
||||
}
|
||||
@ -173,7 +173,7 @@ bool AP_OSD_MAX7456::update_font()
|
||||
//update char inside max7456 NVM
|
||||
if (!update_font_char(chr, chr_font_data)) {
|
||||
hal.console->printf("AP_OSD: error during font char update\n");
|
||||
free(font_data);
|
||||
AP_ROMFS::free(font_data);
|
||||
return false;
|
||||
}
|
||||
updated_chars++;
|
||||
@ -183,7 +183,7 @@ bool AP_OSD_MAX7456::update_font()
|
||||
hal.console->printf("AP_OSD: updated %d symbols.\n", updated_chars);
|
||||
}
|
||||
hal.console->printf("AP_OSD: osd font is up to date.\n");
|
||||
free(font_data);
|
||||
AP_ROMFS::free(font_data);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,7 @@ void AP_OSD_SITL::load_font(void)
|
||||
char fontname[] = "font0.bin";
|
||||
last_font = get_font_num();
|
||||
fontname[4] = last_font + '0';
|
||||
uint8_t *font_data = AP_ROMFS::find_decompress(fontname, font_size);
|
||||
const uint8_t *font_data = AP_ROMFS::find_decompress(fontname, font_size);
|
||||
if (font_data == nullptr && last_font != 0) {
|
||||
last_font = 0;
|
||||
fontname[4] = last_font + '0';
|
||||
@ -97,7 +97,7 @@ void AP_OSD_SITL::load_font(void)
|
||||
}
|
||||
font[i].update(pixels);
|
||||
}
|
||||
free(font_data);
|
||||
AP_ROMFS::free(font_data);
|
||||
}
|
||||
|
||||
void AP_OSD_SITL::write(uint8_t x, uint8_t y, const char* text)
|
||||
|
Loading…
Reference in New Issue
Block a user