Bump MSP api version. Ensure the the number of LEDs in the
MSP_SET_LED_STRIP_CONFIG packet is validated.
This commit is contained in:
parent
9729c59cb0
commit
ce49dcee31
|
@ -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 1 // increment when any change is made, reset to zero when major changes are released after changing API_VERSION_MAJOR
|
#define API_VERSION_MINOR 2 // 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
|
||||||
|
|
||||||
|
@ -1441,6 +1441,12 @@ static bool processInCommand(void)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MSP_SET_LED_STRIP_CONFIG:
|
case MSP_SET_LED_STRIP_CONFIG:
|
||||||
|
{
|
||||||
|
uint8_t ledCount = currentPort->dataSize / 6;
|
||||||
|
if (ledCount != MAX_LED_STRIP_LENGTH) {
|
||||||
|
headSerialError(0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
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];
|
||||||
uint16_t mask;
|
uint16_t mask;
|
||||||
|
@ -1458,6 +1464,7 @@ static bool processInCommand(void)
|
||||||
mask = read8();
|
mask = read8();
|
||||||
ledConfig->xy |= CALCULATE_LED_Y(mask);
|
ledConfig->xy |= CALCULATE_LED_Y(mask);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
case MSP_REBOOT:
|
case MSP_REBOOT:
|
||||||
|
|
Loading…
Reference in New Issue