mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
AP_OSD: fallback to font 0 on load failure
this will allow us to reduce the number of fonts we include as standard without breaking existing setups
This commit is contained in:
parent
a2d86eac6d
commit
3a0e494085
@ -71,6 +71,12 @@ FileData *AP_OSD_Backend::load_font_data(uint8_t font_num)
|
||||
}
|
||||
if (fd == nullptr) {
|
||||
GCS_SEND_TEXT(MAV_SEVERITY_ERROR, "OSD: Failed to load font %u", font_num);
|
||||
if (font_num != 0) {
|
||||
// fallback to font0.bin. This allows us to reduce the
|
||||
// number of fonts we include in flash without breaking
|
||||
// user setups
|
||||
return load_font_data(0);
|
||||
}
|
||||
}
|
||||
return fd;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user