Skip to content

Commit

Permalink
app: src: led: fix state indication without activity LEDs
Browse files Browse the repository at this point in the history
Fix CAN channel state indication when no CAN channel activity LEDs are
present.

Fixes: a2794f9

Signed-off-by: Henrik Brix Andersen <[email protected]>
  • Loading branch information
henrikbrixandersen committed Jan 17, 2025
1 parent fa6ef80 commit 2ee71e1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/src/led.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,14 @@ static void led_indicate_activity(struct led_ctx *lctx, enum led_activity type,

if (led == NULL && lctx->started && LED_CTX_HAS_STATE_LED(lctx)) {
led = &lctx->state_led;
value = !activity;
value = !value;
}

if (led != NULL) {
err = gpio_pin_set_dt(led, activity);
err = gpio_pin_set_dt(led, value);
if (err != 0) {
LOG_ERR("failed to turn %s channel %u activity LED (err %d)",
activity ? "on" : "off", lctx->ch, err);
value ? "on" : "off", lctx->ch, err);
}
}
}
Expand Down

0 comments on commit 2ee71e1

Please sign in to comment.