mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-21 23:33:57 -04:00
AP_OSD: added runtime font switching
This commit is contained in:
parent
5682cef162
commit
64fae25882
@ -159,7 +159,8 @@ bool AP_OSD_MAX7456::update_font()
|
||||
uint32_t font_size;
|
||||
uint8_t updated_chars = 0;
|
||||
char fontname[] = "font0.bin";
|
||||
fontname[4] = get_font_num() + '0';
|
||||
last_font = get_font_num();
|
||||
fontname[4] = last_font + '0';
|
||||
uint8_t *font_data = AP_ROMFS::find_decompress(fontname, font_size);
|
||||
if (font_data == nullptr || font_size != NVM_RAM_SIZE * 256) {
|
||||
return false;
|
||||
@ -345,6 +346,9 @@ void AP_OSD_MAX7456::reinit()
|
||||
|
||||
void AP_OSD_MAX7456::flush()
|
||||
{
|
||||
if (last_font != get_font_num()) {
|
||||
update_font();
|
||||
}
|
||||
check_reinit();
|
||||
transfer_frame();
|
||||
}
|
||||
|
@ -59,6 +59,7 @@ private:
|
||||
|
||||
uint8_t video_signal_reg;
|
||||
bool initialized;
|
||||
uint8_t last_font;
|
||||
|
||||
static const uint8_t video_lines_ntsc = 13;
|
||||
static const uint8_t video_lines_pal = 16;
|
||||
|
Loading…
Reference in New Issue
Block a user