Skip to content

Commit

Permalink
zephyr: io: include 'bootutil_log.h' and declare log module membership
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
pepe2k committed Dec 6, 2023
1 parent 4c7e5bc commit b07b84a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions boot/zephyr/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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)) {
Expand Down

0 comments on commit b07b84a

Please sign in to comment.