From c9ca536868b528df9d9ba8f82524bad17b4ddd7c Mon Sep 17 00:00:00 2001 From: Henrik Brix Andersen Date: Wed, 25 Dec 2024 13:00:32 +0000 Subject: [PATCH] app: led: support CANnectivity channels without activity LEDs Support CANnectivity devicetree channels without activity LEDs. Signed-off-by: Henrik Brix Andersen --- app/src/led.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/led.c b/app/src/led.c index 3b3dd43..ec1abc2 100644 --- a/app/src/led.c +++ b/app/src/led.c @@ -68,8 +68,8 @@ struct led_ctx { #define CHANNEL_LED_GPIO_DT_SPEC_GET(node_id) \ { \ .state_led = GPIO_DT_SPEC_GET_OR(node_id, state_gpios, {0}), \ - .activity_led = {DT_FOREACH_PROP_ELEM_SEP(node_id, activity_gpios, \ - GPIO_DT_SPEC_GET_BY_IDX, (,))}, \ + .activity_led[0] = GPIO_DT_SPEC_GET_BY_IDX_OR(node_id, activity_gpios, 0, {0}), \ + .activity_led[1] = GPIO_DT_SPEC_GET_BY_IDX_OR(node_id, activity_gpios, 1, {0}), \ } #define CHANNEL_LED0_GPIO_DT_SPEC_GET() \