From b07b84a46186aa241e14800d6a544370f5b4982f Mon Sep 17 00:00:00 2001 From: Piotr Dymacz Date: Tue, 5 Dec 2023 14:05:38 +0100 Subject: [PATCH] zephyr: io: include 'bootutil_log.h' and declare log module membership This fixes below error when building with 'MCUBOOT_INDICATION_LED' and 'LOG' enabled: In file included from zephyr/include/zephyr/logging/log.h:11, from zephyr/include/zephyr/usb/usb_device.h:43, from bootloader/mcuboot/boot/zephyr/io.c:26: mcuboot/boot/zephyr/io.c: In function 'io_led_init': zephyr/include/zephyr/logging/log_core.h:151:20: error: '__log_level' undeclared (first use in this function) 151 | (_level <= __log_level) && \ | ^~~~~~~~~~~ Fixes: 433b8480 ("zephyr: Move IO functions out of main to separate file") Signed-off-by: Piotr Dymacz --- boot/zephyr/io.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/boot/zephyr/io.c b/boot/zephyr/io.c index fc1966d7f..e6d54d3c7 100644 --- a/boot/zephyr/io.c +++ b/boot/zephyr/io.c @@ -28,6 +28,7 @@ #include #include "target.h" +#include "bootutil/bootutil_log.h" #if defined(CONFIG_BOOT_SERIAL_PIN_RESET) || defined(CONFIG_BOOT_FIRMWARE_LOADER_PIN_RESET) #include @@ -78,6 +79,8 @@ static const struct gpio_dt_spec led0 = GPIO_DT_SPEC_GET(LED0_NODE, gpios); #error "Unsupported board: led0 devicetree alias is not defined" #endif +BOOT_LOG_MODULE_DECLARE(mcuboot); + void io_led_init(void) { if (!device_is_ready(led0.port)) {