mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-17 07:13:33 +08:00
commander_helper: Add rgbled function
with priority and blink period
This commit is contained in:
committed by
Lorenz Meier
parent
2af5d1b929
commit
1e4b79034f
@@ -322,12 +322,16 @@ int led_off(int led)
|
||||
return h_leds.ioctl(LED_OFF, led);
|
||||
}
|
||||
|
||||
void rgbled_set_color_and_mode(uint8_t color, uint8_t mode)
|
||||
void rgbled_set_color_and_mode(uint8_t color, uint8_t mode, uint8_t blinks, uint8_t prio)
|
||||
{
|
||||
led_control.mode = mode;
|
||||
led_control.color = color;
|
||||
led_control.num_blinks = 0;
|
||||
led_control.priority = 0;
|
||||
led_control.num_blinks = blinks;
|
||||
led_control.priority = prio;
|
||||
led_control.timestamp = hrt_absolute_time();
|
||||
orb_publish(ORB_ID(led_control), led_control_pub, &led_control);
|
||||
}
|
||||
|
||||
void rgbled_set_color_and_mode(uint8_t color, uint8_t mode){
|
||||
rgbled_set_color_and_mode(color, mode, 0, 0);
|
||||
}
|
||||
|
||||
@@ -83,4 +83,6 @@ int led_off(int led);
|
||||
*/
|
||||
void rgbled_set_color_and_mode(uint8_t color, uint8_t mode);
|
||||
|
||||
void rgbled_set_color_and_mode(uint8_t color, uint8_t mode, uint8_t blinks, uint8_t prio);
|
||||
|
||||
#endif /* COMMANDER_HELPER_H_ */
|
||||
|
||||
Reference in New Issue
Block a user