This commit is contained in:
@@ -52,7 +52,7 @@ void UI_DisplayAircopy(void)
|
||||
gAircopyState = AIRCOPY_READY;
|
||||
}
|
||||
|
||||
UI_PrintString(pPrintStr, 2, 127, 0, 8);
|
||||
UI_PrintString(pPrintStr, 2, 127, 0 /*, 8 */);
|
||||
|
||||
if (gInputBoxIndex == 0) {
|
||||
uint32_t frequency = gRxVfo->freq_config_RX.Frequency;
|
||||
@@ -83,7 +83,7 @@ void UI_DisplayAircopy(void)
|
||||
// Draw gauge
|
||||
if(gAircopyStep != 0)
|
||||
{
|
||||
UI_PrintString(String, 2, 127, 5, 8);
|
||||
UI_PrintString(String, 2, 127, 5 /*, 8 */);
|
||||
|
||||
gFrameBuffer[4][1] = 0x3c;
|
||||
gFrameBuffer[4][2] = 0x42;
|
||||
|
62
ui/fmradio.c
62
ui/fmradio.c
@@ -29,15 +29,63 @@
|
||||
#include "ui/inputbox.h"
|
||||
#include "ui/ui.h"
|
||||
|
||||
const char gBlendStrings[][4] = {
|
||||
"DEF",
|
||||
"+6 ",
|
||||
"-12",
|
||||
"-6 "
|
||||
};
|
||||
|
||||
const char gDeemphasisStrings[][3] = {
|
||||
"NO",
|
||||
"US",
|
||||
"EU"
|
||||
};
|
||||
|
||||
bool wasStereo;
|
||||
uint8_t oldRssi;
|
||||
|
||||
void UI_UpdateFMThings(bool force) {
|
||||
force = force;
|
||||
char String[16] = {0};
|
||||
const uint16_t Status = BK1080_ReadRegister(BK1080_REG_10_RSSI_STATUS);
|
||||
|
||||
bool isStereo = Status & (1 << 9);
|
||||
uint8_t rssi = Status & 0xFF;
|
||||
|
||||
if (!force && isStereo == wasStereo && rssi == oldRssi) {
|
||||
return;
|
||||
}
|
||||
oldRssi = rssi;
|
||||
wasStereo = isStereo;
|
||||
|
||||
sprintf(String, "%s RSSI%d/255",
|
||||
isStereo ? "STER" : "MONO", rssi);
|
||||
|
||||
UI_PrintStringSmallNormal(String, 1, 0, 4);
|
||||
ST7565_BlitLine(4);
|
||||
|
||||
}
|
||||
|
||||
void UI_DisplayFM(void)
|
||||
{
|
||||
char String[16] = {0};
|
||||
char *pPrintStr = String;
|
||||
UI_DisplayClear();
|
||||
|
||||
UI_PrintString("FM", 2, 0, 0, 8);
|
||||
UI_UpdateFMThings(true);
|
||||
|
||||
sprintf(String, "%d%s-%dM",
|
||||
UI_PrintString("FM", 2, 0, 0 /*, 8 */);
|
||||
|
||||
|
||||
sprintf(String, "%s D%s B%s",
|
||||
gEeprom.BK1080_AGC_ENABLED ? " AGC" : "NAGC",
|
||||
gDeemphasisStrings[gEeprom.BK1080_DEEMPHASIS_CONFIG],
|
||||
gBlendStrings[gEeprom.BK1080_BLEND_CONFIG]);
|
||||
|
||||
UI_PrintStringSmallNormal(String, 1, 0, 5);
|
||||
|
||||
sprintf(String, "%d%s-%dM",
|
||||
BK1080_GetFreqLoLimit(gEeprom.FM_Band)/10,
|
||||
gEeprom.FM_Band == 0 ? ".5" : "",
|
||||
BK1080_GetFreqHiLimit(gEeprom.FM_Band)/10
|
||||
@@ -55,13 +103,13 @@ void UI_DisplayFM(void)
|
||||
pPrintStr = "DEL?";
|
||||
} else if (gFM_ScanState == FM_SCAN_OFF) {
|
||||
if (gEeprom.FM_IsMrMode) {
|
||||
sprintf(String, "MR(CH%02u)", gEeprom.FM_SelectedChannel + 1);
|
||||
sprintf(String, "CH%02u", gEeprom.FM_SelectedChannel + 1);
|
||||
pPrintStr = String;
|
||||
} else {
|
||||
pPrintStr = "VFO";
|
||||
for (unsigned int i = 0; i < 20; i++) {
|
||||
if (gEeprom.FM_FrequencyPlaying == gFM_Channels[i]) {
|
||||
sprintf(String, "VF(C%02u)", i + 1);
|
||||
sprintf(String, "C%02u MHz", i + 1);
|
||||
pPrintStr = String;
|
||||
break;
|
||||
}
|
||||
@@ -74,7 +122,7 @@ void UI_DisplayFM(void)
|
||||
pPrintStr = "M-SCN";
|
||||
}
|
||||
|
||||
UI_PrintString(pPrintStr, 0, 127, 3, 12); // memory, vfo, scan
|
||||
UI_PrintString(pPrintStr, 0, 127, 3 /*, 12 */); // memory, vfo, scan
|
||||
|
||||
memset(String, 0, sizeof(String));
|
||||
if (gAskToSave || (gEeprom.FM_IsMrMode && gInputBoxIndex > 0)) {
|
||||
@@ -89,12 +137,12 @@ void UI_DisplayFM(void)
|
||||
sprintf(String, "%.3s.%.1s",ascii, ascii + 3);
|
||||
}
|
||||
|
||||
UI_PrintString(String, 0, 20, 1, 10); // frequency
|
||||
UI_PrintString(String, 0, 20, 1 /*, 10 */); // frequency
|
||||
ST7565_BlitFullScreen();
|
||||
return;
|
||||
}
|
||||
|
||||
UI_PrintString(String, 0, 127, 1, 10);
|
||||
UI_PrintString(String, 0, 127, 1 /*, 10 */);
|
||||
|
||||
ST7565_BlitFullScreen();
|
||||
}
|
||||
|
@@ -19,6 +19,7 @@
|
||||
|
||||
#ifdef ENABLE_FMRADIO
|
||||
void UI_DisplayFM(void);
|
||||
void UI_UpdateFMThings(bool force);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
105
ui/helper.c
105
ui/helper.c
@@ -78,6 +78,13 @@ void *memcpy_inv(void *dst, const void *src, size_t n) {
|
||||
void UI_PrintStringBuffer(const char *pString, uint8_t *buffer, uint32_t char_width, const uint8_t *font, bool inv) {
|
||||
const size_t Length = strlen(pString);
|
||||
const unsigned int char_spacing = char_width + 1;
|
||||
const uint32_t total_width = Length * char_spacing; // Total width of the text
|
||||
|
||||
if (inv) {
|
||||
// Draw background rectangle from 1 px before the first char to 1 px after the last char
|
||||
memset(buffer, 0xFF, total_width + 2);
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < Length; i++) {
|
||||
const unsigned int index = pString[i] - ' ' - 1;
|
||||
if (pString[i] > ' ' && pString[i] < 127) {
|
||||
@@ -91,7 +98,6 @@ void UI_PrintStringBuffer(const char *pString, uint8_t *buffer, uint32_t char_wi
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void UI_PrintStringSmall(const char *pString, uint8_t Start, uint8_t End, uint8_t Line, uint8_t char_width,
|
||||
const uint8_t *font, bool inv) {
|
||||
const size_t Length = strlen(pString);
|
||||
@@ -109,26 +115,25 @@ void UI_PrintStringSmallNormal(const char *pString, uint8_t Start, uint8_t End,
|
||||
UI_PrintStringSmall(pString, Start, End, Line, ARRAY_SIZE(gFontSmall[0]), (const uint8_t *) gFontSmall, false);
|
||||
}
|
||||
|
||||
void UI_PrintString(const char *pString, uint8_t Start, uint8_t End, uint8_t Line, uint8_t Width) {
|
||||
Width = Width;
|
||||
UI_PrintStringSmallNormal(pString, Start, End, Line);
|
||||
// size_t i;
|
||||
// size_t Length = strlen(pString);
|
||||
//
|
||||
// if (End > Start)
|
||||
// Start += (((End - Start) - (Length * Width)) + 1) / 2;
|
||||
//
|
||||
// for (i = 0; i < Length; i++)
|
||||
// {
|
||||
// const unsigned int ofs = (unsigned int)Start + (i * Width);
|
||||
// if (pString[i] > ' ' && pString[i] < 127)
|
||||
// {
|
||||
// const unsigned int index = pString[i] - ' ' - 1;
|
||||
// memcpy(gFrameBuffer[Line + 0] + ofs, &gFontSmall[index + '0'][0], 7);
|
||||
// memcpy(gFrameBuffer[Line + 1] + ofs, &gFontSmall[index + '0'][7], 7);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
//void UI_PrintString(const char *pString, uint8_t Start, uint8_t End, uint8_t Line /*, uint8_t Width */) {
|
||||
// UI_PrintStringSmallNormal(pString, Start, End, Line);
|
||||
//// size_t i;
|
||||
//// size_t Length = strlen(pString);
|
||||
////
|
||||
//// if (End > Start)
|
||||
//// Start += (((End - Start) - (Length * Width)) + 1) / 2;
|
||||
////
|
||||
//// for (i = 0; i < Length; i++)
|
||||
//// {
|
||||
//// const unsigned int ofs = (unsigned int)Start + (i * Width);
|
||||
//// if (pString[i] > ' ' && pString[i] < 127)
|
||||
//// {
|
||||
//// const unsigned int index = pString[i] - ' ' - 1;
|
||||
//// memcpy(gFrameBuffer[Line + 0] + ofs, &gFontSmall[index + '0'][0], 7);
|
||||
//// memcpy(gFrameBuffer[Line + 1] + ofs, &gFontSmall[index + '0'][7], 7);
|
||||
//// }
|
||||
//// }
|
||||
//}
|
||||
|
||||
void UI_PrintStringSmallBold(const char *pString, uint8_t Start, uint8_t End, uint8_t Line) {
|
||||
//#ifdef ENABLE_SMALL_BOLD
|
||||
@@ -149,7 +154,7 @@ void UI_PrintStringSmallBufferNormal(const char *pString, uint8_t *buffer) {
|
||||
|
||||
void UI_PrintStringSmallBufferBold(const char *pString, uint8_t *buffer) {
|
||||
#ifdef ENABLE_SMALL_BOLD
|
||||
const uint8_t *font = (uint8_t *)gFontSmallBold;
|
||||
const uint8_t *font = (uint8_t *) gFontSmallBold;
|
||||
const uint8_t char_width = ARRAY_SIZE(gFontSmallBold[0]);
|
||||
#else
|
||||
const uint8_t *font = (uint8_t *) gFontSmall;
|
||||
@@ -283,6 +288,30 @@ void PutPixelStatus(uint8_t x, uint8_t y, bool fill) {
|
||||
UI_DrawPixelBuffer(&gStatusLine, x, y, fill);
|
||||
}
|
||||
|
||||
//void GUI_DisplaySmallest(const char *pString, uint8_t x, uint8_t y,
|
||||
// bool statusbar, bool fill) {
|
||||
// uint8_t c;
|
||||
// uint8_t pixels;
|
||||
// const uint8_t *p = (const uint8_t *) pString;
|
||||
//
|
||||
// while ((c = *p++) && c != '\0') {
|
||||
// c -= 0x20;
|
||||
// for (int i = 0; i < 3; ++i) {
|
||||
// pixels = gFont3x5[c][i];
|
||||
// for (int j = 0; j < 6; ++j) {
|
||||
// if (pixels & 1) {
|
||||
// if (statusbar)
|
||||
// PutPixelStatus(x + i, y + j, fill);
|
||||
// else
|
||||
// PutPixel(x + i, y + j, fill);
|
||||
// }
|
||||
// pixels >>= 1;
|
||||
// }
|
||||
// }
|
||||
// x += 4;
|
||||
// }
|
||||
//}
|
||||
|
||||
void GUI_DisplaySmallest(const char *pString, uint8_t x, uint8_t y,
|
||||
bool statusbar, bool fill) {
|
||||
uint8_t c;
|
||||
@@ -291,22 +320,25 @@ void GUI_DisplaySmallest(const char *pString, uint8_t x, uint8_t y,
|
||||
|
||||
while ((c = *p++) && c != '\0') {
|
||||
c -= 0x20;
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
pixels = gFont3x5[c][i];
|
||||
for (int j = 0; j < 6; ++j) {
|
||||
if (pixels & 1) {
|
||||
if (statusbar)
|
||||
PutPixelStatus(x + i, y + j, fill);
|
||||
else
|
||||
PutPixel(x + i, y + j, fill);
|
||||
for (int i = 0; i < (int) ARRAY_SIZE(gFontSmall[0]); ++i) {
|
||||
if (c) {
|
||||
pixels = gFontSmall[c - 1][i];
|
||||
for (int j = 0; j < 8; ++j) {
|
||||
if (pixels & 1) {
|
||||
if (statusbar)
|
||||
PutPixelStatus(x + i, y + j, fill);
|
||||
else
|
||||
PutPixel(x + i, y + j, fill);
|
||||
}
|
||||
pixels >>= 1;
|
||||
}
|
||||
pixels >>= 1;
|
||||
}
|
||||
}
|
||||
x += 4;
|
||||
x += ARRAY_SIZE(gFontSmall[0]) + 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
void UI_DrawLineBuffer(uint8_t (*buffer)[128], int16_t x1, int16_t y1, int16_t x2, int16_t y2, bool black) {
|
||||
@@ -352,10 +384,17 @@ void UI_DisplayPopup(const char *string) {
|
||||
// UI_DrawPixelBuffer(117, y, true);
|
||||
// }
|
||||
// DrawRectangle(9,9, 118,38, true);
|
||||
UI_PrintString(string, 9, 118, 2, 8);
|
||||
UI_PrintString(string, 9, 118, 2 /*, 8 */);
|
||||
UI_PrintStringSmallNormal("Press EXIT", 9, 118, 6);
|
||||
}
|
||||
|
||||
void UI_ClearLine(uint8_t Line) {
|
||||
if (Line < 8) { // ST7565 has 8 pages (rows of 8 pixels)
|
||||
memset(gFrameBuffer[Line], 0x00, 128); // Clear all pixels on the line
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void UI_DisplayClear() {
|
||||
memset(gFrameBuffer, 0, sizeof(gFrameBuffer));
|
||||
}
|
||||
|
@@ -22,13 +22,14 @@
|
||||
|
||||
void UI_GenerateChannelString(char *pString, const uint8_t Channel);
|
||||
void UI_GenerateChannelStringEx(char *pString, const bool bShowPrefix, const uint8_t ChannelNumber);
|
||||
void UI_PrintString(const char *pString, uint8_t Start, uint8_t End, uint8_t Line, uint8_t Width);
|
||||
//void UI_PrintString(const char *pString, uint8_t Start, uint8_t End, uint8_t Line /*, uint8_t Width */);
|
||||
#define UI_PrintString UI_PrintStringSmallNormal
|
||||
void UI_PrintStringSmallNormal(const char *pString, uint8_t Start, uint8_t End, uint8_t Line);
|
||||
void UI_PrintStringSmallBold(const char *pString, uint8_t Start, uint8_t End, uint8_t Line);
|
||||
void UI_PrintStringSmallBufferNormal(const char *pString, uint8_t *buffer);
|
||||
void UI_PrintStringSmallBufferBold(const char *pString, uint8_t * buffer);
|
||||
//void UI_DisplayFrequency(const char *string, uint8_t X, uint8_t Y, bool center);
|
||||
|
||||
void UI_ClearLine(uint8_t Line);
|
||||
void UI_DisplayPopup(const char *string);
|
||||
|
||||
void UI_DrawPixelBuffer(uint8_t (*buffer)[128], uint8_t x, uint8_t y, bool black);
|
||||
|
@@ -37,11 +37,11 @@ static void Render(void)
|
||||
memset(gStatusLine, 0, sizeof(gStatusLine));
|
||||
UI_DisplayClear();
|
||||
|
||||
UI_PrintString("PASSWORD", 0, 127, 1, 10);
|
||||
UI_PrintString("PASSWORD", 0, 127, 1 /*, 10 */);
|
||||
for (i = 0; i < 6; i++)
|
||||
String[i] = (gInputBox[i] == 10) ? '-' : 'x';
|
||||
String[6] = 0;
|
||||
UI_PrintString(String, 0, 127, 3, 12);
|
||||
UI_PrintString(String, 0, 127, 3 /*, 12 */);
|
||||
|
||||
ST7565_BlitStatusLine();
|
||||
ST7565_BlitFullScreen();
|
||||
|
322
ui/main.c
322
ui/main.c
@@ -115,51 +115,19 @@ static void DrawLevelBar(uint8_t xpos, uint8_t line, uint8_t level, uint8_t bars
|
||||
level = MIN(level, bars);
|
||||
|
||||
for (uint8_t i = 0; i < level; i++) {
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
if (gSetting_set_met) {
|
||||
const char hollowBar[] = {
|
||||
0b01111111,
|
||||
0b01000001,
|
||||
0b01000001,
|
||||
0b01111111
|
||||
};
|
||||
const char hollowBar[] = {
|
||||
0b01111111,
|
||||
0b01000001,
|
||||
0b01000001,
|
||||
0b01111111
|
||||
};
|
||||
|
||||
if (i < bars - 4) {
|
||||
for (uint8_t j = 0; j < 4; j++)
|
||||
p_line[xpos + i * 5 + j] = (~(0x7F >> (i + 1))) & 0x7F;
|
||||
} else {
|
||||
memcpy(p_line + (xpos + i * 5), &hollowBar, ARRAY_SIZE(hollowBar));
|
||||
}
|
||||
if (i < bars - 4) {
|
||||
for (uint8_t j = 0; j < 4; j++)
|
||||
p_line[xpos + i * 5 + j] = (~(0x7F >> (i + 1))) & 0x7F;
|
||||
} else {
|
||||
const char hollowBar[] = {
|
||||
0b00111110,
|
||||
0b00100010,
|
||||
0b00100010,
|
||||
0b00111110
|
||||
};
|
||||
|
||||
const char simpleBar[] = {
|
||||
0b00111110,
|
||||
0b00111110,
|
||||
0b00111110,
|
||||
0b00111110
|
||||
};
|
||||
|
||||
if (i < bars - 4) {
|
||||
memcpy(p_line + (xpos + i * 5), &simpleBar, ARRAY_SIZE(simpleBar));
|
||||
} else {
|
||||
memcpy(p_line + (xpos + i * 5), &hollowBar, ARRAY_SIZE(hollowBar));
|
||||
}
|
||||
}
|
||||
#else
|
||||
if(i < bars - 4) {
|
||||
for(uint8_t j = 0; j < 4; j++)
|
||||
p_line[xpos + i * 5 + j] = (~(0x7F >> (i+1))) & 0x7F;
|
||||
}
|
||||
else {
|
||||
memcpy(p_line + (xpos + i * 5), &hollowBar, ARRAY_SIZE(hollowBar));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -197,7 +165,7 @@ void UI_DisplayAudioBar(void) {
|
||||
|
||||
if (gCurrentFunction != FUNCTION_TRANSMIT ||
|
||||
gScreenToDisplay != DISPLAY_MAIN
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
|| gDTMF_CallState != DTMF_CALL_STATE_NONE
|
||||
#endif
|
||||
) {
|
||||
@@ -237,7 +205,7 @@ void UI_DisplayAudioBar(void) {
|
||||
void DisplayRSSIBar(const bool now) {
|
||||
#if defined(ENABLE_RSSI_BAR)
|
||||
|
||||
const unsigned int txt_width = 7 * 8; // 8 text chars
|
||||
const unsigned int txt_width = 7 * 10; // 8 text chars
|
||||
const unsigned int bar_x = 2 + txt_width + 4; // X coord of bar graph
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
@@ -266,7 +234,7 @@ void DisplayRSSIBar(const bool now) {
|
||||
|
||||
if (RxLine >= 0 && center_line != CENTER_LINE_IN_USE) {
|
||||
if (RxBlink == 0 || RxBlink == 1) {
|
||||
UI_PrintStringSmallBold("RX", 8, 0, RxLine);
|
||||
UI_PrintStringSmallBold("RX", 24, 0, RxLine);
|
||||
if (RxBlink == 1) RxBlink = 2;
|
||||
} else {
|
||||
for (uint8_t i = 8; i < 24; i++) {
|
||||
@@ -299,7 +267,7 @@ void DisplayRSSIBar(const bool now) {
|
||||
|
||||
if (gCurrentFunction == FUNCTION_TRANSMIT ||
|
||||
gScreenToDisplay != DISPLAY_MAIN
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
|| gDTMF_CallState != DTMF_CALL_STATE_NONE
|
||||
#endif
|
||||
)
|
||||
@@ -348,24 +316,19 @@ void DisplayRSSIBar(const bool now) {
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
if (gSetting_set_gui) {
|
||||
sprintf(str, "%3d", -rssi_dBm);
|
||||
UI_PrintStringSmallNormal(str, LCD_WIDTH + 8, 0, line - 1);
|
||||
} else {
|
||||
sprintf(str, "% 4d %s", -rssi_dBm, "dBm");
|
||||
if (isMainOnly())
|
||||
GUI_DisplaySmallest(str, 2, 41, false, true);
|
||||
else
|
||||
GUI_DisplaySmallest(str, 2, 25, false, true);
|
||||
}
|
||||
char tempStr[4];
|
||||
|
||||
if (overS9Bars == 0) {
|
||||
sprintf(str, "S%d", s_level);
|
||||
sprintf(tempStr, "S%d", s_level);
|
||||
} else {
|
||||
sprintf(str, "+%02d", overS9dBm);
|
||||
sprintf(tempStr, "+%02d", overS9dBm);
|
||||
}
|
||||
|
||||
UI_PrintStringSmallNormal(str, LCD_WIDTH + 38, 0, line - 1);
|
||||
sprintf(str, "%4ddBm%3s", -rssi_dBm, tempStr);
|
||||
if (isMainOnly())
|
||||
UI_PrintStringSmallNormal(str, 2, 0, 4);
|
||||
else
|
||||
UI_PrintStringSmallNormal(str, 2, 0, 3);
|
||||
#else
|
||||
if(overS9Bars == 0) {
|
||||
sprintf(str, "% 4d S%d", -rssi_dBm, s_level);
|
||||
@@ -377,7 +340,7 @@ void DisplayRSSIBar(const bool now) {
|
||||
|
||||
UI_PrintStringSmallNormal(str, 2, 0, line);
|
||||
#endif
|
||||
DrawLevelBar(bar_x, line, s_level + overS9Bars, 13);
|
||||
DrawLevelBar(bar_x, line, s_level + overS9Bars, 10);
|
||||
if (now)
|
||||
ST7565_BlitLine(line);
|
||||
#else
|
||||
@@ -507,7 +470,7 @@ void UI_DisplayMain(void) {
|
||||
UI_DisplayClear();
|
||||
|
||||
if (gLowBattery && !gLowBatteryConfirmed) {
|
||||
UI_DisplayPopup("LOW BATTERY");
|
||||
UI_DisplayPopup("LOW BATT");
|
||||
ST7565_BlitFullScreen();
|
||||
return;
|
||||
}
|
||||
@@ -515,8 +478,8 @@ void UI_DisplayMain(void) {
|
||||
#ifndef ENABLE_FEAT_F4HWN
|
||||
if (gEeprom.KEY_LOCK && gKeypadLocked > 0)
|
||||
{ // tell user how to unlock the keyboard
|
||||
UI_PrintString("Long press #", 0, LCD_WIDTH, 1, 8);
|
||||
UI_PrintString("to unlock", 0, LCD_WIDTH, 3, 8);
|
||||
UI_PrintString("Long press #", 0, LCD_WIDTH, 1 /*, 8 */);
|
||||
UI_PrintString("to unlock", 0, LCD_WIDTH, 3 /*, 8 */);
|
||||
ST7565_BlitFullScreen();
|
||||
return;
|
||||
}
|
||||
@@ -535,7 +498,7 @@ void UI_DisplayMain(void) {
|
||||
shift = 5;
|
||||
}
|
||||
//memcpy(gFrameBuffer[shift] + 2, gFontKeyLock, sizeof(gFontKeyLock));
|
||||
UI_PrintStringSmallBold("UNLOCK KEYBOARD", 12, 0, shift);
|
||||
UI_PrintStringSmallBold("KEYLOCK", 12, 0, shift);
|
||||
//memcpy(gFrameBuffer[shift] + 120, gFontKeyLock, sizeof(gFontKeyLock));
|
||||
|
||||
/*
|
||||
@@ -600,7 +563,7 @@ void UI_DisplayMain(void) {
|
||||
shift = 3;
|
||||
}
|
||||
|
||||
UI_PrintString("ScnRng", 5, 0, line + shift, 8);
|
||||
UI_PrintString("ScnRng", 5, 0, line + shift /*, 8 */);
|
||||
sprintf(String, "%3u.%05u", gScanRangeStart / 100000, gScanRangeStart % 100000);
|
||||
UI_PrintStringSmallNormal(String, 56, 0, line + shift);
|
||||
sprintf(String, "%3u.%05u", gScanRangeStop / 100000, gScanRangeStop % 100000);
|
||||
@@ -612,7 +575,7 @@ void UI_DisplayMain(void) {
|
||||
gScanRangeStart = 0;
|
||||
}
|
||||
#else
|
||||
UI_PrintString("ScnRng", 5, 0, line, 8);
|
||||
UI_PrintString("ScnRng", 5, 0, line /*, 8 */);
|
||||
sprintf(String, "%3u.%05u", gScanRangeStart / 100000, gScanRangeStart % 100000);
|
||||
UI_PrintStringSmallNormal(String, 56, 0, line);
|
||||
sprintf(String, "%3u.%05u", gScanRangeStop / 100000, gScanRangeStop % 100000);
|
||||
@@ -624,21 +587,21 @@ void UI_DisplayMain(void) {
|
||||
|
||||
|
||||
if (gEnteringSMS == SMS_ENTERING_DEST) {
|
||||
UI_PrintString("SMS Dst", 0, 0, line - 1, 8);
|
||||
UI_PrintString("SMS Dst", 0, 0, line - 1 /*, 8 */);
|
||||
sprintf(String, "%d", dataPacket.dest);
|
||||
UI_PrintStringSmallNormal(String, 0, 0, line);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (gEnteringSMS == SMS_ENTERING_MESSAGE) {
|
||||
UI_PrintString("SMS Dat", 0, 0, line - 1, 8);
|
||||
UI_PrintString("SMS Dat", 0, 0, line - 1 /*, 8 */);
|
||||
sprintf(String, "%s", dataPacket.data);
|
||||
UI_PrintStringSmallNormal(String, 0, 0, line);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (gDTMF_InputMode
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
|| gDTMF_CallState != DTMF_CALL_STATE_NONE || gDTMF_IsTx
|
||||
#endif
|
||||
) {
|
||||
@@ -657,7 +620,7 @@ void UI_DisplayMain(void) {
|
||||
}
|
||||
}
|
||||
|
||||
UI_PrintString(pPrintStr, 2, 0, 2 + (vfo_num * 3), 8);
|
||||
UI_PrintString(pPrintStr, 2, 0, 2 + (vfo_num * 3) /*, 8 */);
|
||||
|
||||
pPrintStr = "";
|
||||
if (!gDTMF_InputMode) {
|
||||
@@ -680,17 +643,17 @@ void UI_DisplayMain(void) {
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
if (isMainOnly()) {
|
||||
UI_PrintString(pPrintStr, 2, 0, 5, 8);
|
||||
UI_PrintString(pPrintStr, 2, 0, 5 /*, 8 */);
|
||||
isMainOnlyInputDTMF = true;
|
||||
center_line = CENTER_LINE_IN_USE;
|
||||
} else {
|
||||
UI_PrintString(pPrintStr, 2, 0, 0 + (vfo_num * 3), 8);
|
||||
UI_PrintString(pPrintStr, 2, 0, 0 + (vfo_num * 3) /*, 8 */);
|
||||
isMainOnlyInputDTMF = false;
|
||||
center_line = CENTER_LINE_IN_USE;
|
||||
continue;
|
||||
}
|
||||
#else
|
||||
UI_PrintString(pPrintStr, 2, 0, 0 + (vfo_num * 3), 8);
|
||||
UI_PrintString(pPrintStr, 2, 0, 0 + (vfo_num * 3) /*, 8 */);
|
||||
center_line = CENTER_LINE_IN_USE;
|
||||
continue;
|
||||
#endif
|
||||
@@ -709,11 +672,11 @@ void UI_DisplayMain(void) {
|
||||
|
||||
uint32_t frequency = gEeprom.VfoInfo[vfo_num].pRX->Frequency;
|
||||
|
||||
if (TX_freq_check(frequency) != 0 && gEeprom.VfoInfo[vfo_num].TX_LOCK == true) {
|
||||
if (TX_freq_check(frequency) != 0) {
|
||||
if (isMainOnly())
|
||||
memcpy(p_line0 + 14, BITMAP_VFO_Lock, sizeof(BITMAP_VFO_Lock));
|
||||
memcpy(p_line0 + 5, gFontKeyLock, sizeof(gFontKeyLock));
|
||||
else
|
||||
memcpy(p_line0 + 24, BITMAP_VFO_Lock, sizeof(BITMAP_VFO_Lock));
|
||||
memcpy(p_line0 + 10, gFontKeyLock, sizeof(gFontKeyLock));
|
||||
}
|
||||
|
||||
if (gCurrentFunction == FUNCTION_TRANSMIT) { // transmitting
|
||||
@@ -750,7 +713,7 @@ void UI_DisplayMain(void) {
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
else {
|
||||
if (RxOnVfofrequency == frequency && !isMainOnly()) {
|
||||
UI_PrintStringSmallNormal(">>", 8, 0, line);
|
||||
UI_PrintStringSmallNormal(">>", 24, 0, line);
|
||||
//memcpy(p_line0 + 14, BITMAP_VFO_Default, sizeof(BITMAP_VFO_Default));
|
||||
}
|
||||
|
||||
@@ -761,7 +724,7 @@ void UI_DisplayMain(void) {
|
||||
}
|
||||
|
||||
if (IS_MR_CHANNEL(gEeprom.ScreenChannel[vfo_num])) { // channel mode
|
||||
const unsigned int x = 2;
|
||||
const unsigned int x = 20;
|
||||
const bool inputting = gInputBoxIndex != 0 && gEeprom.TX_VFO == vfo_num;
|
||||
if (!inputting)
|
||||
sprintf(String, "M%u", gEeprom.ScreenChannel[vfo_num] + 1);
|
||||
@@ -770,7 +733,7 @@ void UI_DisplayMain(void) {
|
||||
UI_PrintStringSmallNormal(String, x, 0, line + 1);
|
||||
} else if (IS_FREQ_CHANNEL(gEeprom.ScreenChannel[vfo_num])) { // frequency mode
|
||||
// show the frequency band number
|
||||
const unsigned int x = 2;
|
||||
const unsigned int x = 0;
|
||||
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_PrintStringSmallNormal(String, x, 0, line + 1);
|
||||
@@ -802,24 +765,15 @@ void UI_DisplayMain(void) {
|
||||
#endif
|
||||
if (state != VFO_STATE_NORMAL) {
|
||||
if (state < ARRAY_SIZE(VfoStateStr))
|
||||
UI_PrintString(VfoStateStr[state], 31, 0, line, 8);
|
||||
UI_PrintString(VfoStateStr[state], 31, 0, line /*, 8 */);
|
||||
} else if (gInputBoxIndex > 0 && IS_FREQ_CHANNEL(gEeprom.ScreenChannel[vfo_num]) &&
|
||||
gEeprom.TX_VFO == vfo_num) { // user entering a frequency
|
||||
const char *ascii = INPUTBOX_GetAscii();
|
||||
bool isGigaF = frequency >= _1GHz_in_KHz;
|
||||
sprintf(String, "%.*s.%.3s", 3 + isGigaF, ascii, ascii + 3 + isGigaF);
|
||||
#ifdef ENABLE_BIG_FREQ
|
||||
if (!isGigaF) {
|
||||
// show the remaining 2 small frequency digits
|
||||
UI_PrintStringSmallNormal(String + 7, 113, 0, line + 1);
|
||||
String[7] = 0;
|
||||
// show the main large frequency digits
|
||||
UI_DisplayFrequency(String, 32, line, false);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
// show the frequency in the main font
|
||||
UI_PrintString(String, 32, 0, line, 8);
|
||||
UI_PrintString(String, 45, 0, line /*, 8 */);
|
||||
}
|
||||
|
||||
continue;
|
||||
@@ -888,19 +842,19 @@ void UI_DisplayMain(void) {
|
||||
UI_PrintStringSmallNormal(String + 7, 113, 0, line + 1);
|
||||
String[7] = 0;
|
||||
// show the main large frequency digits
|
||||
UI_DisplayFrequency(String, 32, line, false);
|
||||
UI_DisplayFrequency(String, 20, line, false);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
// show the frequency in the main font
|
||||
UI_PrintString(String, 32, 0, line, 8);
|
||||
UI_PrintStringSmallBold(String, 40, 0, line /*, 8 */);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case MDF_CHANNEL: // show the channel number
|
||||
sprintf(String, "CH-%03u", gEeprom.ScreenChannel[vfo_num] + 1);
|
||||
UI_PrintString(String, 32, 0, line, 8);
|
||||
UI_PrintStringSmallBold(String, 40, 0, line /*, 8 */);
|
||||
break;
|
||||
|
||||
case MDF_NAME: // show the channel name
|
||||
@@ -912,20 +866,20 @@ void UI_DisplayMain(void) {
|
||||
}
|
||||
|
||||
if (gEeprom.CHANNEL_DISPLAY_MODE == MDF_NAME) {
|
||||
UI_PrintString(String, 32, 0, line, 8);
|
||||
UI_PrintStringSmallBold(String, 40, 0, line /*, 8 */);
|
||||
} else {
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
if (isMainOnly()) {
|
||||
UI_PrintString(String, 32, 0, line, 8);
|
||||
UI_PrintStringSmallBold(String, 40, 0, line /*, 8 */);
|
||||
} else {
|
||||
if (activeTxVFO == vfo_num) {
|
||||
UI_PrintStringSmallBold(String, 32 + 4, 0, line);
|
||||
UI_PrintStringSmallBold(String, 40 + 4, 0, line);
|
||||
} else {
|
||||
UI_PrintStringSmallNormal(String, 32 + 4, 0, line);
|
||||
UI_PrintStringSmallNormal(String, 40 + 4, 0, line);
|
||||
}
|
||||
}
|
||||
#else
|
||||
UI_PrintStringSmallBold(String, 32 + 4, 0, line);
|
||||
UI_PrintStringSmallBold(String, 20 + 4, 0, line);
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
@@ -936,19 +890,19 @@ void UI_DisplayMain(void) {
|
||||
UI_PrintStringSmallNormal(String + 7, 113, 0, line + 4);
|
||||
String[7] = 0;
|
||||
// show the main large frequency digits
|
||||
//UI_DisplayFrequency(String, 32, line + 3, false);
|
||||
UI_PrintStringSmallNormal(String, 0, 20, line + 3);
|
||||
//UI_DisplayFrequency(String, 20, line + 3, false);
|
||||
UI_PrintStringSmallBold(String, 20, 20, line + 3);
|
||||
} else {
|
||||
// show the frequency in the main font
|
||||
UI_PrintString(String, 32, 0, line + 3, 8);
|
||||
UI_PrintString(String, 40, 0, line + 3 /*, 8 */);
|
||||
}
|
||||
} else {
|
||||
sprintf(String, "%03u.%05u", frequency / 100000, frequency % 100000);
|
||||
UI_PrintStringSmallNormal(String, 32 + 4, 0, line + 1);
|
||||
UI_PrintStringSmallBold(String, 40 + 4, 0, line + 1);
|
||||
}
|
||||
#else // show the channel frequency below the channel number/name
|
||||
sprintf(String, "%03u.%05u", frequency / 100000, frequency % 100000);
|
||||
UI_PrintStringSmallNormal(String, 32 + 4, 0, line + 1);
|
||||
UI_PrintStringSmallNormal(String, 20 + 4, 0, line + 1);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -963,12 +917,12 @@ void UI_DisplayMain(void) {
|
||||
UI_PrintStringSmallNormal(String + 7, 113, 0, line + 1);
|
||||
String[7] = 0;
|
||||
// show the main large frequency digits
|
||||
UI_DisplayFrequency(String, 32, line, false);
|
||||
UI_DisplayFrequency(String, 20, line, false);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
// show the frequency in the main font
|
||||
UI_PrintString(String, 32, 0, line, 8);
|
||||
UI_PrintStringSmallBold(String, 40, 0, line /*, 8 */);
|
||||
}
|
||||
|
||||
// show the channel symbols
|
||||
@@ -1075,70 +1029,28 @@ void UI_DisplayMain(void) {
|
||||
shift = -10;
|
||||
}
|
||||
|
||||
if (gSetting_set_gui) {
|
||||
UI_PrintStringSmallNormal(s, LCD_WIDTH + 22, 0, line + 1);
|
||||
UI_PrintStringSmallNormal(t, LCD_WIDTH + 2, 0, line + 1);
|
||||
UI_PrintStringSmallNormal(s, 50, 0, line + 2);
|
||||
UI_PrintStringSmallNormal(t, 2, 0, line + 2);
|
||||
|
||||
if (isMainOnly() && !gDTMF_InputMode) {
|
||||
if (shift == 0) {
|
||||
UI_PrintStringSmallNormal(String, 2, 0, 6);
|
||||
}
|
||||
|
||||
if ((vfoInfo->StepFrequency / 100) < 100) {
|
||||
sprintf(String, "%d.%02uK", vfoInfo->StepFrequency / 100, vfoInfo->StepFrequency % 100);
|
||||
} else {
|
||||
sprintf(String, "%dK", vfoInfo->StepFrequency / 100);
|
||||
}
|
||||
UI_PrintStringSmallNormal(String, 46, 0, 6);
|
||||
}
|
||||
} else {
|
||||
if ((s != NULL) && (s[0] != '\0')) {
|
||||
GUI_DisplaySmallest(s, 58, line == 0 ? 17 : 49, false, true);
|
||||
}
|
||||
|
||||
if ((t != NULL) && (t[0] != '\0')) {
|
||||
GUI_DisplaySmallest(t, 3, line == 0 ? 17 : 49, false, true);
|
||||
}
|
||||
|
||||
GUI_DisplaySmallest(String, 68 + shift, line == 0 ? 17 : 49, false, true);
|
||||
|
||||
//sprintf(String, "%d.%02u", vfoInfo->StepFrequency / 100, vfoInfo->StepFrequency % 100);
|
||||
//GUI_DisplaySmallest(String, 91, line == 0 ? 2 : 34, false, true);
|
||||
if (shift == 0) {
|
||||
UI_PrintStringSmallNormal(String, 65, 0, line + 2);
|
||||
}
|
||||
|
||||
if ((vfoInfo->StepFrequency / 100) < 100) {
|
||||
sprintf(String, "%d.%02uK", vfoInfo->StepFrequency / 100, vfoInfo->StepFrequency % 100);
|
||||
} else {
|
||||
sprintf(String, "%dK", vfoInfo->StepFrequency / 100);
|
||||
}
|
||||
UI_PrintStringSmallNormal(String, 55, 0, line + 1);
|
||||
#else
|
||||
UI_PrintStringSmallNormal(s, LCD_WIDTH + 24, 0, line + 1);
|
||||
#endif
|
||||
|
||||
if (state == VFO_STATE_NORMAL || state == VFO_STATE_ALARM) { // show the TX power
|
||||
uint8_t currentPower = vfoInfo->OUTPUT_POWER % 8;
|
||||
uint8_t arrowPos = 19;
|
||||
bool userPower = false;
|
||||
|
||||
if (currentPower == OUTPUT_POWER_USER) {
|
||||
currentPower = gSetting_set_pwr;
|
||||
userPower = true;
|
||||
} else {
|
||||
currentPower--;
|
||||
userPower = false;
|
||||
}
|
||||
|
||||
if (gSetting_set_gui) {
|
||||
const char pwr_short[][3] = {"L1", "L2", "L3", "L4", "L5", "M", "H"};
|
||||
//sprintf(String, "%s", pwr_short[currentPower]);
|
||||
//UI_PrintStringSmallNormal(String, LCD_WIDTH + 42, 0, line + 1);
|
||||
UI_PrintStringSmallNormal(pwr_short[currentPower], LCD_WIDTH + 42, 0, line + 1);
|
||||
|
||||
arrowPos = 38;
|
||||
} else {
|
||||
const char pwr_long[][5] = {"LOW1", "LOW2", "LOW3", "LOW4", "LOW5", "MID", "HIGH"};
|
||||
//sprintf(String, "%s", pwr_long[currentPower]);
|
||||
//GUI_DisplaySmallest(String, 24, line == 0 ? 17 : 49, false, true);
|
||||
GUI_DisplaySmallest(pwr_long[currentPower], 24, line == 0 ? 17 : 49, false, true);
|
||||
}
|
||||
|
||||
if (userPower == true) {
|
||||
memcpy(p_line0 + 256 + arrowPos, BITMAP_PowerUser, sizeof(BITMAP_PowerUser));
|
||||
}
|
||||
const char pwr_short[][3] = {"L1", "L2", "L3", "L4", "L5", "ME",
|
||||
"HI"};
|
||||
UI_PrintStringSmallNormal(pwr_short[currentPower], LCD_WIDTH + 25, 0, line + 1);
|
||||
}
|
||||
|
||||
if (vfoInfo->freq_config_RX.Frequency != vfoInfo->freq_config_TX.Frequency) { // show the TX offset symbol
|
||||
@@ -1156,22 +1068,7 @@ void UI_DisplayMain(void) {
|
||||
#endif
|
||||
|
||||
#if ENABLE_FEAT_F4HWN
|
||||
if (gSetting_set_gui) {
|
||||
UI_PrintStringSmallNormal(dir_list[i], LCD_WIDTH + 60, 0, line + 1);
|
||||
} else {
|
||||
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
|
||||
if(i == 3)
|
||||
{
|
||||
GUI_DisplaySmallest(dir_list[i], 43, line == 0 ? 17 : 49, false, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
#endif
|
||||
UI_PrintStringSmallNormal(dir_list[i], LCD_WIDTH + 41, 0, line + 1);
|
||||
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
|
||||
}
|
||||
#endif
|
||||
}
|
||||
UI_PrintStringSmallNormal(dir_list[i], LCD_WIDTH + 60, 0, line + 1);
|
||||
#else
|
||||
UI_PrintStringSmallNormal(dir_list[i], LCD_WIDTH + 54, 0, line + 1);
|
||||
#endif
|
||||
@@ -1181,11 +1078,7 @@ void UI_DisplayMain(void) {
|
||||
if (vfoInfo->FrequencyReverse)
|
||||
#if ENABLE_FEAT_F4HWN
|
||||
{
|
||||
if (gSetting_set_gui) {
|
||||
UI_PrintStringSmallNormal("R", LCD_WIDTH + 68, 0, line + 1);
|
||||
} else {
|
||||
GUI_DisplaySmallest("R", 51, line == 0 ? 17 : 49, false, true);
|
||||
}
|
||||
UI_PrintStringSmallNormal("R", LCD_WIDTH + 68, 0, line + 1);
|
||||
}
|
||||
#else
|
||||
UI_PrintStringSmallNormal("R", LCD_WIDTH + 62, 0, line + 1);
|
||||
@@ -1198,16 +1091,9 @@ void UI_DisplayMain(void) {
|
||||
if (vfoInfo->CHANNEL_BANDWIDTH == BANDWIDTH_NARROW && gSetting_set_nfm == 1) {
|
||||
narrower = 1;
|
||||
}
|
||||
|
||||
if (gSetting_set_gui) {
|
||||
const char *bandWidthNames[] = {"W", "N", "N+"};
|
||||
UI_PrintStringSmallNormal(bandWidthNames[vfoInfo->CHANNEL_BANDWIDTH + narrower], LCD_WIDTH + 80, 0,
|
||||
line + 1);
|
||||
} else {
|
||||
const char *bandWidthNames[] = {"WIDE", "NAR", "NAR+"};
|
||||
GUI_DisplaySmallest(bandWidthNames[vfoInfo->CHANNEL_BANDWIDTH + narrower], 91, line == 0 ? 17 : 49, false,
|
||||
true);
|
||||
}
|
||||
const char *bandWidthNames[] = {"WID", "NAR", "NR+"};
|
||||
UI_PrintStringSmallNormal(bandWidthNames[vfoInfo->CHANNEL_BANDWIDTH + narrower], LCD_WIDTH + 30, 0,
|
||||
line);
|
||||
#else
|
||||
if (gSetting_set_gui)
|
||||
{
|
||||
@@ -1232,49 +1118,21 @@ void UI_DisplayMain(void) {
|
||||
#endif
|
||||
|
||||
// show the audio scramble symbol
|
||||
if (vfoInfo->SCRAMBLING_TYPE > 0)
|
||||
UI_PrintStringSmallNormal("S", LCD_WIDTH + 106, 0, line);
|
||||
if (vfoInfo->SCRAMBLING_TYPE > 0) {
|
||||
sprintf(String, "S%d", vfoInfo->SCRAMBLING_TYPE + 25);
|
||||
UI_PrintStringSmallNormal(String, 105, 0, line + 2);
|
||||
}
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
/*
|
||||
if(isMainVFO)
|
||||
{
|
||||
if(gMonitor)
|
||||
{
|
||||
sprintf(String, "%s", "MONI");
|
||||
}
|
||||
|
||||
if (gSetting_set_gui)
|
||||
{
|
||||
if(!gMonitor)
|
||||
{
|
||||
sprintf(String, "SQL%d", gEeprom.SQUELCH_LEVEL);
|
||||
}
|
||||
UI_PrintStringSmallNormal(String, LCD_WIDTH + 98, 0, line + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!gMonitor)
|
||||
{
|
||||
sprintf(String, "SQL%d", gEeprom.SQUELCH_LEVEL);
|
||||
}
|
||||
GUI_DisplaySmallest(String, 110, line == 0 ? 17 : 49, false, true);
|
||||
}
|
||||
}
|
||||
*/
|
||||
if (isMainVFO) {
|
||||
if (gMonitor) {
|
||||
strcpy(String, "MONI");
|
||||
} else {
|
||||
sprintf(String, "SQL%d", gEeprom.SQUELCH_LEVEL);
|
||||
}
|
||||
if (isMainVFO && gMonitor) {
|
||||
strcpy(String, "MONI");
|
||||
|
||||
if (gSetting_set_gui) {
|
||||
UI_PrintStringSmallNormal(String, LCD_WIDTH + 98, 0, line + 1);
|
||||
} else {
|
||||
GUI_DisplaySmallest(String, 110, line == 0 ? 17 : 49, false, true);
|
||||
}
|
||||
} else {
|
||||
sprintf(String, "SQL%d", gEeprom.SQUELCH_LEVEL);
|
||||
}
|
||||
|
||||
UI_PrintStringSmallNormal(String, LCD_WIDTH + 98, 0, line);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1324,7 +1182,7 @@ void UI_DisplayMain(void) {
|
||||
const unsigned int idx = (len > (17 - 5)) ? len - (17 - 5) : 0; // limit to last 'n' chars
|
||||
|
||||
if (gScreenToDisplay != DISPLAY_MAIN
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
|| gDTMF_CallState != DTMF_CALL_STATE_NONE
|
||||
#endif
|
||||
)
|
||||
@@ -1402,4 +1260,4 @@ void UI_DisplayMain(void) {
|
||||
ST7565_BlitFullScreen();
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
// ***************************************************************************
|
229
ui/menu.c
229
ui/menu.c
@@ -54,7 +54,6 @@ const t_menu_item MenuList[] =
|
||||
{"COMP", MENU_COMPAND},
|
||||
{"Mod", MENU_AM}, // was "AM"
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
{"TXLck", MENU_TX_LOCK},
|
||||
#endif
|
||||
{"ScAdd1", MENU_S_ADD1},
|
||||
{"ScAdd2", MENU_S_ADD2},
|
||||
@@ -131,15 +130,12 @@ const t_menu_item MenuList[] =
|
||||
{"RxMode", MENU_TDR},
|
||||
{"Sql", MENU_SQL},
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
{"SPwr", MENU_SET_PWR},
|
||||
{"SPTT", MENU_SET_PTT},
|
||||
{"STOT", MENU_SET_TOT},
|
||||
{"SEOT", MENU_SET_EOT},
|
||||
{"SCtr", MENU_SET_CTR},
|
||||
{"SInv", MENU_SET_INV},
|
||||
{"SLck", MENU_SET_LCK},
|
||||
//{"SMet", MENU_SET_MET},
|
||||
//{"SGUI", MENU_SET_GUI},
|
||||
{"STmr", MENU_SET_TMR},
|
||||
#ifdef ENABLE_FEAT_F4HWN_SLEEP
|
||||
{"SOff", MENU_SET_OFF},
|
||||
@@ -160,13 +156,6 @@ const t_menu_item MenuList[] =
|
||||
// hidden menu items from here on
|
||||
// enabled if pressing both the PTT and upper side button at power-on
|
||||
{"F Lock", MENU_F_LOCK},
|
||||
#ifndef ENABLE_FEAT_F4HWN
|
||||
{"Tx 200", MENU_200TX }, // was "200TX"
|
||||
{"Tx 350", MENU_350TX }, // was "350TX"
|
||||
{"Tx 500", MENU_500TX }, // was "500TX"
|
||||
{"350 En", MENU_350EN }, // was "350EN"
|
||||
#endif
|
||||
//{"ScraEn", MENU_SCREN }, // was "SCREN"
|
||||
#ifdef ENABLE_F_CAL_MENU
|
||||
{"FrCali", MENU_F_CALI}, // reference xtal calibration
|
||||
#endif
|
||||
@@ -177,18 +166,15 @@ const t_menu_item MenuList[] =
|
||||
{"", 0xff} // end of list - DO NOT delete or move this this
|
||||
};
|
||||
|
||||
const uint8_t FIRST_HIDDEN_MENU_ITEM = MENU_F_LOCK;
|
||||
|
||||
const char gSubMenu_TXP[][6] =
|
||||
const char gSubMenu_TXP[][5] =
|
||||
{
|
||||
"USR",
|
||||
"L1",
|
||||
"L2",
|
||||
"L3",
|
||||
"L4",
|
||||
"L5",
|
||||
"M",
|
||||
"H"
|
||||
"<.02",
|
||||
".125",
|
||||
".25",
|
||||
".5",
|
||||
"1",
|
||||
"2",
|
||||
"5"
|
||||
};
|
||||
|
||||
const char gSubMenu_SFT_D[][4] =
|
||||
@@ -333,32 +319,7 @@ const char gSubMenu_BATTYP[][9] =
|
||||
"35"
|
||||
};
|
||||
|
||||
const char gSubMenu_SCRAMBLER[][7] =
|
||||
{
|
||||
"OFF",
|
||||
"26K",
|
||||
"27K",
|
||||
"28K",
|
||||
"29K",
|
||||
"30K",
|
||||
"31K",
|
||||
"32K",
|
||||
"33K",
|
||||
"34K",
|
||||
"35K"
|
||||
};
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
const char gSubMenu_SET_PWR[][6] =
|
||||
{
|
||||
"<.02",
|
||||
".125",
|
||||
".25",
|
||||
".5",
|
||||
"1",
|
||||
"2",
|
||||
"5"
|
||||
};
|
||||
|
||||
const char gSubMenu_SET_PTT[][8] =
|
||||
{
|
||||
@@ -374,12 +335,6 @@ const char gSubMenu_SET_TOT[][7] = // Use by SET_EOT too
|
||||
"ALL"
|
||||
};
|
||||
|
||||
const char gSubMenu_SET_LCK[][9] =
|
||||
{
|
||||
"KEY",
|
||||
"KEY+PTT"
|
||||
};
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN_NARROWER
|
||||
const char gSubMenu_SET_NFM[][9] =
|
||||
{
|
||||
@@ -500,7 +455,7 @@ void UI_DisplayMenu(void) {
|
||||
for (i = 0; i < 3; i++)
|
||||
if (gMenuCursor > 0 || i > 0)
|
||||
if ((gMenuListCount - 1) != gMenuCursor || i != 2)
|
||||
UI_PrintString(MenuList[gMenuCursor + i - 1].name, 0, 0, i * 2, 8);
|
||||
UI_PrintString(MenuList[gMenuCursor + i - 1].name, 0, 0, i * 2 /*, 8 */);
|
||||
|
||||
// invert the current menu list item pixels
|
||||
for (i = 0; i < (8 * menu_list_width); i++)
|
||||
@@ -525,14 +480,17 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
|
||||
#else
|
||||
{ // new menu layout .. experimental & unfinished
|
||||
const int menu_index = gMenuCursor; // current selected menu item
|
||||
i = 1;
|
||||
i = 0;
|
||||
|
||||
if (!gIsInSubMenu) {
|
||||
while (i < 2) { // leading menu items - small text
|
||||
const int k = menu_index + i - 2;
|
||||
if (k < 0)
|
||||
UI_PrintStringSmallNormal(MenuList[gMenuListCount + k].name, 0, 0, i); // wrap-a-round
|
||||
else if (k >= 0 && k < (int) gMenuListCount)
|
||||
UI_PrintStringSmallNormal(MenuList[(gMenuListCount + k) % gMenuListCount].name, 0, 0,
|
||||
i); // wrap-around
|
||||
else if (k >= (int) gMenuListCount)
|
||||
UI_PrintStringSmallNormal(MenuList[k % gMenuListCount].name, 0, 0, i); // wrap-around
|
||||
else
|
||||
UI_PrintStringSmallNormal(MenuList[k].name, 0, 0, i);
|
||||
i++;
|
||||
}
|
||||
@@ -546,10 +504,13 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
|
||||
|
||||
while (i < 5) { // trailing menu item - small text
|
||||
const int k = menu_index + i - 2;
|
||||
if (k >= 0 && k < (int) gMenuListCount)
|
||||
UI_PrintStringSmallNormal(MenuList[k].name, 0, 0, i);
|
||||
if (k < 0)
|
||||
UI_PrintStringSmallNormal(MenuList[(gMenuListCount + k) % gMenuListCount].name, 0, 0,
|
||||
i); // wrap-around
|
||||
else if (k >= (int) gMenuListCount)
|
||||
UI_PrintStringSmallNormal(MenuList[gMenuListCount - k].name, 0, 0, i); // wrap-a-round
|
||||
UI_PrintStringSmallNormal(MenuList[k % gMenuListCount].name, 0, 0, i); // wrap-around
|
||||
else
|
||||
UI_PrintStringSmallNormal(MenuList[k].name, 0, 0, i);
|
||||
i++;
|
||||
}
|
||||
|
||||
@@ -560,7 +521,7 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
|
||||
#endif
|
||||
} else if (menu_index >= 0 && menu_index < (int) gMenuListCount) { // current menu item
|
||||
// strcat(String, ":");
|
||||
UI_PrintString(MenuList[menu_index].name, 0, 0, 0, 8);
|
||||
UI_PrintString(MenuList[menu_index].name, 0, 0, 0 /*, 8 */);
|
||||
// UI_PrintStringSmallNormal(String, 0, 0, 0);
|
||||
}
|
||||
|
||||
@@ -615,11 +576,7 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
|
||||
}
|
||||
|
||||
case MENU_TXP:
|
||||
if (gSubMenuSelection == 0) {
|
||||
strcpy(String, gSubMenu_TXP[gSubMenuSelection]);
|
||||
} else {
|
||||
sprintf(String, "%s\n%sW", gSubMenu_TXP[gSubMenuSelection], gSubMenu_SET_PWR[gSubMenuSelection - 1]);
|
||||
}
|
||||
sprintf(String, "%sW", gSubMenu_TXP[gSubMenuSelection]);
|
||||
break;
|
||||
|
||||
case MENU_R_DCS:
|
||||
@@ -649,14 +606,14 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
|
||||
case MENU_OFFSET:
|
||||
if (!gIsInSubMenu || gInputBoxIndex == 0) {
|
||||
sprintf(String, "%3d.%05u", gSubMenuSelection / 100000, abs(gSubMenuSelection) % 100000);
|
||||
UI_PrintString(String, menu_item_x1, menu_item_x2, 1, 8);
|
||||
UI_PrintString(String, menu_item_x1, menu_item_x2, 1 /*, 8 */);
|
||||
} else {
|
||||
const char *ascii = INPUTBOX_GetAscii();
|
||||
sprintf(String, "%.3s.%.3s ", ascii, ascii + 3);
|
||||
UI_PrintString(String, menu_item_x1, menu_item_x2, 1, 8);
|
||||
UI_PrintString(String, menu_item_x1, menu_item_x2, 1 /*, 8 */);
|
||||
}
|
||||
|
||||
UI_PrintString("MHz", menu_item_x1, menu_item_x2, 3, 8);
|
||||
UI_PrintString("MHz", menu_item_x1, menu_item_x2, 3 /*, 8 */);
|
||||
|
||||
already_printed = true;
|
||||
break;
|
||||
@@ -666,11 +623,13 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
|
||||
break;
|
||||
|
||||
case MENU_SCR:
|
||||
strcpy(String, gSubMenu_SCRAMBLER[gSubMenuSelection]);
|
||||
if (gSubMenuSelection > 0)
|
||||
if (gSubMenuSelection > 0) {
|
||||
sprintf(String, "%d00", gSubMenuSelection + 25);
|
||||
BK4819_EnableScramble(gSubMenuSelection - 1);
|
||||
else
|
||||
} else {
|
||||
strcpy(String, "OFF");
|
||||
BK4819_DisableScramble();
|
||||
}
|
||||
break;
|
||||
|
||||
case MENU_VOX:
|
||||
@@ -757,13 +716,6 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
|
||||
#ifdef ENABLE_NOAA
|
||||
case MENU_NOAA_S:
|
||||
#endif
|
||||
#ifndef ENABLE_FEAT_F4HWN
|
||||
case MENU_350TX:
|
||||
case MENU_200TX:
|
||||
case MENU_500TX:
|
||||
#endif
|
||||
case MENU_350EN:
|
||||
//case MENU_SCREN:
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
case MENU_SET_TMR:
|
||||
#endif
|
||||
@@ -776,16 +728,16 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
|
||||
const bool valid = RADIO_CheckValidChannel(gSubMenuSelection, false, 0);
|
||||
|
||||
UI_GenerateChannelStringEx(String, valid, gSubMenuSelection);
|
||||
UI_PrintString(String, menu_item_x1, menu_item_x2, 0, 8);
|
||||
UI_PrintString(String, menu_item_x1, menu_item_x2, 0 /*, 8 */);
|
||||
|
||||
if (valid && !gAskForConfirmation) { // show the frequency so that the user knows the channels frequency
|
||||
const uint32_t frequency = SETTINGS_FetchChannelFrequency(gSubMenuSelection);
|
||||
sprintf(String, "%u.%05u", frequency / 100000, frequency % 100000);
|
||||
UI_PrintString(String, menu_item_x1, menu_item_x2, 4, 8);
|
||||
UI_PrintString(String, menu_item_x1, menu_item_x2, 4 /*, 8 */);
|
||||
}
|
||||
|
||||
SETTINGS_FetchChannelName(String, gSubMenuSelection);
|
||||
UI_PrintString(String[0] ? String : "--", menu_item_x1, menu_item_x2, 2, 8);
|
||||
UI_PrintString(String[0] ? String : "--", menu_item_x1, menu_item_x2, 2 /*, 8 */);
|
||||
already_printed = true;
|
||||
break;
|
||||
}
|
||||
@@ -794,7 +746,7 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
|
||||
const bool valid = RADIO_CheckValidChannel(gSubMenuSelection, false, 0);
|
||||
|
||||
UI_GenerateChannelStringEx(String, valid, gSubMenuSelection);
|
||||
UI_PrintString(String, menu_item_x1, menu_item_x2, 0, 8);
|
||||
UI_PrintString(String, menu_item_x1, menu_item_x2, 0 /*, 8 */);
|
||||
|
||||
if (valid) {
|
||||
const uint32_t frequency = SETTINGS_FetchChannelFrequency(gSubMenuSelection);
|
||||
@@ -805,18 +757,18 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
|
||||
if (edit_index < 0) { // show the channel name
|
||||
SETTINGS_FetchChannelName(String, gSubMenuSelection);
|
||||
char *pPrintStr = String[0] ? String : "--";
|
||||
UI_PrintString(pPrintStr, menu_item_x1, menu_item_x2, 2, 8);
|
||||
UI_PrintString(pPrintStr, menu_item_x1, menu_item_x2, 2 /*, 8 */);
|
||||
} else { // show the channel name being edited
|
||||
//UI_PrintString(edit, menu_item_x1, 0, 2, 8);
|
||||
UI_PrintString(edit, menu_item_x1, menu_item_x2, 2, 8);
|
||||
//UI_PrintString(edit, menu_item_x1, 0, 2 /*, 8 */);
|
||||
UI_PrintString(edit, menu_item_x1, menu_item_x2, 2 /*, 8 */);
|
||||
if (edit_index < 10)
|
||||
//UI_PrintString("^", menu_item_x1 + (8 * edit_index), 0, 4, 8); // show the cursor
|
||||
UI_PrintString("^", menu_item_x1 - 1 + (8 * edit_index), 0, 4, 8); // show the cursor
|
||||
//UI_PrintString("^", menu_item_x1 + (8 * edit_index), 0, 4 /*, 8 */); // show the cursor
|
||||
UI_PrintString("^", menu_item_x1 - 1 + (8 * edit_index), 0, 4 /*, 8 */); // show the cursor
|
||||
}
|
||||
|
||||
if (!gAskForConfirmation) { // show the frequency so that the user knows the channels frequency
|
||||
sprintf(String, "%u.%05u", frequency / 100000, frequency % 100000);
|
||||
UI_PrintString(String, menu_item_x1, menu_item_x2, 4 + (gIsInSubMenu && edit_index >= 0), 8);
|
||||
UI_PrintString(String, menu_item_x1, menu_item_x2, 4 + (gIsInSubMenu && edit_index >= 0) /*, 8 */);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -958,17 +910,17 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
|
||||
break;
|
||||
|
||||
#ifdef ENABLE_F_CAL_MENU
|
||||
case MENU_F_CALI: {
|
||||
const uint32_t value = 22656 + gSubMenuSelection;
|
||||
const uint32_t xtal_Hz = (0x4f0000u + value) * 5;
|
||||
case MENU_F_CALI: {
|
||||
const uint32_t value = 22656 + gSubMenuSelection;
|
||||
const uint32_t xtal_Hz = (0x4f0000u + value) * 5;
|
||||
|
||||
writeXtalFreqCal(gSubMenuSelection, false);
|
||||
writeXtalFreqCal(gSubMenuSelection, false);
|
||||
|
||||
sprintf(String, "%d\n%u.%06u\nMHz",
|
||||
gSubMenuSelection,
|
||||
xtal_Hz / 1000000, xtal_Hz % 1000000);
|
||||
}
|
||||
break;
|
||||
sprintf(String, "%d\n%u.%06u\nMHz",
|
||||
gSubMenuSelection,
|
||||
xtal_Hz / 1000000, xtal_Hz % 1000000);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
case MENU_BATCAL: {
|
||||
@@ -1006,10 +958,6 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
case MENU_SET_PWR:
|
||||
sprintf(String, "%s\n%sW", gSubMenu_TXP[gSubMenuSelection + 1], gSubMenu_SET_PWR[gSubMenuSelection]);
|
||||
break;
|
||||
|
||||
case MENU_SET_PTT:
|
||||
strcpy(String, gSubMenu_SET_PTT[gSubMenuSelection]);
|
||||
break;
|
||||
@@ -1038,23 +986,6 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
|
||||
#endif
|
||||
break;
|
||||
|
||||
case MENU_TX_LOCK:
|
||||
if (TX_freq_check(gEeprom.VfoInfo[gEeprom.TX_VFO].pRX->Frequency) == 0) {
|
||||
strcpy(String, "Inside\nF Lock\nPlan");
|
||||
} else {
|
||||
strcpy(String, gSubMenu_OFF_ON[gSubMenuSelection]);
|
||||
}
|
||||
break;
|
||||
|
||||
case MENU_SET_LCK:
|
||||
strcpy(String, gSubMenu_SET_LCK[gSubMenuSelection]);
|
||||
break;
|
||||
|
||||
//case MENU_SET_MET:
|
||||
//case MENU_SET_GUI:
|
||||
strcpy(String, gSubMenu_SET_MET[gSubMenuSelection]); // Same as SET_MET
|
||||
break;
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN_NARROWER
|
||||
case MENU_SET_NFM:
|
||||
strcpy(String, gSubMenu_SET_NFM[gSubMenuSelection]);
|
||||
@@ -1062,25 +993,25 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN_VOL
|
||||
case MENU_SET_VOL:
|
||||
if (gSubMenuSelection == 0) {
|
||||
strcpy(String, gSubMenu_OFF_ON[0]);
|
||||
} else if (gSubMenuSelection < 64) {
|
||||
sprintf(String, "%02u", gSubMenuSelection);
|
||||
case MENU_SET_VOL:
|
||||
if (gSubMenuSelection == 0) {
|
||||
strcpy(String, gSubMenu_OFF_ON[0]);
|
||||
} else if (gSubMenuSelection < 64) {
|
||||
sprintf(String, "%02u", gSubMenuSelection);
|
||||
#if !defined(ENABLE_SPECTRUM) || !defined(ENABLE_FMRADIO)
|
||||
//ST7565_Gauge(4, 1, 63, gSubMenuSelection);
|
||||
gaugeLine = 4;
|
||||
gaugeMin = 1;
|
||||
gaugeMax = 63;
|
||||
//ST7565_Gauge(4, 1, 63, gSubMenuSelection);
|
||||
gaugeLine = 4;
|
||||
gaugeMin = 1;
|
||||
gaugeMax = 63;
|
||||
#endif
|
||||
}
|
||||
gEeprom.VOLUME_GAIN = gSubMenuSelection;
|
||||
BK4819_WriteRegister(BK4819_REG_48,
|
||||
(11u << 12) | // ??? .. 0 ~ 15, doesn't seem to make any difference
|
||||
(0u << 10) | // AF Rx Gain-1
|
||||
(gEeprom.VOLUME_GAIN << 4) | // AF Rx Gain-2
|
||||
(gEeprom.DAC_GAIN << 0)); // AF DAC Gain (after Gain-1 and Gain-2)
|
||||
break;
|
||||
}
|
||||
gEeprom.VOLUME_GAIN = gSubMenuSelection;
|
||||
BK4819_WriteRegister(BK4819_REG_48,
|
||||
(11u << 12) | // ??? .. 0 ~ 15, doesn't seem to make any difference
|
||||
(0u << 10) | // AF Rx Gain-1
|
||||
(gEeprom.VOLUME_GAIN << 4) | // AF Rx Gain-2
|
||||
(gEeprom.DAC_GAIN << 0)); // AF DAC Gain (after Gain-1 and Gain-2)
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN_RESCUE_OPS
|
||||
@@ -1092,11 +1023,11 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
|
||||
|
||||
}
|
||||
|
||||
#if !defined(ENABLE_SPECTRUM) || !defined(ENABLE_FMRADIO)
|
||||
if (gaugeLine != 0) {
|
||||
ST7565_Gauge(gaugeLine, gaugeMin, gaugeMax, gSubMenuSelection);
|
||||
}
|
||||
#endif
|
||||
//#if !defined(ENABLE_SPECTRUM) || !defined(ENABLE_FMRADIO)
|
||||
// if (gaugeLine != 0) {
|
||||
// ST7565_Gauge(gaugeLine, gaugeMin, gaugeMax, gSubMenuSelection);
|
||||
// }
|
||||
//#endif
|
||||
|
||||
if (!already_printed) { // we now do multi-line text in a single string
|
||||
|
||||
@@ -1135,7 +1066,7 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
|
||||
if (small)
|
||||
UI_PrintStringSmallNormal(String + i, menu_item_x1, menu_item_x2, y);
|
||||
else
|
||||
UI_PrintString(String + i, menu_item_x1, menu_item_x2, y, 8);
|
||||
UI_PrintString(String + i, menu_item_x1, menu_item_x2, y /*, 8 */);
|
||||
|
||||
// look for start of next line
|
||||
while (i < len && String[i] >= 32)
|
||||
@@ -1164,21 +1095,21 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
|
||||
}
|
||||
|
||||
// channel number
|
||||
UI_PrintString(pPrintStr, menu_item_x1, menu_item_x2, 0, 8);
|
||||
UI_PrintString(pPrintStr, menu_item_x1, menu_item_x2, 0 /*, 8 */);
|
||||
|
||||
SETTINGS_FetchChannelName(String, gSubMenuSelection);
|
||||
pPrintStr = String[0] ? String : "--";
|
||||
|
||||
// channel name and scan-list
|
||||
if (gSubMenuSelection < 0 || !gEeprom.SCAN_LIST_ENABLED[i]) {
|
||||
UI_PrintString(pPrintStr, menu_item_x1, menu_item_x2, 2, 8);
|
||||
UI_PrintString(pPrintStr, menu_item_x1, menu_item_x2, 2 /*, 8 */);
|
||||
} else {
|
||||
/*
|
||||
UI_PrintStringSmallNormal(pPrintStr, menu_item_x1, menu_item_x2, 2);
|
||||
|
||||
if (IS_MR_CHANNEL(gEeprom.SCANLIST_PRIORITY_CH1[i])) {
|
||||
sprintf(String, "PRI%d:%u", 1, gEeprom.SCANLIST_PRIORITY_CH1[i] + 1);
|
||||
UI_PrintString(String, menu_item_x1, menu_item_x2, 3, 8);
|
||||
UI_PrintString(String, menu_item_x1, menu_item_x2, 3 , 8);
|
||||
}
|
||||
|
||||
if (IS_MR_CHANNEL(gEeprom.SCANLIST_PRIORITY_CH2[i])) {
|
||||
@@ -1194,7 +1125,7 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
|
||||
|
||||
if (IS_MR_CHANNEL(channel)) {
|
||||
sprintf(String, "PRI%d:%u", pri, channel + 1);
|
||||
UI_PrintString(String, menu_item_x1, menu_item_x2, pri * 2 + 1, 8);
|
||||
UI_PrintString(String, menu_item_x1, menu_item_x2, pri * 2 + 1 /*, 8 */);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1202,14 +1133,14 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
|
||||
}
|
||||
|
||||
if ((UI_MENU_GetCurrentMenuId() == MENU_R_CTCS || UI_MENU_GetCurrentMenuId() == MENU_R_DCS) && gCssBackgroundScan)
|
||||
UI_PrintString("SCAN", menu_item_x1, menu_item_x2, 4, 8);
|
||||
UI_PrintString("SCAN", menu_item_x1, menu_item_x2, 4 /*, 8 */);
|
||||
|
||||
#ifdef ENABLE_DTMF_CALLING
|
||||
if (UI_MENU_GetCurrentMenuId() == MENU_D_LIST && gIsDtmfContactValid) {
|
||||
Contact[11] = 0;
|
||||
memcpy(&gDTMF_ID, Contact + 8, 4);
|
||||
sprintf(String, "ID:%4s", gDTMF_ID);
|
||||
UI_PrintString(String, menu_item_x1, menu_item_x2, 4, 8);
|
||||
UI_PrintString(String, menu_item_x1, menu_item_x2, 4 /*, 8 */);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1230,7 +1161,7 @@ UI_PrintStringSmallNormal(String, 2, 0, 6);
|
||||
UI_MENU_GetCurrentMenuId() == MENU_MEM_NAME ||
|
||||
UI_MENU_GetCurrentMenuId() == MENU_DEL_CH) && gAskForConfirmation) { // display confirmation
|
||||
char *pPrintStr = (gAskForConfirmation == 1) ? "SURE?" : "WAIT!";
|
||||
UI_PrintString(pPrintStr, menu_item_x1, menu_item_x2, 5, 8);
|
||||
UI_PrintString(pPrintStr, menu_item_x1, menu_item_x2, 5 /*, 8 */);
|
||||
}
|
||||
|
||||
ST7565_BlitFullScreen();
|
||||
|
21
ui/menu.h
21
ui/menu.h
@@ -42,9 +42,6 @@ enum {
|
||||
MENU_W_N,
|
||||
MENU_SCR,
|
||||
MENU_BCL,
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
MENU_TX_LOCK,
|
||||
#endif
|
||||
MENU_MEM_CH,
|
||||
MENU_DEL_CH,
|
||||
MENU_MEM_NAME,
|
||||
@@ -110,13 +107,6 @@ enum {
|
||||
#endif
|
||||
MENU_RESET,
|
||||
MENU_F_LOCK,
|
||||
#ifndef ENABLE_FEAT_F4HWN
|
||||
MENU_200TX,
|
||||
MENU_350TX,
|
||||
MENU_500TX,
|
||||
MENU_SCREN,
|
||||
#endif
|
||||
MENU_350EN,
|
||||
#ifdef ENABLE_F_CAL_MENU
|
||||
MENU_F_CALI, // reference xtal calibration
|
||||
#endif
|
||||
@@ -124,15 +114,12 @@ enum {
|
||||
MENU_SET_OFF,
|
||||
#endif
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
MENU_SET_PWR,
|
||||
MENU_SET_PTT,
|
||||
MENU_SET_TOT,
|
||||
MENU_SET_EOT,
|
||||
MENU_SET_CTR,
|
||||
MENU_SET_INV,
|
||||
MENU_SET_LCK,
|
||||
MENU_SET_MET,
|
||||
MENU_SET_GUI,
|
||||
MENU_SET_TMR,
|
||||
#ifdef ENABLE_FEAT_F4HWN_NARROWER
|
||||
MENU_SET_NFM,
|
||||
@@ -156,10 +143,9 @@ enum {
|
||||
MENU_BATTYP
|
||||
};
|
||||
|
||||
extern const uint8_t FIRST_HIDDEN_MENU_ITEM;
|
||||
extern const t_menu_item MenuList[];
|
||||
|
||||
extern const char gSubMenu_TXP[8][6];
|
||||
extern const char gSubMenu_TXP[7][5];
|
||||
extern const char gSubMenu_SFT_D[3][4];
|
||||
extern const char gSubMenu_W_N[2][7];
|
||||
extern const char gSubMenu_OFF_ON[2][4];
|
||||
@@ -179,11 +165,8 @@ extern const char gSubMenu_D_RSP[4][11];
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_FEAT_F4HWN
|
||||
extern const char gSubMenu_SET_PWR[7][6];
|
||||
extern const char gSubMenu_SET_PTT[2][8];
|
||||
extern const char gSubMenu_SET_TOT[4][7];
|
||||
extern const char gSubMenu_SET_LCK[2][9];
|
||||
extern const char gSubMenu_SET_MET[2][8];
|
||||
#ifdef ENABLE_FEAT_F4HWN_NARROWER
|
||||
extern const char gSubMenu_SET_NFM[2][9];
|
||||
#endif
|
||||
@@ -201,8 +184,6 @@ extern const char gSubMenu_RX_TX[4][6];
|
||||
extern const char gSubMenu_BAT_TXT[3][8];
|
||||
extern const char gSubMenu_BATTYP[3][9];
|
||||
|
||||
extern const char gSubMenu_SCRAMBLER[11][7];
|
||||
|
||||
typedef struct {
|
||||
char *name;
|
||||
uint8_t id;
|
||||
|
16
ui/scanner.c
16
ui/scanner.c
@@ -40,7 +40,7 @@ void UI_DisplayScanner(void)
|
||||
pPrintStr = "FREQ:**.*****";
|
||||
}
|
||||
|
||||
UI_PrintString(pPrintStr, 2, 0, 1, 8);
|
||||
UI_PrintString(pPrintStr, 2, 0, 1 /*, 8 */);
|
||||
|
||||
if (gScanCssState < SCAN_CSS_STATE_FOUND || !gScanUseCssResult) {
|
||||
pPrintStr = "CTC:******";
|
||||
@@ -52,10 +52,10 @@ void UI_DisplayScanner(void)
|
||||
pPrintStr = String;
|
||||
}
|
||||
|
||||
UI_PrintString(pPrintStr, 2, 0, 3, 8);
|
||||
UI_PrintString(pPrintStr, 2, 0, 3 /*, 8 */);
|
||||
memset(String, 0, sizeof(String));
|
||||
if (gScannerSaveState == SCAN_SAVE_CHANNEL) {
|
||||
pPrintStr = "SAVE?";
|
||||
pPrintStr = "SAV?";
|
||||
Start = 0;
|
||||
bCentered = 1;
|
||||
} else {
|
||||
@@ -63,21 +63,21 @@ void UI_DisplayScanner(void)
|
||||
bCentered = 0;
|
||||
|
||||
if (gScannerSaveState == SCAN_SAVE_CHAN_SEL) {
|
||||
strcpy(String, "SAVE:");
|
||||
strcpy(String, "SAV:");
|
||||
UI_GenerateChannelStringEx(String + 5, gShowChPrefix, gScanChannel);
|
||||
pPrintStr = String;
|
||||
} else if (gScanCssState < SCAN_CSS_STATE_FOUND) {
|
||||
strcpy(String, "SCAN");
|
||||
strcpy(String, "SCN");
|
||||
memset(String + 4, '.', (gScanProgressIndicator & 7) + 1);
|
||||
pPrintStr = String;
|
||||
} else if (gScanCssState == SCAN_CSS_STATE_FOUND) {
|
||||
pPrintStr = "SCAN CMP.";
|
||||
pPrintStr = "SCN CMP.";
|
||||
} else {
|
||||
pPrintStr = "SCAN FAIL.";
|
||||
pPrintStr = "SCN FAIL.";
|
||||
}
|
||||
}
|
||||
|
||||
UI_PrintString(pPrintStr, Start, bCentered ? 127 : 0, 5, 8);
|
||||
UI_PrintString(pPrintStr, Start, bCentered ? 127 : 0, 5 /*, 8 */);
|
||||
|
||||
ST7565_BlitFullScreen();
|
||||
}
|
||||
|
@@ -35,8 +35,7 @@ void UI_DisplayReleaseKeys(void) {
|
||||
#endif
|
||||
UI_DisplayClear();
|
||||
|
||||
UI_PrintString("RELEASE", 0, 127, 1, 10);
|
||||
UI_PrintString("ALL KEYS", 0, 127, 3, 10);
|
||||
UI_PrintString("RELEASE KEYS", 0, 127, 1 /*, 10 */);
|
||||
|
||||
ST7565_BlitStatusLine(); // blank status line
|
||||
ST7565_BlitFullScreen();
|
||||
|
Reference in New Issue
Block a user