mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 00:35:39 +03:00
display craft name, current mesurement on OSD
This commit is contained in:
parent
9a38d8a9e1
commit
69955d7b07
4 changed files with 34 additions and 0 deletions
|
@ -20,6 +20,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "platform.h"
|
||||
#include "version.h"
|
||||
|
@ -753,6 +754,28 @@ void updateOsd(void)
|
|||
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_CURRENT_DRAW] != -1) {
|
||||
line[0] = SYM_AMP;
|
||||
sprintf(line+1, "%d.%02d", amperage / 100, amperage % 100);
|
||||
max7456_write_string(line, masterConfig.osdProfile.item_pos[OSD_CURRENT_DRAW]);
|
||||
}
|
||||
|
||||
if (masterConfig.osdProfile.item_pos[OSD_MAH_DRAWN] != -1) {
|
||||
line[0] = SYM_MAH;
|
||||
sprintf(line+1, "%d", mAhDrawn);
|
||||
max7456_write_string(line, masterConfig.osdProfile.item_pos[OSD_MAH_DRAWN]);
|
||||
}
|
||||
|
||||
if (masterConfig.osdProfile.item_pos[OSD_CRAFT_NAME] != -1) {
|
||||
for (uint8_t i = 0; i < MAX_NAME_LENGTH; i++) {
|
||||
line[i] = toupper((unsigned char)masterConfig.name[i]);
|
||||
if (masterConfig.name[i] == 0)
|
||||
break;
|
||||
}
|
||||
max7456_write_string(line, masterConfig.osdProfile.item_pos[OSD_CRAFT_NAME]);
|
||||
}
|
||||
|
||||
if (masterConfig.osdProfile.item_pos[OSD_RSSI_VALUE] != -1) {
|
||||
line[0] = SYM_RSSI;
|
||||
sprintf(line+1, "%d", rssi / 10);
|
||||
|
@ -823,6 +846,9 @@ void resetOsdConfig(void)
|
|||
masterConfig.osdProfile.item_pos[OSD_DISARMED] = -109;
|
||||
masterConfig.osdProfile.item_pos[OSD_ARTIFICIAL_HORIZON] = -1;
|
||||
masterConfig.osdProfile.item_pos[OSD_HORIZON_SIDEBARS] = -1;
|
||||
masterConfig.osdProfile.item_pos[OSD_CURRENT_DRAW] = -23;
|
||||
masterConfig.osdProfile.item_pos[OSD_MAH_DRAWN] = -18;
|
||||
masterConfig.osdProfile.item_pos[OSD_CRAFT_NAME] = -77;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue