Unify PrintSmall functions
Size: 60420 -> 60364
This commit is contained in:
57
ui/main.c
57
ui/main.c
@@ -217,7 +217,7 @@ void DisplayRSSIBar(const bool now)
|
||||
memcpy(p_line + 2 + 7*5, &plus, ARRAY_SIZE(plus));
|
||||
}
|
||||
|
||||
UI_PrintStringSmall(str, 2, 0, line);
|
||||
UI_PrintStringSmallNormal(str, 2, 0, line);
|
||||
DrawLevelBar(bar_x, line, s_level + overS9Bars);
|
||||
if (now)
|
||||
ST7565_BlitLine(line);
|
||||
@@ -280,7 +280,7 @@ static void PrintAGC(bool now)
|
||||
int16_t agcGain = lnaShortTab[agcGainReg.lnaS] + lnaTab[agcGainReg.lna] + mixerTab[agcGainReg.mixer] + pgaTab[agcGainReg.pga];
|
||||
|
||||
sprintf(buf, "%d%2d %2d %2d %3d", reg7e.agcEnab, reg7e.gainIdx, -agcGain, reg7e.agcSigStrength, BK4819_GetRSSI());
|
||||
UI_PrintStringSmall(buf, 2, 0, 3);
|
||||
UI_PrintStringSmallNormal(buf, 2, 0, 3);
|
||||
if(now)
|
||||
ST7565_BlitLine(3);
|
||||
}
|
||||
@@ -343,9 +343,9 @@ void UI_DisplayMain(void)
|
||||
if(gScanRangeStart) {
|
||||
UI_PrintString("ScnRng", 5, 0, line, 8);
|
||||
sprintf(String, "%3u.%05u", gScanRangeStart / 100000, gScanRangeStart % 100000);
|
||||
UI_PrintStringSmall(String, 56, 0, line);
|
||||
UI_PrintStringSmallNormal(String, 56, 0, line);
|
||||
sprintf(String, "%3u.%05u", gScanRangeStop / 100000, gScanRangeStop % 100000);
|
||||
UI_PrintStringSmall(String, 56, 0, line + 1);
|
||||
UI_PrintStringSmallNormal(String, 56, 0, line + 1);
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
@@ -360,7 +360,6 @@ void UI_DisplayMain(void)
|
||||
// show DTMF stuff
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
char Contact[16];
|
||||
|
||||
if (!gDTMF_InputMode) {
|
||||
if (gDTMF_CallState == DTMF_CALL_STATE_CALL_OUT) {
|
||||
pPrintStr = DTMF_FindContact(gDTMF_String, Contact) ? Contact : gDTMF_String;
|
||||
@@ -421,11 +420,7 @@ void UI_DisplayMain(void)
|
||||
if (activeTxVFO == vfo_num)
|
||||
{ // show the TX symbol
|
||||
mode = VFO_MODE_TX;
|
||||
#ifdef ENABLE_SMALL_BOLD
|
||||
UI_PrintStringSmallBold("TX", 14, 0, line);
|
||||
#else
|
||||
UI_PrintStringSmall("TX", 14, 0, line);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -433,11 +428,7 @@ void UI_DisplayMain(void)
|
||||
{ // receiving .. show the RX symbol
|
||||
mode = VFO_MODE_RX;
|
||||
if (FUNCTION_IsRx() && gEeprom.RX_VFO == vfo_num) {
|
||||
#ifdef ENABLE_SMALL_BOLD
|
||||
UI_PrintStringSmallBold("RX", 14, 0, line);
|
||||
#else
|
||||
UI_PrintStringSmall("RX", 14, 0, line);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -449,7 +440,7 @@ void UI_DisplayMain(void)
|
||||
sprintf(String, "M%u", gEeprom.ScreenChannel[vfo_num] + 1);
|
||||
else
|
||||
sprintf(String, "M%.3s", INPUTBOX_GetAscii()); // show the input text
|
||||
UI_PrintStringSmall(String, x, 0, line + 1);
|
||||
UI_PrintStringSmallNormal(String, x, 0, line + 1);
|
||||
}
|
||||
else if (IS_FREQ_CHANNEL(gEeprom.ScreenChannel[vfo_num]))
|
||||
{ // frequency mode
|
||||
@@ -457,7 +448,7 @@ void UI_DisplayMain(void)
|
||||
const unsigned int x = 2;
|
||||
char * buf = gEeprom.VfoInfo[vfo_num].pRX->Frequency < _1GHz_in_KHz ? "" : "+";
|
||||
sprintf(String, "F%u%s", 1 + gEeprom.ScreenChannel[vfo_num] - FREQ_CHANNEL_FIRST, buf);
|
||||
UI_PrintStringSmall(String, x, 0, line + 1);
|
||||
UI_PrintStringSmallNormal(String, x, 0, line + 1);
|
||||
}
|
||||
#ifdef ENABLE_NOAA
|
||||
else
|
||||
@@ -470,7 +461,7 @@ void UI_DisplayMain(void)
|
||||
{ // user entering channel number
|
||||
sprintf(String, "N%u%u", '0' + gInputBox[0], '0' + gInputBox[1]);
|
||||
}
|
||||
UI_PrintStringSmall(String, 7, 0, line + 1);
|
||||
UI_PrintStringSmallNormal(String, 7, 0, line + 1);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -500,7 +491,7 @@ void UI_DisplayMain(void)
|
||||
#ifdef ENABLE_BIG_FREQ
|
||||
if(!isGigaF) {
|
||||
// show the remaining 2 small frequency digits
|
||||
UI_PrintStringSmall(String + 7, 113, 0, line + 1);
|
||||
UI_PrintStringSmallNormal(String + 7, 113, 0, line + 1);
|
||||
String[7] = 0;
|
||||
// show the main large frequency digits
|
||||
UI_DisplayFrequency(String, 32, line, false);
|
||||
@@ -547,7 +538,7 @@ void UI_DisplayMain(void)
|
||||
#ifdef ENABLE_BIG_FREQ
|
||||
if(frequency < _1GHz_in_KHz) {
|
||||
// show the remaining 2 small frequency digits
|
||||
UI_PrintStringSmall(String + 7, 113, 0, line + 1);
|
||||
UI_PrintStringSmallNormal(String + 7, 113, 0, line + 1);
|
||||
String[7] = 0;
|
||||
// show the main large frequency digits
|
||||
UI_DisplayFrequency(String, 32, line, false);
|
||||
@@ -579,14 +570,10 @@ void UI_DisplayMain(void)
|
||||
UI_PrintString(String, 32, 0, line, 8);
|
||||
}
|
||||
else {
|
||||
#ifdef ENABLE_SMALL_BOLD
|
||||
UI_PrintStringSmallBold(String, 32 + 4, 0, line);
|
||||
#else
|
||||
UI_PrintStringSmall(String, 32 + 4, 0, line);
|
||||
#endif
|
||||
// show the channel frequency below the channel number/name
|
||||
sprintf(String, "%03u.%05u", frequency / 100000, frequency % 100000);
|
||||
UI_PrintStringSmall(String, 32 + 4, 0, line + 1);
|
||||
UI_PrintStringSmallNormal(String, 32 + 4, 0, line + 1);
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -599,7 +586,7 @@ void UI_DisplayMain(void)
|
||||
#ifdef ENABLE_BIG_FREQ
|
||||
if(frequency < _1GHz_in_KHz) {
|
||||
// show the remaining 2 small frequency digits
|
||||
UI_PrintStringSmall(String + 7, 113, 0, line + 1);
|
||||
UI_PrintStringSmallNormal(String + 7, 113, 0, line + 1);
|
||||
String[7] = 0;
|
||||
// show the main large frequency digits
|
||||
UI_DisplayFrequency(String, 32, line, false);
|
||||
@@ -669,7 +656,7 @@ void UI_DisplayMain(void)
|
||||
s = gModulationStr[mod];
|
||||
break;
|
||||
}
|
||||
UI_PrintStringSmall(s, LCD_WIDTH + 24, 0, line + 1);
|
||||
UI_PrintStringSmallNormal(s, LCD_WIDTH + 24, 0, line + 1);
|
||||
|
||||
if (state == VFO_STATE_NORMAL || state == VFO_STATE_ALARM)
|
||||
{ // show the TX power
|
||||
@@ -677,7 +664,7 @@ void UI_DisplayMain(void)
|
||||
const unsigned int i = gEeprom.VfoInfo[vfo_num].OUTPUT_POWER;
|
||||
String[0] = (i < ARRAY_SIZE(pwr_list)) ? pwr_list[i] : '\0';
|
||||
String[1] = '\0';
|
||||
UI_PrintStringSmall(String, LCD_WIDTH + 46, 0, line + 1);
|
||||
UI_PrintStringSmallNormal(String, LCD_WIDTH + 46, 0, line + 1);
|
||||
}
|
||||
|
||||
if (gEeprom.VfoInfo[vfo_num].freq_config_RX.Frequency != gEeprom.VfoInfo[vfo_num].freq_config_TX.Frequency)
|
||||
@@ -686,12 +673,12 @@ void UI_DisplayMain(void)
|
||||
const unsigned int i = gEeprom.VfoInfo[vfo_num].TX_OFFSET_FREQUENCY_DIRECTION;
|
||||
String[0] = (i < sizeof(dir_list)) ? dir_list[i] : '?';
|
||||
String[1] = '\0';
|
||||
UI_PrintStringSmall(String, LCD_WIDTH + 54, 0, line + 1);
|
||||
UI_PrintStringSmallNormal(String, LCD_WIDTH + 54, 0, line + 1);
|
||||
}
|
||||
|
||||
// show the TX/RX reverse symbol
|
||||
if (gEeprom.VfoInfo[vfo_num].FrequencyReverse)
|
||||
UI_PrintStringSmall("R", LCD_WIDTH + 62, 0, line + 1);
|
||||
UI_PrintStringSmallNormal("R", LCD_WIDTH + 62, 0, line + 1);
|
||||
|
||||
{ // show the narrow band symbol
|
||||
String[0] = '\0';
|
||||
@@ -700,18 +687,18 @@ void UI_DisplayMain(void)
|
||||
String[0] = 'N';
|
||||
String[1] = '\0';
|
||||
}
|
||||
UI_PrintStringSmall(String, LCD_WIDTH + 70, 0, line + 1);
|
||||
UI_PrintStringSmallNormal(String, LCD_WIDTH + 70, 0, line + 1);
|
||||
}
|
||||
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
// show the DTMF decoding symbol
|
||||
if (gEeprom.VfoInfo[vfo_num].DTMF_DECODING_ENABLE || gSetting_KILLED)
|
||||
UI_PrintStringSmall("DTMF", LCD_WIDTH + 78, 0, line + 1);
|
||||
UI_PrintStringSmallNormal("DTMF", LCD_WIDTH + 78, 0, line + 1);
|
||||
#endif
|
||||
|
||||
// show the audio scramble symbol
|
||||
if (gEeprom.VfoInfo[vfo_num].SCRAMBLING_TYPE > 0 && gSetting_ScrambleEnable)
|
||||
UI_PrintStringSmall("SCR", LCD_WIDTH + 106, 0, line + 1);
|
||||
UI_PrintStringSmallNormal("SCR", LCD_WIDTH + 106, 0, line + 1);
|
||||
}
|
||||
|
||||
#ifdef ENABLE_AGC_SHOW_DATA
|
||||
@@ -744,7 +731,7 @@ void UI_DisplayMain(void)
|
||||
|
||||
center_line = CENTER_LINE_AM_FIX_DATA;
|
||||
AM_fix_print_data(gEeprom.RX_VFO, String);
|
||||
UI_PrintStringSmall(String, 2, 0, 3);
|
||||
UI_PrintStringSmallNormal(String, 2, 0, 3);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
@@ -774,7 +761,7 @@ void UI_DisplayMain(void)
|
||||
center_line = CENTER_LINE_DTMF_DEC;
|
||||
|
||||
sprintf(String, "DTMF %s", gDTMF_RX_live + idx);
|
||||
UI_PrintStringSmall(String, 2, 0, 3);
|
||||
UI_PrintStringSmallNormal(String, 2, 0, 3);
|
||||
}
|
||||
#else
|
||||
if (gSetting_live_DTMF_decoder && gDTMF_RX_index > 0)
|
||||
@@ -789,7 +776,7 @@ void UI_DisplayMain(void)
|
||||
center_line = CENTER_LINE_DTMF_DEC;
|
||||
|
||||
sprintf(String, "DTMF %s", gDTMF_RX_live + idx);
|
||||
UI_PrintStringSmall(String, 2, 0, 3);
|
||||
UI_PrintStringSmallNormal(String, 2, 0, 3);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -808,7 +795,7 @@ void UI_DisplayMain(void)
|
||||
sprintf(String, "Charge %u.%02uV %u%%",
|
||||
gBatteryVoltageAverage / 100, gBatteryVoltageAverage % 100,
|
||||
BATTERY_VoltsToPercent(gBatteryVoltageAverage));
|
||||
UI_PrintStringSmall(String, 2, 0, 3);
|
||||
UI_PrintStringSmallNormal(String, 2, 0, 3);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
Reference in New Issue
Block a user