forked from Archive/PX4-Autopilot
Breathe animation, led solid on arming
This commit is contained in:
parent
8583cf4dcc
commit
8caada2188
|
@ -134,6 +134,12 @@ ring_blink(void)
|
|||
{
|
||||
#ifdef GPIO_LED4
|
||||
|
||||
if (/* IO armed */ (r_status_flags & PX4IO_P_STATUS_FLAGS_SAFETY_OFF)
|
||||
/* and FMU is armed */ && (r_setup_arming & PX4IO_P_SETUP_ARMING_FMU_ARMED)) {
|
||||
LED_RING(1);
|
||||
return;
|
||||
}
|
||||
|
||||
// XXX this led code does have
|
||||
// intentionally a few magic numbers.
|
||||
const unsigned max_brightness = 118;
|
||||
|
@ -147,7 +153,11 @@ ring_blink(void)
|
|||
|
||||
bool on = ((on_counter * 100) / brightness_counter+1) <= ((brightness * 100) / max_brightness+1);
|
||||
|
||||
LED_RING(on);
|
||||
// XXX once led is PWM driven,
|
||||
// remove the ! in the line below
|
||||
// to return to the proper breathe
|
||||
// animation / pattern (currently inverted)
|
||||
LED_RING(!on);
|
||||
brightness_counter++;
|
||||
|
||||
if (on) {
|
||||
|
@ -349,7 +359,7 @@ user_start(int argc, char *argv[])
|
|||
heartbeat_blink();
|
||||
}
|
||||
|
||||
ring_blink();
|
||||
ring_blink();
|
||||
|
||||
check_reboot();
|
||||
|
||||
|
|
|
@ -140,7 +140,7 @@ extern pwm_limit_t pwm_limit;
|
|||
#define LED_BLUE(_s) stm32_gpiowrite(GPIO_LED1, !(_s))
|
||||
#define LED_AMBER(_s) stm32_gpiowrite(GPIO_LED2, !(_s))
|
||||
#define LED_SAFETY(_s) stm32_gpiowrite(GPIO_LED3, !(_s))
|
||||
#define LED_RING(_s) stm32_gpiowrite(GPIO_LED4, !(_s))
|
||||
#define LED_RING(_s) stm32_gpiowrite(GPIO_LED4, (_s))
|
||||
|
||||
#ifdef CONFIG_ARCH_BOARD_PX4IO_V1
|
||||
|
||||
|
|
Loading…
Reference in New Issue