mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 16:55:36 +03:00
Updated LED config defaults for Colibri Race
This commit is contained in:
parent
69d0a40c9d
commit
565b8e4846
4 changed files with 33 additions and 1 deletions
|
@ -84,6 +84,10 @@ PG_REGISTER_ARR_WITH_RESET_FN(modeColorIndexes_t, LED_MODE_COUNT, modeColors, PG
|
|||
PG_REGISTER_WITH_RESET_FN(specialColorIndexes_t, specialColors, PG_SPECIAL_COLOR_CONFIG, 0);
|
||||
*/
|
||||
|
||||
#if defined(TARGET_CONFIG_DEFAULT_LEDSTRIP)
|
||||
void targetApplyDefaultLedStripConfig(ledConfig_t *ledConfigs);
|
||||
#endif
|
||||
|
||||
static bool ledStripInitialised = false;
|
||||
static bool ledStripEnabled = true;
|
||||
static ledStripConfig_t * currentLedStripConfig;
|
||||
|
@ -1078,6 +1082,10 @@ void pgResetFn_specialColors(specialColorIndexes_t *instance)
|
|||
void applyDefaultLedStripConfig(ledConfig_t *ledConfigs)
|
||||
{
|
||||
memset(ledConfigs, 0, LED_MAX_STRIP_LENGTH * sizeof(ledConfig_t));
|
||||
|
||||
#if defined(TARGET_CONFIG_DEFAULT_LEDSTRIP)
|
||||
targetApplyDefaultLedStripConfig(ledConfigs);
|
||||
#endif
|
||||
}
|
||||
|
||||
void applyDefaultColors(hsvColor_t *colors)
|
||||
|
|
|
@ -152,6 +152,9 @@ hsvColor_t *colors;
|
|||
modeColorIndexes_t *modeColors;
|
||||
specialColorIndexes_t specialColors;
|
||||
|
||||
#define LF(name) LED_FUNCTION_ ## name
|
||||
#define LO(name) LED_FLAG_OVERLAY(LED_OVERLAY_ ## name)
|
||||
#define LD(name) LED_FLAG_DIRECTION(LED_DIRECTION_ ## name)
|
||||
#define DEFINE_LED(x, y, col, dir, func, ol, params) (LED_MOV_POS(CALCULATE_LED_XY(x, y)) | LED_MOV_COLOR(col) | LED_MOV_DIRECTION(dir) | LED_MOV_FUNCTION(func) | LED_MOV_OVERLAY(ol) | LED_MOV_PARAMS(params))
|
||||
|
||||
static inline uint8_t ledGetXY(const ledConfig_t *lcfg) { return ((*lcfg >> LED_POS_OFFSET) & LED_BIT_MASK(LED_POS_BITCNT)); }
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <platform.h>
|
||||
|
||||
|
@ -26,7 +27,7 @@
|
|||
|
||||
#include "config/config_master.h"
|
||||
#include "config/feature.h"
|
||||
|
||||
#include "io/ledstrip.h"
|
||||
|
||||
// alternative defaults settings for COLIBRI RACE targets
|
||||
void targetConfiguration(master_t *config)
|
||||
|
@ -84,3 +85,22 @@ void targetConfiguration(master_t *config)
|
|||
featureSet(FEATURE_AIRMODE);
|
||||
featureSet(FEATURE_LED_STRIP);
|
||||
}
|
||||
|
||||
#if defined(TARGET_CONFIG_DEFAULT_LEDSTRIP)
|
||||
void targetApplyDefaultLedStripConfig(ledConfig_t *ledConfigs)
|
||||
{
|
||||
const ledConfig_t defaultLedStripConfig[] = {
|
||||
DEFINE_LED( 0, 0, 6, LD(WEST), LF(COLOR), LO(WARNING), 0 ),
|
||||
DEFINE_LED( 0, 1, 6, LD(WEST), LF(COLOR), LO(WARNING), 0 ),
|
||||
DEFINE_LED( 0, 8, 6, LD(WEST), LF(COLOR), LO(WARNING), 0 ),
|
||||
DEFINE_LED( 7, 15, 6, 0, LF(COLOR), 0, 0 ),
|
||||
DEFINE_LED( 8, 15, 6, 0, LF(COLOR), 0, 0 ),
|
||||
DEFINE_LED( 7, 14, 6, 0, LF(COLOR), 0, 0 ),
|
||||
DEFINE_LED( 8, 14, 6, 0, LF(COLOR), 0, 0 ),
|
||||
DEFINE_LED( 15, 8, 6, LD(EAST), LF(COLOR), LO(WARNING), 0 ),
|
||||
DEFINE_LED( 15, 1, 6, LD(EAST), LF(COLOR), LO(WARNING), 0 ),
|
||||
DEFINE_LED( 15, 0, 6, LD(EAST), LF(COLOR), LO(WARNING), 0 ),
|
||||
};
|
||||
memcpy(ledConfigs, &defaultLedStripConfig, sizeof(defaultLedStripConfig));
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#define BST_DEVICE_NAME "COLIBRI RACE"
|
||||
#define BST_DEVICE_NAME_LENGTH 12
|
||||
#define TARGET_CONFIG
|
||||
#define TARGET_CONFIG_DEFAULT_LEDSTRIP
|
||||
|
||||
#define CONFIG_FASTLOOP_PREFERRED_ACC ACC_DEFAULT
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue