mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 14:25:20 +03:00
Add LED strip config values to MSP (#12995)
* Add LED strip config values to MSP * change hue calculation + higher max frequency * higher rainbow frequency * define LED Strip task rate * msp2 * fix delta size * Update src/main/msp/msp.c Co-authored-by: Mark Haslinghuis <mark@numloq.nl> * Update src/main/msp/msp.c Co-authored-by: Mark Haslinghuis <mark@numloq.nl> --------- Co-authored-by: Mark Haslinghuis <mark@numloq.nl>
This commit is contained in:
parent
37f119cf4f
commit
5cd2ab50e4
6 changed files with 28 additions and 9 deletions
|
@ -2573,6 +2573,13 @@ static mspResult_e mspFcProcessOutCommandWithArg(mspDescriptor_t srcDesc, int16_
|
|||
}
|
||||
}
|
||||
break;
|
||||
#ifdef USE_LED_STRIP
|
||||
case MSP2_GET_LED_STRIP_CONFIG_VALUES:
|
||||
sbufWriteU8(dst, ledStripConfig()->ledstrip_brightness);
|
||||
sbufWriteU16(dst, ledStripConfig()->ledstrip_rainbow_delta);
|
||||
sbufWriteU16(dst, ledStripConfig()->ledstrip_rainbow_freq);
|
||||
break;
|
||||
#endif
|
||||
|
||||
default:
|
||||
return MSP_RESULT_CMD_UNKNOWN;
|
||||
|
@ -3984,6 +3991,14 @@ static mspResult_e mspProcessInCommand(mspDescriptor_t srcDesc, int16_t cmdMSP,
|
|||
}
|
||||
break;
|
||||
|
||||
#ifdef USE_LED_STRIP
|
||||
case MSP2_SET_LED_STRIP_CONFIG_VALUES:
|
||||
ledStripConfigMutable()->ledstrip_brightness = sbufReadU8(src);
|
||||
ledStripConfigMutable()->ledstrip_rainbow_delta = sbufReadU16(src);
|
||||
ledStripConfigMutable()->ledstrip_rainbow_freq = sbufReadU16(src);
|
||||
break;
|
||||
#endif
|
||||
|
||||
default:
|
||||
// we do not know how to handle the (valid) message, indicate error MSP $M!
|
||||
return MSP_RESULT_ERROR;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue