Skip to content

Commit

Permalink
Merge pull request #184 from ligenxxxx/1
Browse files Browse the repository at this point in the history
fix _RF_CALIB
  • Loading branch information
ligenxxxx authored Dec 25, 2023
2 parents 554dad1 + d9ca374 commit 2c04bc5
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/msp_displayport.c
Original file line number Diff line number Diff line change
Expand Up @@ -2073,4 +2073,33 @@ void msp_set_vtx_config(uint8_t power, uint8_t save) {
(void)save;
}

uint8_t channel_to_bfChannel(uint8_t const channel) {

if (channel < 8)
return channel + 32; // R1...R8
if (channel == 8)
return 16; // E1
if (channel == 9)
return 24; // F1
if (channel == 10)
return 25; // F2
if (channel == 11)
return 27; // F4
return INVALID_CHANNEL;
}

uint8_t bfChannel_to_channel(uint8_t const channel) {
if (channel == 16)
return 8;
if (channel == 24)
return 9;
if (channel == 25)
return 10;
else if (channel == 27)
return 11;
else if (channel >= 32 && channel < 40)
return channel - 32;
return INVALID_CHANNEL;
}

#endif

0 comments on commit 2c04bc5

Please sign in to comment.