mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-20 06:45:16 +03:00
Change LED strip colors based on flight mode.
This commit is contained in:
parent
32018d0310
commit
8d6f48cddc
1 changed files with 87 additions and 11 deletions
|
@ -348,21 +348,84 @@ void updateInflightCalibrationState(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define LED_RED {255, 0, 0 }
|
||||||
|
#define LED_GREEN {0, 255, 0 }
|
||||||
|
#define LED_BLUE {0, 0, 255}
|
||||||
|
#define LED_CYAN {0, 255, 255}
|
||||||
|
#define LED_YELLOW {255, 255, 0 }
|
||||||
|
#define LED_ORANGE {255, 128, 0 }
|
||||||
|
#define LED_PINK {255, 0, 128}
|
||||||
|
#define LED_PURPLE {192, 64, 255}
|
||||||
|
|
||||||
static const rgbColor24bpp_t stripOrientation[] =
|
static const rgbColor24bpp_t stripOrientation[] =
|
||||||
{
|
{
|
||||||
{{0, 255, 0}},
|
{LED_GREEN},
|
||||||
{{0, 255, 0}},
|
{LED_GREEN},
|
||||||
{{0, 255, 0}},
|
{LED_GREEN},
|
||||||
{{0, 255, 0}},
|
{LED_GREEN},
|
||||||
{{0, 255, 0}},
|
{LED_GREEN},
|
||||||
|
{LED_RED},
|
||||||
{{255, 0, 0}},
|
{LED_RED},
|
||||||
{{255, 0, 0}},
|
{LED_RED},
|
||||||
{{255, 0, 0}},
|
{LED_RED},
|
||||||
{{255, 0, 0}},
|
{LED_RED}
|
||||||
{{255, 0, 0}}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const rgbColor24bpp_t stripHorizon[] =
|
||||||
|
{
|
||||||
|
{LED_BLUE},
|
||||||
|
{LED_BLUE},
|
||||||
|
{LED_BLUE},
|
||||||
|
{LED_BLUE},
|
||||||
|
{LED_BLUE},
|
||||||
|
{LED_YELLOW},
|
||||||
|
{LED_YELLOW},
|
||||||
|
{LED_YELLOW},
|
||||||
|
{LED_YELLOW},
|
||||||
|
{LED_YELLOW}
|
||||||
|
};
|
||||||
|
|
||||||
|
static const rgbColor24bpp_t stripAngle[] =
|
||||||
|
{
|
||||||
|
{LED_CYAN},
|
||||||
|
{LED_CYAN},
|
||||||
|
{LED_CYAN},
|
||||||
|
{LED_CYAN},
|
||||||
|
{LED_CYAN},
|
||||||
|
{LED_YELLOW},
|
||||||
|
{LED_YELLOW},
|
||||||
|
{LED_YELLOW},
|
||||||
|
{LED_YELLOW},
|
||||||
|
{LED_YELLOW}
|
||||||
|
};
|
||||||
|
|
||||||
|
static const rgbColor24bpp_t stripMag[] =
|
||||||
|
{
|
||||||
|
{LED_PURPLE},
|
||||||
|
{LED_PURPLE},
|
||||||
|
{LED_PURPLE},
|
||||||
|
{LED_PURPLE},
|
||||||
|
{LED_PURPLE},
|
||||||
|
{LED_ORANGE},
|
||||||
|
{LED_ORANGE},
|
||||||
|
{LED_ORANGE},
|
||||||
|
{LED_ORANGE},
|
||||||
|
{LED_ORANGE}
|
||||||
|
};
|
||||||
|
|
||||||
|
static const rgbColor24bpp_t stripHeadfree[] =
|
||||||
|
{
|
||||||
|
{LED_PINK},
|
||||||
|
{LED_PINK},
|
||||||
|
{LED_PINK},
|
||||||
|
{LED_PINK},
|
||||||
|
{LED_PINK},
|
||||||
|
{LED_ORANGE},
|
||||||
|
{LED_ORANGE},
|
||||||
|
{LED_ORANGE},
|
||||||
|
{LED_ORANGE},
|
||||||
|
{LED_ORANGE}
|
||||||
|
};
|
||||||
|
|
||||||
static const rgbColor24bpp_t stripReds[] =
|
static const rgbColor24bpp_t stripReds[] =
|
||||||
{
|
{
|
||||||
|
@ -408,6 +471,19 @@ void updateLedStrip(void)
|
||||||
setStripColors(stripReds);
|
setStripColors(stripReds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (f.HORIZON_MODE) {
|
||||||
|
setStripColors(stripHorizon);
|
||||||
|
} else if (f.ANGLE_MODE) {
|
||||||
|
setStripColors(stripAngle);
|
||||||
|
#ifdef MAG
|
||||||
|
} else if (f.MAG_MODE) {
|
||||||
|
setStripColors(stripMag);
|
||||||
|
#endif
|
||||||
|
} else if (f.HEADFREE_MODE) {
|
||||||
|
setStripColors(stripHeadfree);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// LAYER 2
|
// LAYER 2
|
||||||
|
|
||||||
if (batteryFlashNow) {
|
if (batteryFlashNow) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue