1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-20 14:55:21 +03:00

Corrected rct6705 soft spi band/channel indexes

This commit is contained in:
Moto Moto 2017-08-07 22:04:58 -05:00
parent 981df1d544
commit b6f3f9e211

View file

@ -127,13 +127,7 @@ void rtc6705SetFreq(uint16_t channel_freq)
void rtc6705SetBandAndChannel(const uint8_t band, const uint8_t channel) void rtc6705SetBandAndChannel(const uint8_t band, const uint8_t channel)
{ {
// band and channel are 1-based, not 0-based uint8_t freqIndex = (band * RTC6705_CHANNEL_COUNT) + channel;
// example for raceband/ch8:
// (5 - 1) * 8 + (8 - 1)
// 4 * 8 + 7
// 32 + 7 = 39
uint8_t freqIndex = ((band - 1) * RTC6705_BAND_COUNT) + (channel - 1);
uint16_t freq = vtx_freq[freqIndex]; uint16_t freq = vtx_freq[freqIndex];
rtc6705SetFreq(freq); rtc6705SetFreq(freq);