0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-06-19 14:48:03 +03:00

Make all warnings vanish over to bricky's house !

This commit is contained in:
OneOfEleven
2023-10-05 15:26:08 +01:00
parent cb05a5881f
commit bd9f337a5b
19 changed files with 116 additions and 58 deletions

View File

@ -647,6 +647,9 @@ static void MR_NextChannel(void)
if (enabled)
{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough="
switch (gCurrentScanList)
{
case SCAN_NEXT_CHAN_SCANLIST1:
@ -680,7 +683,7 @@ static void MR_NextChannel(void)
// {
// chan = (gEeprom.RX_VFO + 1) & 1u;
// chan = gEeprom.ScreenChannel[chan];
// if (IS_MR_CHANNEL(chan))
// if (chan <= MR_CHANNEL_LAST)
// {
// gCurrentScanList = SCAN_NEXT_CHAN_DUAL_WATCH;
// gNextMrChannel = chan;
@ -695,6 +698,8 @@ static void MR_NextChannel(void)
chan = 0xff;
break;
}
#pragma GCC diagnostic pop
}
if (!enabled || chan == 0xff)
@ -2042,7 +2047,7 @@ void CHANNEL_Next(bool bFlag, int8_t Direction)
gCurrentScanList = SCAN_NEXT_CHAN_SCANLIST1;
gScanState = Direction;
if (IS_MR_CHANNEL(gNextMrChannel))
if (gNextMrChannel <= MR_CHANNEL_LAST)
{
if (bFlag)
gRestoreMrChannel = gNextMrChannel;

View File

@ -331,6 +331,9 @@ void DTMF_HandleRequest(void)
gUpdateDisplay = true;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough="
switch (gEeprom.DTMF_DECODE_RESPONSE)
{
case DTMF_DEC_RESPONSE_BOTH:
@ -348,6 +351,8 @@ void DTMF_HandleRequest(void)
break;
}
#pragma GCC diagnostic pop
if (gDTMF_IsGroupCall)
gDTMF_ReplyState = DTMF_REPLY_NONE;
}

View File

@ -408,6 +408,9 @@ void MENU_AcceptSetting(void)
gRequestSaveChannel = 1;
return;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough="
case MENU_T_CTCS:
pConfig = &gTxVfo->freq_config_TX;
case MENU_R_CTCS:
@ -436,6 +439,8 @@ void MENU_AcceptSetting(void)
gRequestSaveChannel = 1;
return;
#pragma GCC diagnostic pop
case MENU_SFT_D:
gTxVfo->TX_OFFSET_FREQUENCY_DIRECTION = gSubMenuSelection;
gRequestSaveChannel = 1;
@ -1170,7 +1175,7 @@ static void MENU_Key_0_to_9(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
if (edit_index < 10)
{
if (Key >= KEY_0 && Key <= KEY_9)
if (/* Key >= KEY_0 && */ Key <= KEY_9)
{
edit[edit_index] = '0' + Key - KEY_0;
@ -1193,6 +1198,9 @@ static void MENU_Key_0_to_9(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
if (!gIsInSubMenu)
{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough="
switch (gInputBoxIndex)
{
case 2:
@ -1224,6 +1232,8 @@ static void MENU_Key_0_to_9(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
break;
}
#pragma GCC diagnostic pop
gInputBoxIndex = 0;
gBeepToPlay = BEEP_500HZ_60MS_DOUBLE_BEEP_OPTIONAL;
@ -1269,7 +1279,7 @@ static void MENU_Key_0_to_9(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
Value = ((gInputBox[0] * 100) + (gInputBox[1] * 10) + gInputBox[2]) - 1;
if (IS_MR_CHANNEL(Value))
if (Value <= MR_CHANNEL_LAST)
{
#ifdef ENABLE_VOICE
gAnotherVoiceID = (VOICE_ID_t)Key;
@ -1661,6 +1671,9 @@ static void MENU_Key_UP_DOWN(bool bKeyPressed, bool bKeyHeld, int8_t Direction)
VFO = 0;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough="
switch (gMenuCursor)
{
case MENU_DEL_CH:
@ -1681,6 +1694,8 @@ static void MENU_Key_UP_DOWN(bool bKeyPressed, bool bKeyHeld, int8_t Direction)
return;
}
#pragma GCC diagnostic pop
Channel = RADIO_FindNextChannel(gSubMenuSelection + Direction, Direction, bCheckScanList, VFO);
if (Channel != 0xFF)
gSubMenuSelection = Channel;

View File

@ -67,7 +67,7 @@ static void SCANNER_Key_DIGITS(KEY_Code_t Key, bool bKeyPressed, bool bKeyHeld)
gInputBoxIndex = 0;
Channel = ((gInputBox[0] * 100) + (gInputBox[1] * 10) + gInputBox[2]) - 1;
if (IS_MR_CHANNEL(Channel))
if (Channel <= MR_CHANNEL_LAST)
{
#ifdef ENABLE_VOICE
gAnotherVoiceID = (VOICE_ID_t)Key;
@ -193,7 +193,7 @@ static void SCANNER_Key_MENU(bool bKeyPressed, bool bKeyHeld)
}
}
if (IS_MR_CHANNEL(gTxVfo->CHANNEL_SAVE))
if (gTxVfo->CHANNEL_SAVE <= MR_CHANNEL_LAST)
{
gScannerEditState = 1;
gScanChannel = gTxVfo->CHANNEL_SAVE;
@ -247,7 +247,7 @@ static void SCANNER_Key_MENU(bool bKeyPressed, bool bKeyHeld)
gTxVfo->freq_config_TX.Code = gScanCssResultCode;
}
if (IS_MR_CHANNEL(gTxVfo->CHANNEL_SAVE))
if (gTxVfo->CHANNEL_SAVE <= MR_CHANNEL_LAST)
{
Channel = gScanChannel;
gEeprom.MrChannel[gEeprom.TX_VFO] = Channel;
@ -428,7 +428,7 @@ void SCANNER_Stop(void)
if (!bScanKeepFrequency)
{
if (IS_MR_CHANNEL(gNextMrChannel))
if (gNextMrChannel <= MR_CHANNEL_LAST)
{
gEeprom.MrChannel[gEeprom.RX_VFO] = gRestoreMrChannel;
gEeprom.ScreenChannel[gEeprom.RX_VFO] = Previous;
@ -446,7 +446,7 @@ void SCANNER_Stop(void)
return;
}
if (!IS_MR_CHANNEL(gRxVfo->CHANNEL_SAVE))
if (gRxVfo->CHANNEL_SAVE > MR_CHANNEL_LAST)
{
RADIO_ApplyOffset(gRxVfo);
RADIO_ConfigureSquelchAndOutputPower(gRxVfo);

View File

@ -450,7 +450,7 @@ bool UART_IsCommandAvailable(void)
Index = DMA_INDEX(gUART_WriteIndex, 2);
Size = (UART_DMA_Buffer[DMA_INDEX(Index, 1)] << 8) | UART_DMA_Buffer[Index];
if ((Size + 8) > sizeof(UART_DMA_Buffer))
if ((Size + 8u) > sizeof(UART_DMA_Buffer))
{
gUART_WriteIndex = DmaLength;
return false;