Commit 8c6c6701 authored by Piotr Dymacz's avatar Piotr Dymacz Committed by Jamie
Browse files

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: default avatarPiotr Dymacz <pepe2k@gmail.com>
parent d99154f4
Loading
Loading
Loading
Loading
+3 −0
Changes for boot/zephyr/io.c: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@
#include <zephyr/linker/linker-defs.h>

#include "target.h"
#include "bootutil/bootutil_log.h"

#if defined(CONFIG_BOOT_SERIAL_PIN_RESET) || defined(CONFIG_BOOT_FIRMWARE_LOADER_PIN_RESET)
#include <zephyr/drivers/hwinfo.h>
@@ -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)) {