Merge pull request #783 from gaelj/BF_Fix_LEDstrip_Colibri

Fix broken compiling on colibri target
This commit is contained in:
borisbstyle 2016-07-18 12:14:51 +02:00 committed by GitHub
commit cd7ef93a68
1 changed files with 5 additions and 25 deletions

View File

@ -933,7 +933,7 @@ static bool bstSlaveProcessFeedbackCommand(uint8_t bstRequest)
#ifdef LED_STRIP #ifdef LED_STRIP
case BST_LED_COLORS: case BST_LED_COLORS:
for (i = 0; i < CONFIGURABLE_COLOR_COUNT; i++) { for (i = 0; i < LED_CONFIGURABLE_COLOR_COUNT; i++) {
hsvColor_t *color = &masterConfig.colors[i]; hsvColor_t *color = &masterConfig.colors[i];
bstWrite16(color->h); bstWrite16(color->h);
bstWrite8(color->s); bstWrite8(color->s);
@ -942,13 +942,9 @@ static bool bstSlaveProcessFeedbackCommand(uint8_t bstRequest)
break; break;
case BST_LED_STRIP_CONFIG: case BST_LED_STRIP_CONFIG:
for (i = 0; i < MAX_LED_STRIP_LENGTH; i++) { for (i = 0; i < LED_MAX_STRIP_LENGTH; i++) {
ledConfig_t *ledConfig = &masterConfig.ledConfigs[i]; ledConfig_t *ledConfig = &masterConfig.ledConfigs[i];
bstWrite16((ledConfig->flags & LED_DIRECTION_MASK) >> LED_DIRECTION_BIT_OFFSET); bstWrite32(*ledConfig);
bstWrite16((ledConfig->flags & LED_FUNCTION_MASK) >> LED_FUNCTION_BIT_OFFSET);
bstWrite8(GET_LED_X(ledConfig));
bstWrite8(GET_LED_Y(ledConfig));
bstWrite8(ledConfig->color);
} }
break; break;
#endif #endif
@ -1381,28 +1377,12 @@ static bool bstSlaveProcessWriteCommand(uint8_t bstWriteCommand)
case BST_SET_LED_STRIP_CONFIG: case BST_SET_LED_STRIP_CONFIG:
{ {
i = bstRead8(); i = bstRead8();
if (i >= MAX_LED_STRIP_LENGTH || bstReadDataSize() != (1 + 7)) { if (i >= LED_MAX_STRIP_LENGTH || bstReadDataSize() != (1 + 4)) {
ret = BST_FAILED; ret = BST_FAILED;
break; break;
} }
ledConfig_t *ledConfig = &masterConfig.ledConfigs[i]; ledConfig_t *ledConfig = &masterConfig.ledConfigs[i];
uint16_t mask; *ledConfig = bstRead32();
// currently we're storing directions and functions in a uint16 (flags)
// the msp uses 2 x uint16_t to cater for future expansion
mask = bstRead16();
ledConfig->flags = (mask << LED_DIRECTION_BIT_OFFSET) & LED_DIRECTION_MASK;
mask = bstRead16();
ledConfig->flags |= (mask << LED_FUNCTION_BIT_OFFSET) & LED_FUNCTION_MASK;
mask = bstRead8();
ledConfig->xy = CALCULATE_LED_X(mask);
mask = bstRead8();
ledConfig->xy |= CALCULATE_LED_Y(mask);
ledConfig->color = bstRead8();
reevaluateLedConfig(); reevaluateLedConfig();
} }
break; break;