diff --git a/app/app.c b/app/app.c index 50f0b79..fba4689 100644 --- a/app/app.c +++ b/app/app.c @@ -1435,7 +1435,7 @@ void FUN_000075b0(void) g_20000464 = 0; } -void APP_ChangeStepDirectionMaybe(bool bFlag, uint8_t Direction) +void APP_ChangeStepDirectionMaybe(bool bFlag, int8_t Direction) { RADIO_ConfigureTX(); g_20000410 = gInfoCHAN_A->CHANNEL_SAVE; diff --git a/app/main.c b/app/main.c index 682fd85..b04a7a9 100644 --- a/app/main.c +++ b/app/main.c @@ -10,7 +10,7 @@ extern void APP_SwitchToFM(void); extern void FUN_0000773c(void); extern void APP_SetFrequencyByStep(VFO_Info_t *pInfo, int8_t Step); -extern void APP_ChangeStepDirectionMaybe(bool bFlag, uint8_t Direction); +extern void APP_ChangeStepDirectionMaybe(bool bFlag, int8_t Direction); extern void APP_CycleOutputPower(void); extern void APP_FlipVoxSwitch(void); diff --git a/app/menu.c b/app/menu.c index 902b43f..4d06399 100644 --- a/app/menu.c +++ b/app/menu.c @@ -72,7 +72,7 @@ static const VOICE_ID_t MenuVoices[] = { VOICE_ID_INVALID, }; -static void FUN_000074f8(uint8_t Direction) +static void FUN_000074f8(int8_t Direction) { g_20000381 = 1; gMenuScrollDirection = Direction; @@ -988,7 +988,7 @@ void MENU_Key_STAR(bool bKeyPressed, bool bKeyHeld) if (gInfoCHAN_A->CHANNEL_SAVE < 207 && !gInfoCHAN_A->IsAM) { if (gMenuCursor == MENU_R_CTCS || gMenuCursor == MENU_R_DCS) { if (g_20000381 == 0) { - FUN_000074f8(0x01); + FUN_000074f8(1); gRequestDisplayScreen = DISPLAY_MENU; AUDIO_SetVoiceID(0,VOICE_ID_SCANNING_BEGIN); AUDIO_PlaySingleVoice(1); diff --git a/frequencies.c b/frequencies.c index 513b924..0b1296e 100644 --- a/frequencies.c +++ b/frequencies.c @@ -113,12 +113,12 @@ uint32_t FREQUENCY_CalculateOutputPower(uint8_t TxpLow, uint8_t TxpMid, uint8_t return TxpMid + ((TxpHigh - TxpMid) * (Frequency - Middle)) / (UpperLimit - Middle); } -uint32_t FREQUENCY_FloorToStep(uint32_t Frequency, uint32_t Step, uint32_t Base) +uint32_t FREQUENCY_FloorToStep(uint32_t Upper, int32_t Step, uint32_t Lower) { uint32_t Index; - Index = (Frequency - Base) / Step; - return Base + (Step * Index); + Index = (Upper - Lower) / Step; + return Lower + (Step * Index); } int FREQUENCY_Check(VFO_Info_t *pInfo) diff --git a/frequencies.h b/frequencies.h index 73b57f0..1a91ae5 100644 --- a/frequencies.h +++ b/frequencies.h @@ -40,7 +40,7 @@ extern const uint16_t StepFrequencyTable[6]; FREQUENCY_Band_t FREQUENCY_GetBand(uint32_t Frequency); uint32_t FREQUENCY_CalculateOutputPower(uint8_t TxpLow, uint8_t TxpMid, uint8_t TxpHigh, uint32_t LowerLimit, uint32_t Middle, uint32_t UpperLimit, uint32_t Frequency); -uint32_t FREQUENCY_FloorToStep(uint32_t Frequency, uint32_t Step, uint32_t Base); +uint32_t FREQUENCY_FloorToStep(uint32_t Upper, int32_t Step, uint32_t Lower); int FREQUENCY_Check(VFO_Info_t *pInfo); #endif diff --git a/gui.c b/gui.c index c684c84..f71904e 100644 --- a/gui.c +++ b/gui.c @@ -170,7 +170,7 @@ static const char gSubMenu_F_LOCK[6][4] = { GUI_DisplayType_t gScreenToDisplay; bool gIsInSubMenu; -volatile uint8_t gStepDirection; +volatile int8_t gStepDirection; GUI_DisplayType_t gRequestDisplayScreen; uint8_t g_200003BA; uint8_t g_200003BB; @@ -181,7 +181,7 @@ bool gAskToSave; bool gAskToDelete; uint8_t gMenuCursor; -uint8_t gMenuScrollDirection; +int8_t gMenuScrollDirection; uint32_t gSubMenuSelection; void GUI_DisplayBatteryLevel(uint8_t BatteryLevel) diff --git a/gui.h b/gui.h index 48bbeac..8e5369a 100644 --- a/gui.h +++ b/gui.h @@ -93,7 +93,7 @@ enum { extern GUI_DisplayType_t gScreenToDisplay; extern bool gIsInSubMenu; -extern volatile uint8_t gStepDirection; +extern volatile int8_t gStepDirection; extern GUI_DisplayType_t gRequestDisplayScreen; extern uint8_t g_200003BA; extern uint8_t g_200003BB; @@ -104,7 +104,7 @@ extern bool gAskToSave; extern bool gAskToDelete; extern uint8_t gMenuCursor; -extern uint8_t gMenuScrollDirection; +extern int8_t gMenuScrollDirection; extern uint32_t gSubMenuSelection; void GUI_DisplayBatteryLevel(uint8_t BatteryLevel); diff --git a/radio.c b/radio.c index ae68d20..38c6b1f 100644 --- a/radio.c +++ b/radio.c @@ -81,7 +81,7 @@ bool RADIO_CheckValidChannel(uint8_t Channel, bool bCheckScanList, uint8_t VFO) return true; } -uint8_t RADIO_FindNextChannel(uint8_t Channel, uint8_t Direction, bool bCheckScanList, uint8_t VFO) +uint8_t RADIO_FindNextChannel(uint8_t Channel, int8_t Direction, bool bCheckScanList, uint8_t VFO) { uint8_t i; diff --git a/radio.h b/radio.h index eaa1f48..3a71833 100644 --- a/radio.h +++ b/radio.h @@ -93,7 +93,7 @@ extern DCS_CodeType_t gCopyOfCodeType; extern uint8_t gCode; bool RADIO_CheckValidChannel(uint8_t ChNum, bool bCheckScanList, uint8_t RadioNum); -uint8_t RADIO_FindNextChannel(uint8_t ChNum, uint8_t Direction, bool bCheckScanList, uint8_t RadioNum); +uint8_t RADIO_FindNextChannel(uint8_t ChNum, int8_t Direction, bool bCheckScanList, uint8_t RadioNum); void RADIO_InitInfo(VFO_Info_t *pInfo, uint8_t ChannelSave, uint8_t ChIndex, uint32_t Frequency); void RADIO_ConfigureChannel(uint8_t RadioNum, uint32_t Arg); void RADIO_ConfigureSquelchAndOutputPower(VFO_Info_t *pInfo);