mirror of
https://github.com/OneOfEleven/uv-k5-firmware-custom.git
synced 2025-04-28 22:31:25 +03:00
Fixed side key scan start AND stop
This commit is contained in:
parent
dee38f429f
commit
a3aa3da2db
15
app/action.c
15
app/action.c
@ -160,7 +160,8 @@ void ACTION_Scan(bool bRestart)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (gScreenToDisplay != DISPLAY_SCANNER)
|
if (gScreenToDisplay != DISPLAY_SCANNER)
|
||||||
{
|
{ // not scanning
|
||||||
|
|
||||||
RADIO_SelectVfos();
|
RADIO_SelectVfos();
|
||||||
|
|
||||||
#ifdef ENABLE_NOAA
|
#ifdef ENABLE_NOAA
|
||||||
@ -192,6 +193,18 @@ void ACTION_Scan(bool bRestart)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
if (!bRestart)
|
||||||
|
{ // scanning
|
||||||
|
|
||||||
|
SCANNER_Stop();
|
||||||
|
|
||||||
|
#ifdef ENABLE_VOICE
|
||||||
|
gAnotherVoiceID = VOICE_ID_SCANNING_STOP;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
gRequestDisplayScreen = DISPLAY_MAIN;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ACTION_Vox(void)
|
void ACTION_Vox(void)
|
||||||
|
@ -2068,7 +2068,7 @@ static void APP_ProcessKey(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
|||||||
const bool backlight_was_on = GPIO_CheckBit(&GPIOB->DATA, GPIOB_PIN_BACKLIGHT);
|
const bool backlight_was_on = GPIO_CheckBit(&GPIOB->DATA, GPIOB_PIN_BACKLIGHT);
|
||||||
|
|
||||||
if (Key == KEY_EXIT && !backlight_was_on && gEeprom.BACKLIGHT > 0)
|
if (Key == KEY_EXIT && !backlight_was_on && gEeprom.BACKLIGHT > 0)
|
||||||
{ // just turn the light on for now
|
{ // just turn the light on for now so the user can see what's what
|
||||||
BACKLIGHT_TurnOn();
|
BACKLIGHT_TurnOn();
|
||||||
gBeepToPlay = BEEP_NONE;
|
gBeepToPlay = BEEP_NONE;
|
||||||
return;
|
return;
|
||||||
@ -2176,6 +2176,8 @@ static void APP_ProcessKey(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
|||||||
Key != KEY_UP &&
|
Key != KEY_UP &&
|
||||||
Key != KEY_DOWN &&
|
Key != KEY_DOWN &&
|
||||||
Key != KEY_EXIT &&
|
Key != KEY_EXIT &&
|
||||||
|
Key != KEY_SIDE1 &&
|
||||||
|
Key != KEY_SIDE2 &&
|
||||||
Key != KEY_STAR)
|
Key != KEY_STAR)
|
||||||
{ // scanning
|
{ // scanning
|
||||||
if (bKeyPressed && !bKeyHeld)
|
if (bKeyPressed && !bKeyHeld)
|
||||||
@ -2188,6 +2190,8 @@ static void APP_ProcessKey(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
|||||||
Key != KEY_UP &&
|
Key != KEY_UP &&
|
||||||
Key != KEY_DOWN &&
|
Key != KEY_DOWN &&
|
||||||
Key != KEY_EXIT &&
|
Key != KEY_EXIT &&
|
||||||
|
Key != KEY_SIDE1 &&
|
||||||
|
Key != KEY_SIDE2 &&
|
||||||
Key != KEY_STAR &&
|
Key != KEY_STAR &&
|
||||||
Key != KEY_MENU)
|
Key != KEY_MENU)
|
||||||
{ // code scanning
|
{ // code scanning
|
||||||
@ -2224,7 +2228,8 @@ static void APP_ProcessKey(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
|||||||
gUpdateStatus = true;
|
gUpdateStatus = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gF_LOCK && (Key == KEY_PTT || Key == KEY_SIDE2 || Key == KEY_SIDE1))
|
// if (gF_LOCK && (Key == KEY_PTT || Key == KEY_SIDE2 || Key == KEY_SIDE1))
|
||||||
|
if (gF_LOCK && Key == KEY_PTT)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!bFlag)
|
if (!bFlag)
|
||||||
|
22
app/menu.c
22
app/menu.c
@ -1314,9 +1314,7 @@ static void MENU_Key_MENU(const bool bKeyPressed, const bool bKeyHeld)
|
|||||||
if (edit_index < 0)
|
if (edit_index < 0)
|
||||||
{ // enter channel name edit mode
|
{ // enter channel name edit mode
|
||||||
if (!RADIO_CheckValidChannel(gSubMenuSelection, false, 0))
|
if (!RADIO_CheckValidChannel(gSubMenuSelection, false, 0))
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
BOARD_fetchChannelName(edit, gSubMenuSelection);
|
BOARD_fetchChannelName(edit, gSubMenuSelection);
|
||||||
|
|
||||||
@ -1327,6 +1325,9 @@ static void MENU_Key_MENU(const bool bKeyPressed, const bool bKeyHeld)
|
|||||||
edit[edit_index] = 0;
|
edit[edit_index] = 0;
|
||||||
edit_index = 0; // 'edit_index' is going to be used as the cursor position
|
edit_index = 0; // 'edit_index' is going to be used as the cursor position
|
||||||
|
|
||||||
|
// make a copy so we can test for change when exiting the menu item
|
||||||
|
memmove(edit_original, edit, sizeof(edit_original));
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1337,11 +1338,24 @@ static void MENU_Key_MENU(const bool bKeyPressed, const bool bKeyHeld)
|
|||||||
return; // next char
|
return; // next char
|
||||||
|
|
||||||
// exit
|
// exit
|
||||||
|
if (memcmp(edit_original, edit, sizeof(edit_original)) == 0)
|
||||||
|
{ // no change
|
||||||
|
gFlagAcceptSetting = false;
|
||||||
|
gIsInSubMenu = false;
|
||||||
|
gAskForConfirmation = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
gFlagAcceptSetting = false;
|
gFlagAcceptSetting = false;
|
||||||
gAskForConfirmation = 0;
|
gAskForConfirmation = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// exiting the sub menu
|
||||||
|
|
||||||
|
if (gIsInSubMenu)
|
||||||
|
{
|
||||||
if (gMenuCursor == MENU_RESET ||
|
if (gMenuCursor == MENU_RESET ||
|
||||||
gMenuCursor == MENU_MEM_CH ||
|
gMenuCursor == MENU_MEM_CH ||
|
||||||
gMenuCursor == MENU_DEL_CH ||
|
gMenuCursor == MENU_DEL_CH ||
|
||||||
@ -1384,9 +1398,13 @@ static void MENU_Key_MENU(const bool bKeyPressed, const bool bKeyHeld)
|
|||||||
gFlagAcceptSetting = true;
|
gFlagAcceptSetting = true;
|
||||||
gIsInSubMenu = false;
|
gIsInSubMenu = false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gCssScanMode != CSS_SCAN_MODE_OFF)
|
||||||
|
{
|
||||||
gCssScanMode = CSS_SCAN_MODE_OFF;
|
gCssScanMode = CSS_SCAN_MODE_OFF;
|
||||||
gUpdateStatus = true;
|
gUpdateStatus = true;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef ENABLE_VOICE
|
#ifdef ENABLE_VOICE
|
||||||
if (gMenuCursor == MENU_SCR)
|
if (gMenuCursor == MENU_SCR)
|
||||||
|
BIN
firmware.bin
BIN
firmware.bin
Binary file not shown.
Binary file not shown.
@ -275,6 +275,7 @@ int8_t gMenuScrollDirection;
|
|||||||
int32_t gSubMenuSelection;
|
int32_t gSubMenuSelection;
|
||||||
|
|
||||||
// edit box
|
// edit box
|
||||||
|
char edit_original[17]; // a copy of the text before editing
|
||||||
char edit[17];
|
char edit[17];
|
||||||
int edit_index;
|
int edit_index;
|
||||||
|
|
||||||
@ -493,8 +494,8 @@ void UI_DisplayMenu(void)
|
|||||||
{ // show the channel name being edited
|
{ // show the channel name being edited
|
||||||
UI_PrintString(edit, 50, 0, 2, 8);
|
UI_PrintString(edit, 50, 0, 2, 8);
|
||||||
if (edit_index < 10)
|
if (edit_index < 10)
|
||||||
// UI_PrintString("^", 50 + (8 * edit_index), 0, 4, 8); // show the cursor
|
UI_PrintString("^", 50 + (8 * edit_index), 0, 4, 8); // show the cursor
|
||||||
UI_PrintStringSmall("^", 50 + (8 * edit_index), 0, 4);
|
// UI_PrintStringSmall("^", 50 + (8 * edit_index), 0, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!gAskForConfirmation)
|
if (!gAskForConfirmation)
|
||||||
|
@ -133,6 +133,7 @@ extern uint8_t gMenuCursor;
|
|||||||
extern int8_t gMenuScrollDirection;
|
extern int8_t gMenuScrollDirection;
|
||||||
extern int32_t gSubMenuSelection;
|
extern int32_t gSubMenuSelection;
|
||||||
|
|
||||||
|
extern char edit_original[17];
|
||||||
extern char edit[17];
|
extern char edit[17];
|
||||||
extern int edit_index;
|
extern int edit_index;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user