mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-04-28 14:21:25 +03:00
Forgot to remove unrequired batcal code
This commit is contained in:
parent
58eced120e
commit
aafc93c2ee
11
app/menu.c
11
app/menu.c
@ -1098,7 +1098,7 @@ void MENU_ShowCurrentSetting(void)
|
||||
case MENU_BATCAL:
|
||||
gSubMenuSelection = gBatteryCalibration[3];
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
return;
|
||||
}
|
||||
@ -1289,15 +1289,6 @@ static void MENU_Key_EXIT(bool bKeyPressed, bool bKeyHeld)
|
||||
// ***********************
|
||||
// restore original value
|
||||
|
||||
if (gMenuCursor == MENU_BATCAL)
|
||||
{
|
||||
if (gF_LOCK)
|
||||
{
|
||||
EEPROM_ReadBuffer(0x1F40, gBatteryCalibration, 8);
|
||||
BATTERY_GetReadings(true);
|
||||
}
|
||||
}
|
||||
else
|
||||
if (gMenuCursor == MENU_F_CALI)
|
||||
{
|
||||
// if (gF_LOCK)
|
||||
|
BIN
firmware.bin
BIN
firmware.bin
Binary file not shown.
Binary file not shown.
43
ui/main.c
43
ui/main.c
@ -187,19 +187,13 @@ void UI_UpdateRSSI(const int16_t rssi, const int vfo)
|
||||
if (!center_line_is_free)
|
||||
return;
|
||||
|
||||
const bool rx = (gCurrentFunction == FUNCTION_RECEIVE ||
|
||||
gCurrentFunction == FUNCTION_MONITOR ||
|
||||
gCurrentFunction == FUNCTION_INCOMING);
|
||||
|
||||
#if defined(ENABLE_AM_FIX) && defined(ENABLE_AM_FIX_SHOW_DATA)
|
||||
if (gEeprom.VfoInfo[gEeprom.RX_CHANNEL].AM_mode && gSetting_AM_fix)
|
||||
{ // AM test data is currently being shown
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if (rx)
|
||||
UI_DisplayRSSIBar(rssi, true);
|
||||
|
||||
if (gCurrentFunction == FUNCTION_RECEIVE ||
|
||||
gCurrentFunction == FUNCTION_MONITOR ||
|
||||
gCurrentFunction == FUNCTION_INCOMING)
|
||||
{
|
||||
UI_DisplayRSSIBar(rssi, true);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
// const int16_t dBm = (rssi / 2) - 160;
|
||||
@ -296,7 +290,7 @@ void UI_DisplayMain(void)
|
||||
char String[16];
|
||||
unsigned int vfo_num;
|
||||
|
||||
// true is the center screen line is not in use
|
||||
// true if the center screen line is available to use
|
||||
center_line_is_free = true;
|
||||
|
||||
// #ifdef SINGLE_VFO_CHAN
|
||||
@ -704,7 +698,10 @@ void UI_DisplayMain(void)
|
||||
|
||||
#ifdef ENABLE_AUDIO_BAR
|
||||
if (gSetting_mic_bar && gCurrentFunction == FUNCTION_TRANSMIT)
|
||||
{
|
||||
UI_DisplayAudioBar();
|
||||
center_line_is_free = false;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
|
||||
@ -713,13 +710,17 @@ void UI_DisplayMain(void)
|
||||
{
|
||||
AM_fix_print_data(gEeprom.RX_CHANNEL, String);
|
||||
UI_PrintStringSmall(String, 2, 0, 3);
|
||||
center_line_is_free = false;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_RSSI_BAR
|
||||
if (rx)
|
||||
{
|
||||
UI_DisplayRSSIBar(gCurrentRSSI[gEeprom.RX_CHANNEL], false);
|
||||
center_line_is_free = false;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
|
||||
@ -733,6 +734,7 @@ void UI_DisplayMain(void)
|
||||
strcpy(String, "DTMF ");
|
||||
strcat(String, gDTMF_RX_live + idx);
|
||||
UI_PrintStringSmall(String, 2, 0, 3);
|
||||
center_line_is_free = false;
|
||||
}
|
||||
#else
|
||||
if (gSetting_live_DTMF_decoder && gDTMF_RX_index > 0)
|
||||
@ -742,6 +744,7 @@ void UI_DisplayMain(void)
|
||||
strcpy(String, "DTMF ");
|
||||
strcat(String, gDTMF_RX + idx);
|
||||
UI_PrintStringSmall(String, 2, 0, 3);
|
||||
center_line_is_free = false;
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -749,15 +752,11 @@ void UI_DisplayMain(void)
|
||||
else
|
||||
if (gChargingWithTypeC)
|
||||
{ // charging .. show the battery state
|
||||
|
||||
//const uint16_t volts = (gBatteryVoltageAverage < gMin_bat_v) ? gMin_bat_v : gBatteryVoltageAverage;
|
||||
//const uint16_t percent = (100 * (volts - gMin_bat_v)) / (gMax_bat_v - gMin_bat_v);
|
||||
//sprintf(String, "Charge %u.%02uV %u%%", gBatteryVoltageAverage / 100, gBatteryVoltageAverage % 100, percent);
|
||||
//UI_PrintStringSmall(String, 2, 0, 3);
|
||||
|
||||
const uint16_t percent = BATTERY_VoltsToPercent(gBatteryVoltageAverage);
|
||||
sprintf(String, "Charge %u.%02uV %u%%", gBatteryVoltageAverage / 100, gBatteryVoltageAverage % 100, percent);
|
||||
sprintf(String, "Charge %u.%02uV %u%%",
|
||||
gBatteryVoltageAverage / 100, gBatteryVoltageAverage % 100,
|
||||
BATTERY_VoltsToPercent(gBatteryVoltageAverage));
|
||||
UI_PrintStringSmall(String, 2, 0, 3);
|
||||
center_line_is_free = false;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
32
ui/menu.c
32
ui/menu.c
@ -128,7 +128,7 @@ 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
|
||||
};
|
||||
|
||||
@ -377,11 +377,11 @@ void UI_DisplayMenu(void)
|
||||
// draw the little triangle marker if we're in the sub-menu
|
||||
if (gIsInSubMenu)
|
||||
memmove(gFrameBuffer[0] + (8 * menu_list_width) + 1, BITMAP_CurrentIndicator, sizeof(BITMAP_CurrentIndicator));
|
||||
|
||||
|
||||
// draw the menu index number/count
|
||||
sprintf(String, "%2u.%u", 1 + gMenuCursor, gMenuListCount);
|
||||
UI_PrintStringSmall(String, 2, 0, 6);
|
||||
|
||||
|
||||
#else
|
||||
{
|
||||
const int menu_index = gMenuCursor; // current selected menu item
|
||||
@ -733,21 +733,9 @@ void UI_DisplayMenu(void)
|
||||
break;
|
||||
|
||||
case MENU_VOL:
|
||||
if (gF_LOCK)
|
||||
{
|
||||
gBatteryCalibration[3] = gSubMenuSelection;
|
||||
BATTERY_GetReadings(true);
|
||||
sprintf(String, "%u.%02uV\n%u%%\n%u",
|
||||
gBatteryVoltageAverage / 100, gBatteryVoltageAverage % 100,
|
||||
BATTERY_VoltsToPercent(gBatteryVoltageAverage),
|
||||
gSubMenuSelection);
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(String, "%u.%02uV\n%u%%",
|
||||
gBatteryVoltageAverage / 100, gBatteryVoltageAverage % 100,
|
||||
BATTERY_VoltsToPercent(gBatteryVoltageAverage));
|
||||
}
|
||||
sprintf(String, "%u.%02uV\n%u%%",
|
||||
gBatteryVoltageAverage / 100, gBatteryVoltageAverage % 100,
|
||||
BATTERY_VoltsToPercent(gBatteryVoltageAverage));
|
||||
break;
|
||||
|
||||
case MENU_RESET:
|
||||
@ -797,16 +785,16 @@ void UI_DisplayMenu(void)
|
||||
{
|
||||
lines++;
|
||||
String[i] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (lines > 3)
|
||||
{ // use small text
|
||||
small = true;
|
||||
if (lines > 7)
|
||||
lines = 7;
|
||||
}
|
||||
|
||||
|
||||
// move the 1st line up
|
||||
if (small)
|
||||
y = 3 - ((lines + 0) / 2);
|
||||
@ -826,7 +814,7 @@ void UI_DisplayMenu(void)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (gMenuCursor == MENU_SLIST1 || gMenuCursor == MENU_SLIST2)
|
||||
{
|
||||
i = (gMenuCursor == MENU_SLIST1) ? 0 : 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user