forked from mirror/uv-k5-firmware
Fixed issues found by the superior clang.
This commit is contained in:
parent
5edb7a8ea2
commit
1dfd9b689e
@ -1693,7 +1693,7 @@ static void APP_ProcessKey_MAIN(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
||||
}
|
||||
if (g_200003BA != 0 && !bKeyHeld && bKeyPressed) {
|
||||
char Character = DTMF_GetCharacter(Key);
|
||||
if (Character != 0xFF) {
|
||||
if (Character != -1) {
|
||||
g_20000396 = 1;
|
||||
XXX_Append(Character);
|
||||
gRequestDisplayScreen = DISPLAY_MAIN;
|
||||
@ -1822,7 +1822,7 @@ static void APP_ProcessKey_SCANNER(KEY_Code_t Key, bool bKeyPressed, bool bKeyHe
|
||||
case KEY_0: case KEY_1: case KEY_2: case KEY_3:
|
||||
case KEY_4: case KEY_5: case KEY_6: case KEY_7:
|
||||
case KEY_8: case KEY_9:
|
||||
SCANNER_Key_DIGITS((VOICE_ID_t)Key, bKeyPressed, bKeyHeld);
|
||||
SCANNER_Key_DIGITS(Key, bKeyPressed, bKeyHeld);
|
||||
break;
|
||||
case KEY_MENU:
|
||||
SCANNER_Key_MENU(bKeyPressed, bKeyHeld);
|
||||
|
@ -78,7 +78,7 @@ void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
||||
uint32_t Frequency;
|
||||
|
||||
if (gInputBoxIndex < 6) {
|
||||
gAnotherVoiceID = Key;
|
||||
gAnotherVoiceID = (VOICE_ID_t)Key;
|
||||
return;
|
||||
}
|
||||
gInputBoxIndex = 0;
|
||||
@ -114,7 +114,7 @@ void MAIN_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
||||
uint8_t Channel;
|
||||
|
||||
if (gInputBoxIndex != 2) {
|
||||
gAnotherVoiceID = Key;
|
||||
gAnotherVoiceID = (VOICE_ID_t)Key;
|
||||
gRequestDisplayScreen = DISPLAY_MAIN;
|
||||
return;
|
||||
}
|
||||
|
@ -875,7 +875,7 @@ void MENU_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
||||
gInputBoxIndex = 0;
|
||||
Value = ((gInputBox[0] * 100) + (gInputBox[1] * 10) + gInputBox[2]) - 1;
|
||||
if (IS_MR_CHANNEL(Value)) {
|
||||
gAnotherVoiceID = Key;
|
||||
gAnotherVoiceID = (VOICE_ID_t)Key;
|
||||
gSubMenuSelection = Value;
|
||||
return;
|
||||
}
|
||||
|
@ -33,13 +33,13 @@ void SCANNER_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
|
||||
INPUTBOX_Append(Key);
|
||||
gRequestDisplayScreen = DISPLAY_SCANNER;
|
||||
if (gInputBoxIndex < 3) {
|
||||
gAnotherVoiceID = Key;
|
||||
gAnotherVoiceID = (VOICE_ID_t)Key;
|
||||
return;
|
||||
}
|
||||
gInputBoxIndex = 0;
|
||||
Channel = ((gInputBox[0] * 100) + (gInputBox[1] * 10) + gInputBox[2]) - 1;
|
||||
if (IS_MR_CHANNEL(Channel)) {
|
||||
gAnotherVoiceID = Key;
|
||||
gAnotherVoiceID = (VOICE_ID_t)Key;
|
||||
gShowChPrefix = RADIO_CheckValidChannel(Channel, false, 0);
|
||||
gScanChannel = (uint8_t)Channel;
|
||||
return;
|
||||
|
1
audio.c
1
audio.c
@ -293,7 +293,6 @@ void AUDIO_PlayQueuedVoice(void)
|
||||
bool Skip;
|
||||
|
||||
Skip = false;
|
||||
gVoiceReadIndex = gVoiceReadIndex;
|
||||
if (gVoiceReadIndex != gVoiceWriteIndex && gEeprom.VOICE_PROMPT != VOICE_PROMPT_OFF) {
|
||||
VoiceID = gVoiceID[gVoiceReadIndex];
|
||||
if (gEeprom.VOICE_PROMPT == VOICE_PROMPT_CHINESE) {
|
||||
|
@ -22,7 +22,7 @@
|
||||
|
||||
KEY_Code_t gKeyReading0;
|
||||
KEY_Code_t gKeyReading1;
|
||||
uint8_t gDebounceCounter;
|
||||
uint16_t gDebounceCounter;
|
||||
bool gWasFKeyPressed;
|
||||
|
||||
KEY_Code_t KEYBOARD_Poll(void)
|
||||
|
@ -48,7 +48,7 @@ typedef enum KEY_Code_t KEY_Code_t;
|
||||
|
||||
extern KEY_Code_t gKeyReading0;
|
||||
extern KEY_Code_t gKeyReading1;
|
||||
extern uint8_t gDebounceCounter;
|
||||
extern uint16_t gDebounceCounter;
|
||||
extern bool gWasFKeyPressed;
|
||||
|
||||
KEY_Code_t KEYBOARD_Poll(void);
|
||||
|
4
dtmf.c
4
dtmf.c
@ -27,12 +27,12 @@ bool DTMF_ValidateCodes(char *pCode, uint8_t Size)
|
||||
{
|
||||
uint8_t i;
|
||||
|
||||
if (pCode[0] == 0xFF || pCode[0] == 0) {
|
||||
if (pCode[0] == -1 || pCode[0] == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (i = 0; i < Size; i++) {
|
||||
if (pCode[i] == 0xFF || pCode[i] == 0) {
|
||||
if (pCode[i] == -1 || pCode[i] == 0) {
|
||||
pCode[i] = 0;
|
||||
break;
|
||||
}
|
||||
|
@ -218,7 +218,7 @@ void UI_DisplayMain(void)
|
||||
UI_DisplayFrequency(gInputBox, 31, i * 4, true, false);
|
||||
} else {
|
||||
if (IS_MR_CHANNEL(gEeprom.ScreenChannel[i])) {
|
||||
if (gEeprom.CHANNEL_DISPLAY_MODE == 2 && (gEeprom.VfoInfo[i].Name[0] == 0 || gEeprom.VfoInfo[i].Name[0] == 0xFF)) {
|
||||
if (gEeprom.CHANNEL_DISPLAY_MODE == 2 && (gEeprom.VfoInfo[i].Name[0] == 0 || gEeprom.VfoInfo[i].Name[0] == -1)) {
|
||||
sprintf(String, "CH-%03d", gEeprom.ScreenChannel[i] + 1);
|
||||
UI_PrintString(String, 31, 112, i * 4, 8, true);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user