Merge remote-tracking branch 'remotes/OneOfEleven/main'
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
char gInputBox[8];
|
||||
uint8_t gInputBoxIndex;
|
||||
|
||||
void INPUTBOX_Append(char Digit)
|
||||
void INPUTBOX_Append(const KEY_Code_t Digit)
|
||||
{
|
||||
if (gInputBoxIndex >= sizeof(gInputBox))
|
||||
return;
|
||||
@@ -29,6 +29,7 @@ void INPUTBOX_Append(char Digit)
|
||||
if (gInputBoxIndex == 0)
|
||||
memset(gInputBox, 10, sizeof(gInputBox));
|
||||
|
||||
gInputBox[gInputBoxIndex++] = Digit;
|
||||
if (Digit >= KEY_0 && Digit != KEY_INVALID)
|
||||
gInputBox[gInputBoxIndex++] = (char)(Digit - KEY_0);
|
||||
}
|
||||
|
||||
|
@@ -19,10 +19,12 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "driver/keyboard.h"
|
||||
|
||||
extern char gInputBox[8];
|
||||
extern uint8_t gInputBoxIndex;
|
||||
|
||||
void INPUTBOX_Append(char Digit);
|
||||
void INPUTBOX_Append(const KEY_Code_t Digit);
|
||||
|
||||
#endif
|
||||
|
||||
|
@@ -14,6 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifdef ENABLE_PWRON_PASSWORD
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "ARMCM0.h"
|
||||
@@ -156,3 +158,5 @@ void UI_DisplayLock(void)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -17,7 +17,9 @@
|
||||
#ifndef UI_LOCK_H
|
||||
#define UI_LOCK_H
|
||||
|
||||
void UI_DisplayLock(void);
|
||||
#ifdef ENABLE_PWRON_PASSWORD
|
||||
void UI_DisplayLock(void);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
36
ui/main.c
36
ui/main.c
@@ -14,6 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough="
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h> // abs()
|
||||
|
||||
@@ -42,6 +46,9 @@ center_line_t center_line = CENTER_LINE_NONE;
|
||||
|
||||
void UI_drawBars(uint8_t *p, const unsigned int level)
|
||||
{
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough="
|
||||
|
||||
switch (level)
|
||||
{
|
||||
default:
|
||||
@@ -54,6 +61,8 @@ void UI_drawBars(uint8_t *p, const unsigned int level)
|
||||
case 1: memmove(p + 0, BITMAP_Antenna, sizeof(BITMAP_Antenna));
|
||||
case 0: break;
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic pop
|
||||
}
|
||||
|
||||
#ifdef ENABLE_AUDIO_BAR
|
||||
@@ -214,6 +223,8 @@ void UI_UpdateRSSI(const int16_t rssi, const int vfo)
|
||||
{
|
||||
#ifdef ENABLE_RSSI_BAR
|
||||
|
||||
(void)vfo; // unused
|
||||
|
||||
// optional larger RSSI dBm, S-point and bar level
|
||||
|
||||
if (center_line != CENTER_LINE_RSSI)
|
||||
@@ -333,13 +344,13 @@ void UI_DisplayMain(void)
|
||||
for (vfo_num = 0; vfo_num < 2; vfo_num++)
|
||||
{
|
||||
const unsigned int line = (vfo_num == 0) ? line0 : line1;
|
||||
uint8_t channel = gEeprom.TX_VFO;
|
||||
// uint8_t tx_channel = (gEeprom.CROSS_BAND_RX_TX == CROSS_BAND_OFF) ? gEeprom.RX_VFO : gEeprom.TX_VFO;
|
||||
unsigned int channel = gEeprom.TX_VFO;
|
||||
// unsigned int tx_channel = (gEeprom.CROSS_BAND_RX_TX == CROSS_BAND_OFF) ? gEeprom.RX_VFO : gEeprom.TX_VFO;
|
||||
const bool same_vfo = (channel == vfo_num) ? true : false;
|
||||
uint8_t *p_line0 = gFrameBuffer[line + 0];
|
||||
uint8_t *p_line1 = gFrameBuffer[line + 1];
|
||||
uint8_t mode = 0;
|
||||
uint8_t state;
|
||||
unsigned int mode = 0;
|
||||
unsigned int state;
|
||||
|
||||
if (single_vfo)
|
||||
{ // we're in single VFO mode - screen is dedicated to just one VFO
|
||||
@@ -457,7 +468,7 @@ void UI_DisplayMain(void)
|
||||
}
|
||||
}
|
||||
|
||||
if (IS_MR_CHANNEL(gEeprom.ScreenChannel[vfo_num]))
|
||||
if (gEeprom.ScreenChannel[vfo_num] <= MR_CHANNEL_LAST)
|
||||
{ // channel mode
|
||||
const unsigned int x = 2;
|
||||
const bool inputting = (gInputBoxIndex == 0 || gEeprom.TX_VFO != vfo_num) ? false : true;
|
||||
@@ -508,7 +519,7 @@ void UI_DisplayMain(void)
|
||||
if (state != VFO_STATE_NORMAL)
|
||||
{
|
||||
const char *state_list[] = {"", "BUSY", "BAT LOW", "TX DISABLE", "TIMEOUT", "ALARM", "VOLT HIGH"};
|
||||
if (state >= 0 && state < ARRAY_SIZE(state_list))
|
||||
if (state < ARRAY_SIZE(state_list))
|
||||
UI_PrintString(state_list[state], 31, 0, line, 8);
|
||||
}
|
||||
else
|
||||
@@ -528,8 +539,8 @@ void UI_DisplayMain(void)
|
||||
frequency = gEeprom.VfoInfo[vfo_num].pTX->Frequency;
|
||||
}
|
||||
|
||||
if (IS_MR_CHANNEL(gEeprom.ScreenChannel[vfo_num]))
|
||||
{ // channel mode
|
||||
if (gEeprom.ScreenChannel[vfo_num] <= MR_CHANNEL_LAST)
|
||||
{ // it's a channel
|
||||
|
||||
// show the channel symbols
|
||||
const uint8_t attributes = gMR_ChannelAttributes[gEeprom.ScreenChannel[vfo_num]];
|
||||
@@ -546,6 +557,9 @@ void UI_DisplayMain(void)
|
||||
|
||||
#endif
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough="
|
||||
|
||||
switch (gEeprom.CHANNEL_DISPLAY_MODE)
|
||||
{
|
||||
case MDF_FREQUENCY: // show the channel frequency
|
||||
@@ -595,6 +609,8 @@ void UI_DisplayMain(void)
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic pop
|
||||
}
|
||||
else
|
||||
{ // frequency mode
|
||||
@@ -660,7 +676,7 @@ void UI_DisplayMain(void)
|
||||
const FREQ_Config_t *pConfig = (mode == 1) ? gEeprom.VfoInfo[vfo_num].pTX : gEeprom.VfoInfo[vfo_num].pRX;
|
||||
const unsigned int code_type = pConfig->CodeType;
|
||||
const char *code_list[] = {"", "CT", "DCS", "DCR"};
|
||||
if (code_type >= 0 && code_type < ARRAY_SIZE(code_list))
|
||||
if (code_type < ARRAY_SIZE(code_list))
|
||||
strcpy(String, code_list[code_type]);
|
||||
}
|
||||
UI_PrintStringSmall(String, LCD_WIDTH + 24, 0, line + 1);
|
||||
@@ -669,7 +685,7 @@ void UI_DisplayMain(void)
|
||||
{ // show the TX power
|
||||
const char pwr_list[] = "LMH";
|
||||
const unsigned int i = gEeprom.VfoInfo[vfo_num].OUTPUT_POWER;
|
||||
String[0] = (i >= 0 && i < ARRAY_SIZE(pwr_list)) ? pwr_list[i] : '\0';
|
||||
String[0] = (i < ARRAY_SIZE(pwr_list)) ? pwr_list[i] : '\0';
|
||||
String[1] = '\0';
|
||||
UI_PrintStringSmall(String, LCD_WIDTH + 46, 0, line + 1);
|
||||
}
|
||||
|
14
ui/menu.c
14
ui/menu.c
@@ -240,12 +240,13 @@ const char gSubMenu_D_RSP[4][11] =
|
||||
"BOTH"
|
||||
};
|
||||
|
||||
const char gSubMenu_PTT_ID[4][7] =
|
||||
const char gSubMenu_PTT_ID[5][15] =
|
||||
{
|
||||
"OFF",
|
||||
"KEY UP",
|
||||
"KEY DN",
|
||||
"BOTH"
|
||||
"KEY\nUP",
|
||||
"KEY\nDOWN",
|
||||
"KEY\nUP+DOWN",
|
||||
"APOLLO\nQUINDAR"
|
||||
};
|
||||
|
||||
const char gSubMenu_PONMSG[4][8] =
|
||||
@@ -436,6 +437,9 @@ void UI_DisplayMenu(void)
|
||||
|
||||
bool already_printed = false;
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough="
|
||||
|
||||
switch (gMenuCursor)
|
||||
{
|
||||
case MENU_SQL:
|
||||
@@ -806,6 +810,8 @@ void UI_DisplayMenu(void)
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
if (!already_printed)
|
||||
{ // we now do multi-line text in a single string
|
||||
|
||||
|
@@ -139,7 +139,7 @@ extern const char gSubMenu_MDF[4][15];
|
||||
extern const char gSubMenu_AL_MOD[2][5];
|
||||
#endif
|
||||
extern const char gSubMenu_D_RSP[4][11];
|
||||
extern const char gSubMenu_PTT_ID[4][7];
|
||||
extern const char gSubMenu_PTT_ID[5][15];
|
||||
extern const char gSubMenu_PONMSG[4][8];
|
||||
extern const char gSubMenu_ROGER[3][9];
|
||||
extern const char gSubMenu_RESET[2][4];
|
||||
|
28
ui/status.c
28
ui/status.c
@@ -94,23 +94,25 @@ void UI_DisplayStatus(const bool test_display)
|
||||
else
|
||||
#endif
|
||||
// SCAN indicator
|
||||
if (gScanState != SCAN_OFF || gScreenToDisplay == DISPLAY_SCANNER || test_display)
|
||||
if (gScanStateDir != SCAN_OFF || gScreenToDisplay == DISPLAY_SCANNER || test_display)
|
||||
{
|
||||
if (gEeprom.SCAN_LIST_DEFAULT == 0)
|
||||
// memmove(line + x, BITMAP_SC1, sizeof(BITMAP_SC1));
|
||||
UI_PrintStringSmallBuffer("1", line + x);
|
||||
if (gNextMrChannel <= MR_CHANNEL_LAST)
|
||||
{ // channel mode
|
||||
if (gEeprom.SCAN_LIST_DEFAULT == 0)
|
||||
UI_PrintStringSmallBuffer("1", line + x);
|
||||
else
|
||||
if (gEeprom.SCAN_LIST_DEFAULT == 1)
|
||||
UI_PrintStringSmallBuffer("2", line + x);
|
||||
else
|
||||
if (gEeprom.SCAN_LIST_DEFAULT == 2)
|
||||
UI_PrintStringSmallBuffer("*", line + x);
|
||||
}
|
||||
else
|
||||
if (gEeprom.SCAN_LIST_DEFAULT == 1)
|
||||
// memmove(line + x, BITMAP_SC2, sizeof(BITMAP_SC2));
|
||||
UI_PrintStringSmallBuffer("2", line + x);
|
||||
else
|
||||
if (gEeprom.SCAN_LIST_DEFAULT == 2)
|
||||
// memmove(line + x, BITMAP_SCA, sizeof(BITMAP_SCA));
|
||||
UI_PrintStringSmallBuffer("*", line + x);
|
||||
// x1 = x + sizeof(BITMAP_SC1);
|
||||
{ // frequency mode
|
||||
UI_PrintStringSmallBuffer("S", line + x);
|
||||
}
|
||||
x1 = x + 7;
|
||||
}
|
||||
// x += sizeof(BITMAP_SC1);
|
||||
x += 7; // font character width
|
||||
|
||||
#ifdef ENABLE_VOICE
|
||||
|
Reference in New Issue
Block a user