From 6cff215feee7acc641261de7af10adffe06b0bcd Mon Sep 17 00:00:00 2001 From: Dual Tachyon Date: Wed, 30 Aug 2023 11:11:35 +0100 Subject: [PATCH] Use signed values to fix the TX power bug. --- frequencies.c | 2 +- frequencies.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frequencies.c b/frequencies.c index b2c2c35..d0cfe33 100644 --- a/frequencies.c +++ b/frequencies.c @@ -98,7 +98,7 @@ FREQUENCY_Band_t FREQUENCY_GetBand(uint32_t Frequency) return BAND6_400MHz; } -uint8_t FREQUENCY_CalculateOutputPower(uint8_t TxpLow, uint8_t TxpMid, uint8_t TxpHigh, uint32_t LowerLimit, uint32_t Middle, uint32_t UpperLimit, uint32_t Frequency) +uint8_t FREQUENCY_CalculateOutputPower(uint8_t TxpLow, uint8_t TxpMid, uint8_t TxpHigh, int32_t LowerLimit, int32_t Middle, int32_t UpperLimit, int32_t Frequency) { if (Frequency <= LowerLimit) { return TxpLow; diff --git a/frequencies.h b/frequencies.h index 515a83b..59035f5 100644 --- a/frequencies.h +++ b/frequencies.h @@ -39,7 +39,7 @@ extern const uint32_t NoaaFrequencyTable[10]; extern const uint16_t StepFrequencyTable[6]; FREQUENCY_Band_t FREQUENCY_GetBand(uint32_t Frequency); -uint8_t FREQUENCY_CalculateOutputPower(uint8_t TxpLow, uint8_t TxpMid, uint8_t TxpHigh, uint32_t LowerLimit, uint32_t Middle, uint32_t UpperLimit, uint32_t Frequency); +uint8_t FREQUENCY_CalculateOutputPower(uint8_t TxpLow, uint8_t TxpMid, uint8_t TxpHigh, int32_t LowerLimit, int32_t Middle, int32_t UpperLimit, int32_t Frequency); uint32_t FREQUENCY_FloorToStep(uint32_t Upper, uint32_t Step, uint32_t Lower); int FREQUENCY_Check(VFO_Info_t *pInfo);