Skip to content

Commit

Permalink
fw: one more led_dt_spec
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiobaltieri committed Nov 17, 2024
1 parent a1eabcc commit a5536a4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions firmware/boards/balto/darfon/clicker.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
#include <zephyr/kernel.h>
#include <zephyr/sys/reboot.h>

#define LED_CLICKER_NODE DT_NODELABEL(led_clicker)
#define LED_CLICKER DT_NODE_CHILD_IDX(LED_CLICKER_NODE)
static const struct device *leds = DEVICE_DT_GET(DT_PARENT(LED_CLICKER_NODE));
static const struct led_dt_spec clicker_led = LED_DT_SPEC_GET(DT_NODELABEL(led_clicker));

static bool clicker_enabled;

Expand Down Expand Up @@ -61,7 +59,7 @@ static void input_cb(struct input_event *evt, void *user_data)
sys_reboot(SYS_REBOOT_COLD);
} else if (row == 4 && col == 16 && val == 1) {
clicker_enabled = !clicker_enabled;
led_set_brightness(leds, LED_CLICKER, clicker_enabled ? 100: 0);
led_set_brightness_dt(&clicker_led, clicker_enabled ? 100: 0);
}
}
INPUT_CALLBACK_DEFINE(DEVICE_DT_GET(DT_NODELABEL(kbd)), input_cb, NULL);

0 comments on commit a5536a4

Please sign in to comment.