mirror of
https://github.com/kamilsss655/uv-k5-firmware-custom
synced 2024-11-21 17:57:59 +00:00
Fixed CTCSS int overflow bug
This commit is contained in:
parent
aea80cb046
commit
bbf8a7061e
2
dcs.c
2
dcs.c
@ -91,7 +91,7 @@ uint8_t DCS_GetCdcssCode(uint32_t Code)
|
||||
return 0xFF;
|
||||
}
|
||||
|
||||
uint8_t DCS_GetCtcssCode(uint16_t Code)
|
||||
uint8_t DCS_GetCtcssCode(int Code)
|
||||
{
|
||||
unsigned int i;
|
||||
uint8_t Result = 0xFF;
|
||||
|
2
dcs.h
2
dcs.h
@ -39,7 +39,7 @@ extern const uint16_t DCS_Options[104];
|
||||
|
||||
uint32_t DCS_GetGolayCodeWord(DCS_CodeType_t CodeType, uint8_t Option);
|
||||
uint8_t DCS_GetCdcssCode(uint32_t Code);
|
||||
uint8_t DCS_GetCtcssCode(uint16_t Code);
|
||||
uint8_t DCS_GetCtcssCode(int Code);
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -465,7 +465,7 @@ void BK4819_SetCTCSSFrequency(uint32_t FreqControlWord)
|
||||
// freq(Hz) * 20.64888 for XTAL 13M/26M or
|
||||
// freq(Hz) * 20.97152 for XTAL 12.8M/19.2M/25.6M/38.4M
|
||||
//
|
||||
BK4819_WriteRegister(BK4819_REG_07, BK4819_REG_07_MODE_CTC1 | (((FreqControlWord * 2064888u) + 500000u) / 1000000u)); // with rounding
|
||||
BK4819_WriteRegister(BK4819_REG_07, BK4819_REG_07_MODE_CTC1 | (((FreqControlWord * 206488u) + 50000u) / 100000u)); // with rounding
|
||||
}
|
||||
|
||||
// freq_10Hz is CTCSS Hz * 10
|
||||
|
BIN
firmware.bin
BIN
firmware.bin
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user