mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 08:45:36 +03:00
Removing STM specific defines from common_pre, and other cleanups (#12982)
Removing STM specific defines from common_pre, and other cleanup
This commit is contained in:
parent
0d96c7ec77
commit
d5d3ee88be
16 changed files with 72 additions and 55 deletions
|
@ -145,7 +145,7 @@ void pgResetFn_ledStripConfig(ledStripConfig_t *ledStripConfig)
|
|||
|
||||
#ifdef USE_LED_STRIP_STATUS_MODE
|
||||
|
||||
#if LED_MAX_STRIP_LENGTH > WS2811_LED_STRIP_LENGTH
|
||||
#if LED_STRIP_MAX_LENGTH > WS2811_LED_STRIP_LENGTH
|
||||
# error "Led strip length must match driver"
|
||||
#endif
|
||||
|
||||
|
@ -187,7 +187,7 @@ PG_REGISTER_WITH_RESET_FN(ledStripStatusModeConfig_t, ledStripStatusModeConfig,
|
|||
|
||||
void pgResetFn_ledStripStatusModeConfig(ledStripStatusModeConfig_t *ledStripStatusModeConfig)
|
||||
{
|
||||
memset(ledStripStatusModeConfig->ledConfigs, 0, LED_MAX_STRIP_LENGTH * sizeof(ledConfig_t));
|
||||
memset(ledStripStatusModeConfig->ledConfigs, 0, LED_STRIP_MAX_LENGTH * sizeof(ledConfig_t));
|
||||
// copy hsv colors as default
|
||||
memset(ledStripStatusModeConfig->colors, 0, ARRAYLEN(hsv) * sizeof(hsvColor_t));
|
||||
STATIC_ASSERT(LED_CONFIGURABLE_COLOR_COUNT >= ARRAYLEN(hsv), LED_CONFIGURABLE_COLOR_COUNT_invalid);
|
||||
|
@ -260,7 +260,7 @@ STATIC_UNIT_TESTED void updateLedCount(void)
|
|||
{
|
||||
int count = 0, countRing = 0, countScanner= 0;
|
||||
|
||||
for (int ledIndex = 0; ledIndex < LED_MAX_STRIP_LENGTH; ledIndex++) {
|
||||
for (int ledIndex = 0; ledIndex < LED_STRIP_MAX_LENGTH; ledIndex++) {
|
||||
const ledConfig_t *ledConfig = &ledStripStatusModeConfig()->ledConfigs[ledIndex];
|
||||
|
||||
if (!(*ledConfig))
|
||||
|
@ -302,7 +302,7 @@ static const char overlayCodes[LED_OVERLAY_COUNT] = { 'T', 'Y', 'O', 'B', 'V',
|
|||
#define CHUNK_BUFFER_SIZE 11
|
||||
bool parseLedStripConfig(int ledIndex, const char *config)
|
||||
{
|
||||
if (ledIndex >= LED_MAX_STRIP_LENGTH)
|
||||
if (ledIndex >= LED_STRIP_MAX_LENGTH)
|
||||
return false;
|
||||
|
||||
enum parseState_e {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue