|
Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
basic LED scheduler based on WS2812 RGB led driver More...
#include "modules/light/light_scheduler.h"#include "modules/light/light_ws2812_arch.h"#include "generated/airframe.h"
Include dependency graph for light_scheduler.c:Go to the source code of this file.
Macros | |
| #define | LIGHT_SCHEDULER_MODE LIGHT_SCHEDULER_MODE_RAINBOW |
| Optional header needed by the alert condition. | |
| #define | LIGHT_SCHEDULER_RED 255 |
| #define | LIGHT_SCHEDULER_GREEN 255 |
| #define | LIGHT_SCHEDULER_BLUE 255 |
| #define | LIGHT_SCHEDULER_BRIGHTNESS 255 |
| #define | LIGHT_SCHEDULER_COLOR LIGHT_SCHEDULER_COLOR_CUSTOM |
| Startup color preset, overrides LIGHT_SCHEDULER_RED/GREEN/BLUE when not custom. | |
| #define | LIGHT_SCHEDULER_ALERT_COLOR LIGHT_SCHEDULER_COLOR_RED |
| Alert color, shown in every mode while LIGHT_SCHEDULER_ALERT is true. | |
| #define | LIGHT_SCHEDULER_ALERT_SPARKLE FALSE |
| Show the sparkle effect instead of the alert color while LIGHT_SCHEDULER_ALERT is true. | |
Functions | |
| static void | light_scheduler_set (uint32_t n, uint8_t r, uint8_t g, uint8_t b) |
| set one led, scaled by the brightness setting | |
| static uint32_t | sparkle_rand (void) |
| xorshift32 pseudo random numbers for the sparkle effect | |
| static void | light_scheduler_sparkle (void) |
| Sparkle: every led takes a random bright color, with white twinkles and short dark blinks. | |
| void | light_scheduler_set_color (uint8_t color) |
| Settings handler: apply a color preset to red/green/blue (or select a flag) and switch to color mode. | |
| void | light_scheduler_init (void) |
| void | light_scheduler_periodic (void) |
Variables | |
| uint8_t | light_scheduler_mode = LIGHT_SCHEDULER_MODE |
| one of LIGHT_SCHEDULER_MODE_* | |
| uint8_t | light_scheduler_red = LIGHT_SCHEDULER_RED |
| red value in color mode | |
| uint8_t | light_scheduler_green = LIGHT_SCHEDULER_GREEN |
| green value in color mode | |
| uint8_t | light_scheduler_blue = LIGHT_SCHEDULER_BLUE |
| blue value in color mode | |
| uint8_t | light_scheduler_brightness = LIGHT_SCHEDULER_BRIGHTNESS |
| brightness scaling (255 = full) | |
| uint8_t | light_scheduler_color = LIGHT_SCHEDULER_COLOR |
| selected preset (light_scheduler_color_t) | |
| static const uint8_t | light_scheduler_presets [LIGHT_SCHEDULER_COLOR_FLAG_FIRST][3] |
| RGB values of the single color presets. | |
| static const uint8_t | light_scheduler_flags [LIGHT_SCHEDULER_COLOR_NB - LIGHT_SCHEDULER_COLOR_FLAG_FIRST][3] |
| Flags: three color presets, from the first to the last led of a strip. | |
| static uint32_t | s = 0 |
| static uint32_t | sparkle_seed = 0x2545F491 |
basic LED scheduler based on WS2812 RGB led driver
Definition in file light_scheduler.c.
| #define LIGHT_SCHEDULER_ALERT_COLOR LIGHT_SCHEDULER_COLOR_RED |
Alert color, shown in every mode while LIGHT_SCHEDULER_ALERT is true.
Definition at line 66 of file light_scheduler.c.
Show the sparkle effect instead of the alert color while LIGHT_SCHEDULER_ALERT is true.
Definition at line 71 of file light_scheduler.c.
| #define LIGHT_SCHEDULER_BLUE 255 |
Definition at line 52 of file light_scheduler.c.
| #define LIGHT_SCHEDULER_BRIGHTNESS 255 |
Definition at line 56 of file light_scheduler.c.
| #define LIGHT_SCHEDULER_COLOR LIGHT_SCHEDULER_COLOR_CUSTOM |
Startup color preset, overrides LIGHT_SCHEDULER_RED/GREEN/BLUE when not custom.
Definition at line 61 of file light_scheduler.c.
| #define LIGHT_SCHEDULER_GREEN 255 |
Definition at line 48 of file light_scheduler.c.
| #define LIGHT_SCHEDULER_MODE LIGHT_SCHEDULER_MODE_RAINBOW |
Optional header needed by the alert condition.
Definition at line 40 of file light_scheduler.c.
| #define LIGHT_SCHEDULER_RED 255 |
Definition at line 44 of file light_scheduler.c.
Definition at line 156 of file light_scheduler.c.
References light_scheduler_color, LIGHT_SCHEDULER_COLOR_CUSTOM, light_scheduler_mode, light_scheduler_set_color(), light_ws2812_arch_init(), and mode.
Here is the call graph for this function:Definition at line 166 of file light_scheduler.c.
References foo, LIGHT_SCHEDULER_ALERT_COLOR, LIGHT_SCHEDULER_ALERT_SPARKLE, light_scheduler_blue, light_scheduler_color, LIGHT_SCHEDULER_COLOR_FLAG_FIRST, LIGHT_SCHEDULER_COLOR_NB, light_scheduler_flags, light_scheduler_green, light_scheduler_mode, LIGHT_SCHEDULER_MODE_COLOR, LIGHT_SCHEDULER_MODE_OFF, LIGHT_SCHEDULER_MODE_SPARKLE, light_scheduler_presets, light_scheduler_red, light_scheduler_set(), light_scheduler_sparkle(), light_ws2812_arch_set(), s, and WS2812_NB_LEDS.
Here is the call graph for this function:set one led, scaled by the brightness setting
Definition at line 109 of file light_scheduler.c.
References b, g, light_scheduler_brightness, and light_ws2812_arch_set().
Referenced by light_scheduler_periodic(), and light_scheduler_sparkle().
Here is the call graph for this function:
Here is the caller graph for this function:Settings handler: apply a color preset to red/green/blue (or select a flag) and switch to color mode.
Definition at line 143 of file light_scheduler.c.
References foo, light_scheduler_blue, light_scheduler_color, LIGHT_SCHEDULER_COLOR_CUSTOM, LIGHT_SCHEDULER_COLOR_FLAG_FIRST, LIGHT_SCHEDULER_COLOR_NB, light_scheduler_green, light_scheduler_mode, LIGHT_SCHEDULER_MODE_COLOR, light_scheduler_presets, and light_scheduler_red.
Referenced by light_scheduler_init().
Here is the caller graph for this function:Sparkle: every led takes a random bright color, with white twinkles and short dark blinks.
Definition at line 125 of file light_scheduler.c.
References LIGHT_SCHEDULER_COLOR_BLUE, LIGHT_SCHEDULER_COLOR_CYAN, LIGHT_SCHEDULER_COLOR_GREEN, LIGHT_SCHEDULER_COLOR_MAGENTA, LIGHT_SCHEDULER_COLOR_ORANGE, LIGHT_SCHEDULER_COLOR_RED, LIGHT_SCHEDULER_COLOR_WHITE, LIGHT_SCHEDULER_COLOR_YELLOW, light_scheduler_presets, light_scheduler_set(), light_ws2812_arch_set(), sparkle_rand(), and WS2812_NB_LEDS.
Referenced by light_scheduler_periodic().
Here is the call graph for this function:
Here is the caller graph for this function:xorshift32 pseudo random numbers for the sparkle effect
Definition at line 116 of file light_scheduler.c.
References sparkle_seed.
Referenced by light_scheduler_sparkle().
Here is the caller graph for this function:| uint8_t light_scheduler_blue = LIGHT_SCHEDULER_BLUE |
blue value in color mode
Definition at line 77 of file light_scheduler.c.
Referenced by light_scheduler_periodic(), and light_scheduler_set_color().
| uint8_t light_scheduler_brightness = LIGHT_SCHEDULER_BRIGHTNESS |
brightness scaling (255 = full)
Definition at line 78 of file light_scheduler.c.
Referenced by light_scheduler_set().
| uint8_t light_scheduler_color = LIGHT_SCHEDULER_COLOR |
selected preset (light_scheduler_color_t)
Definition at line 79 of file light_scheduler.c.
Referenced by light_scheduler_init(), light_scheduler_periodic(), and light_scheduler_set_color().
|
static |
Flags: three color presets, from the first to the last led of a strip.
Definition at line 96 of file light_scheduler.c.
Referenced by light_scheduler_periodic().
| uint8_t light_scheduler_green = LIGHT_SCHEDULER_GREEN |
green value in color mode
Definition at line 76 of file light_scheduler.c.
Referenced by light_scheduler_periodic(), and light_scheduler_set_color().
| uint8_t light_scheduler_mode = LIGHT_SCHEDULER_MODE |
one of LIGHT_SCHEDULER_MODE_*
Definition at line 74 of file light_scheduler.c.
Referenced by light_scheduler_init(), light_scheduler_periodic(), and light_scheduler_set_color().
|
static |
RGB values of the single color presets.
Definition at line 82 of file light_scheduler.c.
Referenced by light_scheduler_periodic(), light_scheduler_set_color(), and light_scheduler_sparkle().
| uint8_t light_scheduler_red = LIGHT_SCHEDULER_RED |
red value in color mode
Definition at line 75 of file light_scheduler.c.
Referenced by light_scheduler_periodic(), and light_scheduler_set_color().
|
static |
Definition at line 105 of file light_scheduler.c.
Referenced by _chvsnprintf(), adc_buf_channel(), adc_buf_get(), detect_window_sizes(), DictionaryTrainingYUV(), distance_to_wall(), ekf_aw_get_speed_body(), ekf_aw_set_offset(), ekf_aw_set_speed_body(), ekf_aw_set_wind(), float_mat_exp(), float_rmat_reorthogonalize(), float_vect_scale(), float_vect_sdiv(), float_vect_smul(), fly_to_xy(), gvf_control_2D(), gvf_ik_control_2D(), gvf_ik_set_direction(), gvf_parametric_set_direction(), gvf_set_direction(), indexn(), ins_mekf_wind_get_speed_ned(), ins_mekf_wind_set_speed_ned(), int32_vect_find(), int32_vect_smul(), invariant_model(), invariant_model(), jevois_send_string(), jevois_setmapping(), jpeg_create_svs_header(), light_scheduler_periodic(), lla_of_ecef_d(), lla_of_ecef_f(), memcpy_from_registers(), memcpy_to_registers(), mrdivide(), msg_state_init(), nav_gvf_ik_segment_loop_XY1_XY2(), nav_gvf_segment_loop_XY1_XY2(), opticflow_pmw3901_publish(), out_of_segment_area(), pprz_cholesky_float(), pprz_svd_solve_float(), print_string(), rtcm3_clear_callbacks(), rtcm3_find_callback(), rtcm3_process(), rtcm3_register_callback(), send_jevois_mavlink_visual_target(), set_nav_stage(), syslink_char_available(), syslink_check_free_space(), syslink_getch(), syslink_put_buffer(), syslink_put_byte(), thd_test_syracuse_restart(), ubx_process(), and update_LUT().
|
static |
Definition at line 106 of file light_scheduler.c.
Referenced by sparkle_rand().