From 0fc486fdbca79ff394dc6f7c59f6d8933db749be Mon Sep 17 00:00:00 2001 From: bkleiner Date: Wed, 1 May 2024 01:12:07 +0200 Subject: [PATCH] crsf: update msp device type dynamically --- src/io/msp.h | 1 + src/rx/unified_crsf.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/io/msp.h b/src/io/msp.h index 56b8bb371..11a6dd8e2 100644 --- a/src/io/msp.h +++ b/src/io/msp.h @@ -83,6 +83,7 @@ typedef enum { typedef enum { MSP_DEVICE_FC, MSP_DEVICE_VTX, + MSP_DEVICE_RX, MSP_DEVICE_SPI_RX, } msp_device_t; diff --git a/src/rx/unified_crsf.c b/src/rx/unified_crsf.c index 94b942702..58254347d 100644 --- a/src/rx/unified_crsf.c +++ b/src/rx/unified_crsf.c @@ -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]; @@ -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; }