mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-15 20:35:33 +03:00
Update MSP to allow setting of LED colors.
This commit is contained in:
parent
ddc7a39fa2
commit
e7302a9e10
1 changed files with 6 additions and 3 deletions
|
@ -121,7 +121,7 @@ void useRcControlsConfig(modeActivationCondition_t *modeActivationConditions, es
|
||||||
#define MSP_PROTOCOL_VERSION 0
|
#define MSP_PROTOCOL_VERSION 0
|
||||||
|
|
||||||
#define API_VERSION_MAJOR 1 // increment when major changes are made
|
#define API_VERSION_MAJOR 1 // increment when major changes are made
|
||||||
#define API_VERSION_MINOR 3 // increment when any change is made, reset to zero when major changes are released after changing API_VERSION_MAJOR
|
#define API_VERSION_MINOR 4 // increment when any change is made, reset to zero when major changes are released after changing API_VERSION_MAJOR
|
||||||
|
|
||||||
#define API_VERSION_LENGTH 2
|
#define API_VERSION_LENGTH 2
|
||||||
|
|
||||||
|
@ -1104,13 +1104,14 @@ static bool processOutCommand(uint8_t cmdMSP)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MSP_LED_STRIP_CONFIG:
|
case MSP_LED_STRIP_CONFIG:
|
||||||
headSerialReply(MAX_LED_STRIP_LENGTH * 6);
|
headSerialReply(MAX_LED_STRIP_LENGTH * 7);
|
||||||
for (i = 0; i < MAX_LED_STRIP_LENGTH; i++) {
|
for (i = 0; i < MAX_LED_STRIP_LENGTH; i++) {
|
||||||
ledConfig_t *ledConfig = &masterConfig.ledConfigs[i];
|
ledConfig_t *ledConfig = &masterConfig.ledConfigs[i];
|
||||||
serialize16((ledConfig->flags & LED_DIRECTION_MASK) >> LED_DIRECTION_BIT_OFFSET);
|
serialize16((ledConfig->flags & LED_DIRECTION_MASK) >> LED_DIRECTION_BIT_OFFSET);
|
||||||
serialize16((ledConfig->flags & LED_FUNCTION_MASK) >> LED_FUNCTION_BIT_OFFSET);
|
serialize16((ledConfig->flags & LED_FUNCTION_MASK) >> LED_FUNCTION_BIT_OFFSET);
|
||||||
serialize8(GET_LED_X(ledConfig));
|
serialize8(GET_LED_X(ledConfig));
|
||||||
serialize8(GET_LED_Y(ledConfig));
|
serialize8(GET_LED_Y(ledConfig));
|
||||||
|
serialize8(ledConfig->color);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
@ -1450,7 +1451,7 @@ static bool processInCommand(void)
|
||||||
case MSP_SET_LED_STRIP_CONFIG:
|
case MSP_SET_LED_STRIP_CONFIG:
|
||||||
{
|
{
|
||||||
i = read8();
|
i = read8();
|
||||||
if (i >= MAX_LED_STRIP_LENGTH || currentPort->dataSize != 7) {
|
if (i >= MAX_LED_STRIP_LENGTH || currentPort->dataSize != 8) {
|
||||||
headSerialError(0);
|
headSerialError(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1470,6 +1471,8 @@ static bool processInCommand(void)
|
||||||
mask = read8();
|
mask = read8();
|
||||||
ledConfig->xy |= CALCULATE_LED_Y(mask);
|
ledConfig->xy |= CALCULATE_LED_Y(mask);
|
||||||
|
|
||||||
|
ledConfig->color = read8();
|
||||||
|
|
||||||
reevalulateLedConfig();
|
reevalulateLedConfig();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue