Use signed values to fix the TX power bug.

This commit is contained in:
Dual Tachyon 2023-08-30 11:11:35 +01:00
parent f485ddf7b3
commit 6cff215fee
2 changed files with 2 additions and 2 deletions

View File

@ -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;

View File

@ -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);