Skip to content

Commit

Permalink
Merge pull request #231 from geoffsim/EmuFlight-Fix
Browse files Browse the repository at this point in the history
Drop MSP_VTX_CONFIG messages with an invalid VTX id
  • Loading branch information
ligenxxxx authored Dec 19, 2024
2 parents 8f7da85 + 275dbad commit 7f496a3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/msp_displayport.c
Original file line number Diff line number Diff line change
Expand Up @@ -1055,6 +1055,11 @@ void parse_vtx_params(uint8_t isMSP_V2) {
return;
}

// Ignore unknown/unsupported VTX devices
if (msp_rx_buf[0] == VTXDEV_UNKNOWN || msp_rx_buf[0] == VTXDEV_UNSUPPORTED) {
return;
}

fc_pwr_rx = msp_rx_buf[3];
if (fc_pwr_rx == 0) {
fc_pwr_rx = POWER_MAX+2; // 0mW
Expand Down
10 changes: 10 additions & 0 deletions src/msp_displayport.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,16 @@ typedef enum {
VTX_MENU_SAVE_EXIT,
} vtx_menu_state_e;

typedef enum {
VTXDEV_UNSUPPORTED = 0, // reserved for MSP
VTXDEV_RTC6705 = 1,
// 2 reserved
VTXDEV_SMARTAUDIO = 3,
VTXDEV_TRAMP = 4,
VTXDEV_MSP = 5,
VTXDEV_UNKNOWN = 0xFF,
} vtxDevType_e;

typedef enum {
DISPLAY_OSD,
DISPLAY_CMS,
Expand Down

0 comments on commit 7f496a3

Please sign in to comment.