mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 16:25:31 +03:00
use the mw/scarab-osd font symbols
This commit is contained in:
parent
f6ca9de8e1
commit
437ca5025b
2 changed files with 124 additions and 117 deletions
|
@ -105,6 +105,7 @@
|
|||
#ifdef OSD
|
||||
|
||||
#include "drivers/max7456.h"
|
||||
#include "drivers/max7456_symbols.h"
|
||||
|
||||
#ifdef USE_RTC6705
|
||||
#include "drivers/vtx_soft_spi_rtc6705.h"
|
||||
|
@ -669,24 +670,30 @@ void updateOsd(void)
|
|||
}
|
||||
|
||||
if (masterConfig.osdProfile.item_pos[OSD_MAIN_BATT_VOLTAGE] != -1) {
|
||||
sprintf(line, "\x01%d.%1d", vbat / 10, vbat % 10);
|
||||
line[0] = SYM_VOLT;
|
||||
sprintf(line+1, "%d.%1d", vbat / 10, vbat % 10);
|
||||
max7456_write_string(line, masterConfig.osdProfile.item_pos[OSD_MAIN_BATT_VOLTAGE]);
|
||||
}
|
||||
if (masterConfig.osdProfile.item_pos[OSD_RSSI_VALUE] != -1) {
|
||||
sprintf(line, "\x02%d", rssi / 10);
|
||||
line[0] = SYM_RSSI;
|
||||
sprintf(line+1, "%d", rssi / 10);
|
||||
max7456_write_string(line, masterConfig.osdProfile.item_pos[OSD_RSSI_VALUE]);
|
||||
}
|
||||
if (masterConfig.osdProfile.item_pos[OSD_THROTTLE_POS] != -1) {
|
||||
sprintf(line, "\x03%3d", (constrain(rcData[THROTTLE], PWM_RANGE_MIN, PWM_RANGE_MAX) - PWM_RANGE_MIN) * 100 / (PWM_RANGE_MAX - PWM_RANGE_MIN));
|
||||
line[0] = SYM_THR;
|
||||
line[1] = SYM_THR1;
|
||||
sprintf(line+2, "%3d", (constrain(rcData[THROTTLE], PWM_RANGE_MIN, PWM_RANGE_MAX) - PWM_RANGE_MIN) * 100 / (PWM_RANGE_MAX - PWM_RANGE_MIN));
|
||||
max7456_write_string(line, masterConfig.osdProfile.item_pos[OSD_THROTTLE_POS]);
|
||||
}
|
||||
if (masterConfig.osdProfile.item_pos[OSD_TIMER] != -1) {
|
||||
if (armed) {
|
||||
seconds = armed_seconds + ((now-armed_at) / 1000000);
|
||||
sprintf(line, "\x04 %02d:%02d", seconds / 60, seconds % 60);
|
||||
line[0] = SYM_FLY_M;
|
||||
sprintf(line+1, " %02d:%02d", seconds / 60, seconds % 60);
|
||||
} else {
|
||||
line[0] = SYM_ON_M;
|
||||
seconds = now / 1000000;
|
||||
sprintf(line, "\x05 %02d:%02d", seconds / 60, seconds % 60);
|
||||
sprintf(line+1, " %02d:%02d", seconds / 60, seconds % 60);
|
||||
}
|
||||
max7456_write_string(line, masterConfig.osdProfile.item_pos[OSD_TIMER]);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue