Skip to content

Commit

Permalink
crsf: update msp device type dynamically
Browse files Browse the repository at this point in the history
  • Loading branch information
bkleiner committed Apr 30, 2024
1 parent e39a5e1 commit 0fc486f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/io/msp.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ typedef enum {
typedef enum {
MSP_DEVICE_FC,
MSP_DEVICE_VTX,
MSP_DEVICE_RX,
MSP_DEVICE_SPI_RX,
} msp_device_t;

Expand Down
3 changes: 2 additions & 1 deletion src/rx/unified_crsf.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ msp_t crsf_msp = {
.buffer_size = MSP_BUFFER_SIZE,
.buffer_offset = 0,
.send = rx_serial_crsf_msp_send,
.device = MSP_DEVICE_VTX,
.device = MSP_DEVICE_RX,
};

static uint8_t msp_tx_buffer[MSP_BUFFER_SIZE];
Expand Down Expand Up @@ -201,6 +201,7 @@ static packet_status_t rx_serial_crsf_process_frame(uint8_t frame_length) {
case CRSF_FRAMETYPE_MSP_WRITE:
case CRSF_FRAMETYPE_MSP_REQ: {
msp_origin = rx_data[2];
crsf_msp.device = profile.serial.smart_audio == profile.serial.rx ? MSP_DEVICE_VTX : MSP_DEVICE_RX;
msp_process_telemetry(&crsf_msp, rx_data + 3, frame_length - 4);
break;
}
Expand Down

0 comments on commit 0fc486f

Please sign in to comment.