0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-06-19 14:48:03 +03:00

Updated menu battery cal from egzumer

This commit is contained in:
OneOfEleven
2023-10-02 01:09:35 +01:00
parent 4333fdeb3a
commit aea80cb046
6 changed files with 30 additions and 21 deletions

View File

@ -127,7 +127,8 @@ const t_menu_item MenuList[] =
{"TX-EN", VOICE_ID_INVALID, MENU_TX_EN }, // enable TX
{"F-CALI", VOICE_ID_INVALID, MENU_F_CALI }, // reference xtal calibration
{"BATCAL", VOICE_ID_INVALID, MENU_BATCAL }, // battery voltage calibration
{"", VOICE_ID_INVALID, 0xff } // end of list - DO NOT delete or move this this
};
@ -770,6 +771,13 @@ void UI_DisplayMenu(void)
xtal_Hz / 1000000, xtal_Hz % 1000000);
}
break;
case MENU_BATCAL:
{
const uint16_t vol = (uint32_t)gBatteryVoltageAverage * gBatteryCalibration[3] / gSubMenuSelection;
sprintf(String, "%u.%02uV\n%u", vol / 100, vol % 100, gSubMenuSelection);
break;
}
}
if (!already_printed)

View File

@ -113,7 +113,8 @@ enum
MENU_SCREN,
MENU_TX_EN, // enable TX
MENU_F_CALI // reference xtal calibration
MENU_F_CALI, // reference xtal calibration
MENU_BATCAL // battery voltage calibration
};
extern const t_menu_item MenuList[];