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

Fixed CTCSS int overflow bug

This commit is contained in:
OneOfEleven
2023-10-02 01:19:14 +01:00
parent aea80cb046
commit bbf8a7061e
5 changed files with 3 additions and 3 deletions

View File

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