Skip to content

Commit 8c6c670

Browse files
pepe2knordicjm
authored andcommitted
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: 433b848 ("zephyr: Move IO functions out of main to separate file") Signed-off-by: Piotr Dymacz <[email protected]>
1 parent d99154f commit 8c6c670

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

boot/zephyr/io.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include <zephyr/linker/linker-defs.h>
2929

3030
#include "target.h"
31+
#include "bootutil/bootutil_log.h"
3132

3233
#if defined(CONFIG_BOOT_SERIAL_PIN_RESET) || defined(CONFIG_BOOT_FIRMWARE_LOADER_PIN_RESET)
3334
#include <zephyr/drivers/hwinfo.h>
@@ -78,6 +79,8 @@ static const struct gpio_dt_spec led0 = GPIO_DT_SPEC_GET(LED0_NODE, gpios);
7879
#error "Unsupported board: led0 devicetree alias is not defined"
7980
#endif
8081

82+
BOOT_LOG_MODULE_DECLARE(mcuboot);
83+
8184
void io_led_init(void)
8285
{
8386
if (!device_is_ready(led0.port)) {

0 commit comments

Comments
 (0)