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

Unified BUILD_BUG_ON and STATIC_ASSERT into STATIC_ASSERT.

This commit is contained in:
mikeller 2018-08-19 01:41:26 +12:00
parent 54dd79ac69
commit 70ac9423c7
10 changed files with 36 additions and 33 deletions

View file

@ -165,7 +165,7 @@ void pgResetFn_ledStripConfig(ledStripConfig_t *ledStripConfig)
memset(ledStripConfig->ledConfigs, 0, LED_MAX_STRIP_LENGTH * sizeof(ledConfig_t));
// copy hsv colors as default
memset(ledStripConfig->colors, 0, ARRAYLEN(hsv) * sizeof(hsvColor_t));
BUILD_BUG_ON(LED_CONFIGURABLE_COLOR_COUNT < ARRAYLEN(hsv));
STATIC_ASSERT(LED_CONFIGURABLE_COLOR_COUNT >= ARRAYLEN(hsv), LED_CONFIGURABLE_COLOR_COUNT_invalid);
for (unsigned colorIndex = 0; colorIndex < ARRAYLEN(hsv); colorIndex++) {
ledStripConfig->colors[colorIndex] = hsv[colorIndex];
}