Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix _RF_CALIB #184

Merged
merged 1 commit into from
Dec 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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