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

127 commits

Author SHA1 Message Date
Dominic Clifton
3ed6afba17 Removing timing instrumentation from CC3D & LEDSTRIP build. 2014-09-20 01:04:40 +01:00
Dominic Clifton
e847a6347d Improve speed of LED STRIP code.
Shaved about 150us each strip update.

This commit leaves in some timing trace code for the CC3D target, the
results of which can be seen in the debug variables for the sections
being timed.

A later commit will remove/disable the timing code.
2014-09-20 01:00:13 +01:00
Dominic Clifton
d904741f43 Update LED throttle mode to use rcData instead of rcThrottle, avoid
having to reference min/maxThrottle.

Range was not being calculated correctly.

Throttle color now blends with the current color of the LED so that at
mid throttle any orientation color is still correct when mixing Throttle
and Flight Mode on an LED.

Fix tabs.  Reduce nesting level.
2014-09-19 01:46:41 +01:00
Dominic Clifton
9723df947e Merge pull request #83 from goebish/cleanflight-throttle-led
Throttle level indicator led mode
2014-09-19 00:18:55 +01:00
Dominic Clifton
0e2b0ccafd Adding note regarding color index usage. 2014-09-19 00:15:58 +01:00
Goebish
16871c7a91 Merge remote-tracking branch 'cleanflight/master' into cleanflight-throttle-led 2014-09-19 01:10:21 +02:00
Goebish
b83e7b42b7 Add throttle level indicator led mode 2014-09-19 01:09:59 +02:00
Dominic Clifton
72eac8048a Allow colors to be configurable via the cli.
color x h,s,v

x = 0-15
h = 0-359
s = 0-255
v = 0-255
2014-09-19 00:08:40 +01:00
Dominic Clifton
545980c14a Move colors from ram to master config. Initialise colors only when
config is reset to defaults.
2014-09-18 22:53:12 +01:00
Dominic Clifton
79ea1ac088 Store colors in flash, copy to ram and use from ram. Store mode colors
as color ids instead of duplicating the color data.

Later, this will allow configurable colors as the colors can be copied
to the master config and used from that without any ram penalty.
2014-09-18 21:59:37 +01:00
Dominic Clifton
0b4f5804bc Update led strip code to use HSV instead of RGB. 2014-09-18 20:53:28 +01:00
Dominic Clifton
1790e082fe Ensure led strip is configured in updateLedStrip method to prevent crash
when enabling the feature from the cli.
2014-09-16 00:29:41 +01:00
Dominic Clifton
d60183d91d Normalize all the line endings 2014-09-15 23:40:17 +01:00
Dominic Clifton
a287f9247d Allow led strip to show failsafe state. Closes #76. 2014-09-15 23:24:08 +01:00
Dominic Clifton
99a296821a Update default led strip config so there is always an orientation light
on at the front when the battery alarm is on.
2014-09-15 20:24:00 +01:00
Dominic Clifton
6ce5736990 Update LED strip code to allow configurable LED strips.
See documentation for details.
2014-09-15 03:15:11 +01:00
Dominic Clifton
d577b93026 Alternate layout for a 31-LED quad - disabled by default. 2014-09-03 15:58:28 +01:00
Dominic Clifton
3f0754d295 Replace global flags with stateFlags, flightModeFlags and armingFlags.
Each flag was previously a whole byte, now all of the flags only take up
4 bytes as they are represented by bit masks.

This is cleaner because the different kind of flags are now separated.

Additionally this changes the behaviour of arming slightly.  When using
a switch to arm the aircraft will not arm unless the switch has been in
the off state once.  This prevents arming if you power the aircraft with
a low throttle and the switch in the on position.
2014-08-24 12:11:30 +01:00
Dominic Clifton
53623d4d7f Update led strip compile in/out. 2014-08-01 01:15:05 +01:00
Dominic Clifton
5086b46f1f Add simple LED animation when disarmed. Fixed led grid size
calculation.
2014-07-26 18:21:58 +01:00
Dominic Clifton
4e284b3e41 Calculate led grid size dynamically. 2014-07-26 16:23:26 +01:00
Dominic Clifton
21c8fdc69b Update led config so it's possible to show which LEDs show the arm
state.  Mutually exclusive with leds that show MODE.

Use blue to indicate armed, green for disarmed.

Leds not configured for ARM_STATE or MODE will be off by default.

The example combines corner LEDs with ARM_STATE and INDICATOR.  This
results in the corner leds showing arm state and then being overridden
with an indicator color as needed.
2014-07-02 23:50:39 +01:00
Dominic Clifton
3ce33f0455 Update battery warning and turn indicators to use led config.
Cleaned up the battery warning checking as it was being calculated twice
instead of just once per battery warning state cycle.

Updated the code so that modes are shown when disarmed.  Any led's
without the MODE flag will then show the armed state.  In the config in
this commit that results in the corner LEDs being GREEN when disarmed
and OFF when armed.
2014-07-02 23:38:19 +01:00
Dominic Clifton
36990951df Adding code to change led colors based on mode and armed state. 2014-07-02 21:53:50 +01:00
Dominic Clifton
de04acd7e1 First cut of programmatically orientation lights using an LED strip
configuration that defines each LED's functions, orientation and
position in a grid.
2014-07-02 20:40:26 +01:00
Dominic Clifton
af2f9a2655 Work-in-progress 2014-07-02 08:58:10 +01:00
Dominic Clifton
1730e3dfd3 Relocated led strip user code into separate file.
Added documentation.

Added LED_STRIP feature, can only be enabled under certain circumstances
depending on target due to pin/timer mappings - see documentation.
2014-06-09 19:11:31 +01:00