1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-24 00:35:34 +03:00

Distribute new bits

Distributing new bits now gives us some room to implement some new functions and overlays without needing to change the data format.

Add 4 bits to functions
Add 2 bits to Overlay (one is used by strobe, aonther one is free)
Add 2 bits to params
This commit is contained in:
Marcelo Bezerra 2022-11-09 20:20:43 +01:00
parent db941f7569
commit 233ee3fd38
2 changed files with 9 additions and 9 deletions

View file

@ -1053,15 +1053,15 @@ static bool mspFcProcessOutCommand(uint16_t cmdMSP, sbuf_t *dst, mspPostProcessF
const ledConfig_t *ledConfig = &ledStripConfig()->ledConfigs[i];
uint32_t legacyLedConfig = ledConfig->led_position;
int shiftCount = LED_POS_BITCNT;
int shiftCount = 8;
legacyLedConfig |= ledConfig->led_function << shiftCount;
shiftCount += LED_FUNCTION_BITCNT;
shiftCount += 4;
legacyLedConfig |= (ledConfig->led_overlay & 0x3F) << (shiftCount);
shiftCount += LED_OVERLAY_BITCNT - 1;
shiftCount += 6;
legacyLedConfig |= (ledConfig->led_color) << (shiftCount);
shiftCount += LED_COLOR_BITCNT;
shiftCount += 4;
legacyLedConfig |= (ledConfig->led_direction) << (shiftCount);
shiftCount += LED_DIRECTION_BITCNT;
shiftCount += 6;
legacyLedConfig |= (ledConfig->led_params) << (shiftCount);
sbufWriteU32(dst, legacyLedConfig);