diff options
-rw-r--r-- | src/modules/gpio_led/gpio_led.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/modules/gpio_led/gpio_led.c b/src/modules/gpio_led/gpio_led.c index 93a29a851..6dfd22fdf 100644 --- a/src/modules/gpio_led/gpio_led.c +++ b/src/modules/gpio_led/gpio_led.c @@ -253,8 +253,9 @@ void gpio_led_cycle(FAR void *arg) bool updated; orb_check(priv->vehicle_status_sub, &updated); - if (updated) + if (updated) { orb_copy(ORB_ID(vehicle_status), priv->vehicle_status_sub, &priv->status); + } /* select pattern for current status */ int pattern = 0; @@ -294,8 +295,9 @@ void gpio_led_cycle(FAR void *arg) priv->counter++; - if (priv->counter > 5) + if (priv->counter > 5) { priv->counter = 0; + } /* repeat cycle at 5 Hz */ if (gpio_led_started) { |