74 return _breathe_enabled ? BREATHE_INTERVAL : BLINK_FAST_DURATION;
85 static constexpr
int BREATHE_INTERVAL = 25 * 1000;
86 static constexpr
int BREATHE_STEPS = 64;
88 static constexpr
int BLINK_FAST_DURATION = 100 * 1000;
90 static constexpr
int BLINK_NORMAL_DURATION = 500 * 1000;
92 static constexpr
int BLINK_SLOW_DURATION = 2000 * 1000;
102 uint8_t
mode = led_control_s::MODE_DISABLED;
103 uint8_t blink_times_left = 0;
111 uint8_t priority = led_control_s::MAX_PRIORITY + 1;
120 if (priority > led_control_s::MAX_PRIORITY) {
121 priority = led_control_s::MAX_PRIORITY;
124 void reset() { priority = led_control_s::MAX_PRIORITY + 1; }
125 bool is_valid()
const {
return priority != led_control_s::MAX_PRIORITY + 1; }
130 uint16_t current_blinking_time = 0;
147 if (priority[next_priority].blink_times_left == 0) {
157 int next_priority = (int)next_state.
priority;
158 priority[next_priority].
color = next_state.
color;
159 priority[next_priority].
mode = next_state.
mode;
161 if (next_state.
mode == led_control_s::MODE_FLASH) {
168 if (priority[next_priority].blink_times_left == 0) {
179 bool _force_update{
true};
180 bool _breathe_enabled{
false};
uint8_t color
one of led_control_s::COLOR_*
static led_control_s led_control
int maximum_update_interval() const
get maxium time between two consecutive calls to update() in us.
High-resolution timer with callouts and timekeeping.
uint8_t brightness
brightness in [0, 255]
uint8_t color
one of led_control_s::COLOR_*
#define ORB_ID(_name)
Generates a pointer to the uORB metadata structure for a given topic.
Led device API to control the external LED(s) via uORB interface.
__BEGIN_DECLS typedef uint64_t hrt_abstime
Absolute time, in microsecond units.
uint8_t blink_times_left
how many times left to blink (MSB bit is used for infinite case).
uint8_t mode
one of led_control_s::MODE_*
class LedController Handles the led_control topic: blinking, priorities and state updates...