0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-04-28 22:31:25 +03:00

Forgot to remove unrequired batcal code

This commit is contained in:
OneOfEleven 2023-10-02 01:44:33 +01:00
parent 58eced120e
commit aafc93c2ee
5 changed files with 32 additions and 54 deletions

View File

@ -1098,7 +1098,7 @@ void MENU_ShowCurrentSetting(void)
case MENU_BATCAL: case MENU_BATCAL:
gSubMenuSelection = gBatteryCalibration[3]; gSubMenuSelection = gBatteryCalibration[3];
break; break;
default: default:
return; return;
} }
@ -1289,15 +1289,6 @@ static void MENU_Key_EXIT(bool bKeyPressed, bool bKeyHeld)
// *********************** // ***********************
// restore original value // 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 (gMenuCursor == MENU_F_CALI)
{ {
// if (gF_LOCK) // if (gF_LOCK)

Binary file not shown.

Binary file not shown.

View File

@ -187,19 +187,13 @@ void UI_UpdateRSSI(const int16_t rssi, const int vfo)
if (!center_line_is_free) if (!center_line_is_free)
return; return;
const bool rx = (gCurrentFunction == FUNCTION_RECEIVE || if (gCurrentFunction == FUNCTION_RECEIVE ||
gCurrentFunction == FUNCTION_MONITOR || gCurrentFunction == FUNCTION_MONITOR ||
gCurrentFunction == FUNCTION_INCOMING); gCurrentFunction == FUNCTION_INCOMING)
{
#if defined(ENABLE_AM_FIX) && defined(ENABLE_AM_FIX_SHOW_DATA) UI_DisplayRSSIBar(rssi, true);
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);
#else #else
// const int16_t dBm = (rssi / 2) - 160; // const int16_t dBm = (rssi / 2) - 160;
@ -296,7 +290,7 @@ void UI_DisplayMain(void)
char String[16]; char String[16];
unsigned int vfo_num; 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; center_line_is_free = true;
// #ifdef SINGLE_VFO_CHAN // #ifdef SINGLE_VFO_CHAN
@ -704,7 +698,10 @@ void UI_DisplayMain(void)
#ifdef ENABLE_AUDIO_BAR #ifdef ENABLE_AUDIO_BAR
if (gSetting_mic_bar && gCurrentFunction == FUNCTION_TRANSMIT) if (gSetting_mic_bar && gCurrentFunction == FUNCTION_TRANSMIT)
{
UI_DisplayAudioBar(); UI_DisplayAudioBar();
center_line_is_free = false;
}
else else
#endif #endif
@ -713,13 +710,17 @@ void UI_DisplayMain(void)
{ {
AM_fix_print_data(gEeprom.RX_CHANNEL, String); AM_fix_print_data(gEeprom.RX_CHANNEL, String);
UI_PrintStringSmall(String, 2, 0, 3); UI_PrintStringSmall(String, 2, 0, 3);
center_line_is_free = false;
} }
else else
#endif #endif
#ifdef ENABLE_RSSI_BAR #ifdef ENABLE_RSSI_BAR
if (rx) if (rx)
{
UI_DisplayRSSIBar(gCurrentRSSI[gEeprom.RX_CHANNEL], false); UI_DisplayRSSIBar(gCurrentRSSI[gEeprom.RX_CHANNEL], false);
center_line_is_free = false;
}
else else
#endif #endif
@ -733,6 +734,7 @@ void UI_DisplayMain(void)
strcpy(String, "DTMF "); strcpy(String, "DTMF ");
strcat(String, gDTMF_RX_live + idx); strcat(String, gDTMF_RX_live + idx);
UI_PrintStringSmall(String, 2, 0, 3); UI_PrintStringSmall(String, 2, 0, 3);
center_line_is_free = false;
} }
#else #else
if (gSetting_live_DTMF_decoder && gDTMF_RX_index > 0) if (gSetting_live_DTMF_decoder && gDTMF_RX_index > 0)
@ -742,6 +744,7 @@ void UI_DisplayMain(void)
strcpy(String, "DTMF "); strcpy(String, "DTMF ");
strcat(String, gDTMF_RX + idx); strcat(String, gDTMF_RX + idx);
UI_PrintStringSmall(String, 2, 0, 3); UI_PrintStringSmall(String, 2, 0, 3);
center_line_is_free = false;
} }
#endif #endif
@ -749,15 +752,11 @@ void UI_DisplayMain(void)
else else
if (gChargingWithTypeC) if (gChargingWithTypeC)
{ // charging .. show the battery state { // charging .. show the battery state
sprintf(String, "Charge %u.%02uV %u%%",
//const uint16_t volts = (gBatteryVoltageAverage < gMin_bat_v) ? gMin_bat_v : gBatteryVoltageAverage; gBatteryVoltageAverage / 100, gBatteryVoltageAverage % 100,
//const uint16_t percent = (100 * (volts - gMin_bat_v)) / (gMax_bat_v - gMin_bat_v); BATTERY_VoltsToPercent(gBatteryVoltageAverage));
//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);
UI_PrintStringSmall(String, 2, 0, 3); UI_PrintStringSmall(String, 2, 0, 3);
center_line_is_free = false;
} }
#endif #endif
} }

View File

@ -128,7 +128,7 @@ const t_menu_item MenuList[] =
{"TX-EN", VOICE_ID_INVALID, MENU_TX_EN }, // enable TX {"TX-EN", VOICE_ID_INVALID, MENU_TX_EN }, // enable TX
{"F-CALI", VOICE_ID_INVALID, MENU_F_CALI }, // reference xtal calibration {"F-CALI", VOICE_ID_INVALID, MENU_F_CALI }, // reference xtal calibration
{"BATCAL", VOICE_ID_INVALID, MENU_BATCAL }, // battery voltage calibration {"BATCAL", VOICE_ID_INVALID, MENU_BATCAL }, // battery voltage calibration
{"", VOICE_ID_INVALID, 0xff } // end of list - DO NOT delete or move this this {"", 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 // draw the little triangle marker if we're in the sub-menu
if (gIsInSubMenu) if (gIsInSubMenu)
memmove(gFrameBuffer[0] + (8 * menu_list_width) + 1, BITMAP_CurrentIndicator, sizeof(BITMAP_CurrentIndicator)); memmove(gFrameBuffer[0] + (8 * menu_list_width) + 1, BITMAP_CurrentIndicator, sizeof(BITMAP_CurrentIndicator));
// draw the menu index number/count // draw the menu index number/count
sprintf(String, "%2u.%u", 1 + gMenuCursor, gMenuListCount); sprintf(String, "%2u.%u", 1 + gMenuCursor, gMenuListCount);
UI_PrintStringSmall(String, 2, 0, 6); UI_PrintStringSmall(String, 2, 0, 6);
#else #else
{ {
const int menu_index = gMenuCursor; // current selected menu item const int menu_index = gMenuCursor; // current selected menu item
@ -733,21 +733,9 @@ void UI_DisplayMenu(void)
break; break;
case MENU_VOL: case MENU_VOL:
if (gF_LOCK) sprintf(String, "%u.%02uV\n%u%%",
{ gBatteryVoltageAverage / 100, gBatteryVoltageAverage % 100,
gBatteryCalibration[3] = gSubMenuSelection; BATTERY_VoltsToPercent(gBatteryVoltageAverage));
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));
}
break; break;
case MENU_RESET: case MENU_RESET:
@ -797,16 +785,16 @@ void UI_DisplayMenu(void)
{ {
lines++; lines++;
String[i] = 0; String[i] = 0;
} }
} }
if (lines > 3) if (lines > 3)
{ // use small text { // use small text
small = true; small = true;
if (lines > 7) if (lines > 7)
lines = 7; lines = 7;
} }
// move the 1st line up // move the 1st line up
if (small) if (small)
y = 3 - ((lines + 0) / 2); y = 3 - ((lines + 0) / 2);
@ -826,7 +814,7 @@ void UI_DisplayMenu(void)
} }
} }
} }
if (gMenuCursor == MENU_SLIST1 || gMenuCursor == MENU_SLIST2) if (gMenuCursor == MENU_SLIST1 || gMenuCursor == MENU_SLIST2)
{ {
i = (gMenuCursor == MENU_SLIST1) ? 0 : 1; i = (gMenuCursor == MENU_SLIST1) ? 0 : 1;