1 /* 2 * Copyright (c) 2022 Benjamin Björnsson <benjamin.bjornsson@gmail.com>. 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #include <zephyr/init.h> 8 #include <zephyr/drivers/gpio.h> 9 board_init(void)10static int board_init(void) 11 { 12 13 /* Set led1 inactive since the Arduino bootloader leaves it active */ 14 const struct gpio_dt_spec led1 = GPIO_DT_SPEC_GET(DT_ALIAS(led1), gpios); 15 16 if (!gpio_is_ready_dt(&led1)) { 17 return -ENODEV; 18 } 19 20 return gpio_pin_configure_dt(&led1, GPIO_OUTPUT_INACTIVE); 21 } 22 23 SYS_INIT(board_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE); 24