Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
ligenxxxx committed Nov 17, 2023
1 parent f04a7be commit 98f0109
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/msp_displayport.c
Original file line number Diff line number Diff line change
Expand Up @@ -2072,4 +2072,32 @@ void msp_set_vtx_config(uint8_t power, uint8_t save) {
(void)save;
}

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;
}

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;
}
#endif

0 comments on commit 98f0109

Please sign in to comment.