mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-20 23:05:19 +03:00
Corrected rct6705 soft spi band/channel indexes
This commit is contained in:
parent
981df1d544
commit
b6f3f9e211
1 changed files with 1 additions and 7 deletions
|
@ -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);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue