From 492598f6ddfd67aca58b6be1bf29c136bfce199e Mon Sep 17 00:00:00 2001 From: ASDosjani Date: Fri, 28 Jul 2023 19:27:40 +0200 Subject: [PATCH] Add LED strip config values to MSP --- src/main/msp/msp.c | 13 +++++++++++++ src/main/msp/msp_protocol.h | 2 ++ 2 files changed, 15 insertions(+) diff --git a/src/main/msp/msp.c b/src/main/msp/msp.c index ef1c4865da6..696ff15c4b8 100644 --- a/src/main/msp/msp.c +++ b/src/main/msp/msp.c @@ -1762,6 +1762,12 @@ case MSP_NAME: sbufWriteU8(dst, 0); sbufWriteU8(dst, ledStripStatusModeConfig()->ledstrip_aux_channel); break; + + case MSP_LED_STRIP_CONFIG_VALUES: + sbufWriteU8(dst, ledStripConfig()->ledstrip_brightness); + sbufWriteU8(dst, ledStripConfig()->ledstrip_rainbow_delta); + sbufWriteU8(dst, ledStripConfig()->ledstrip_rainbow_freq); + break; #endif case MSP_DATAFLASH_SUMMARY: @@ -3854,6 +3860,13 @@ static mspResult_e mspProcessInCommand(mspDescriptor_t srcDesc, int16_t cmdMSP, } } break; + case MSP_SET_LED_STRIP_CONFIG_VALUES: + { + ledStripConfigMutable()->ledstrip_brightness = sbufReadU8(src); + ledStripConfigMutable()->ledstrip_rainbow_delta = sbufReadU8(src); + ledStripConfigMutable()->ledstrip_rainbow_freq = sbufReadU8(src); + } + break; #endif case MSP_SET_NAME: diff --git a/src/main/msp/msp_protocol.h b/src/main/msp/msp_protocol.h index dac513b1870..c9695bd0376 100644 --- a/src/main/msp/msp_protocol.h +++ b/src/main/msp/msp_protocol.h @@ -324,6 +324,8 @@ #define MSP_SET_GPS_RESCUE_PIDS 226 //in message GPS Rescues's throttleP and velocity PIDS + yaw P #define MSP_SET_VTXTABLE_BAND 227 //in message set vtxTable band/channel data (one band at a time) #define MSP_SET_VTXTABLE_POWERLEVEL 228 //in message set vtxTable powerLevel data (one powerLevel at a time) +#define MSP_SET_LED_STRIP_CONFIG_VALUES 231 //in message Set LED strip config values +#define MSP_LED_STRIP_CONFIG_VALUES 232 //out message Get LED strip config vaƩues // #define MSP_BIND 240 //in message no param // #define MSP_ALARMS 242