Commit 94912c51 authored by Fabio Utzig's avatar Fabio Utzig Committed by Fabio Utzig
Browse files

Enable serial only when required for Mynewt

For Mynewt when no logging (default option) or serial boot was selected,
avoid initializing all serial supporting system. This enables to save
flash space when only basic bootloader functionality is used.

Signed-off-by: default avatarFabio Utzig <utzig@apache.org>
parent a8e4e971
Loading
Loading
Loading
Loading
+5
Changes for boot/mynewt/src/main.c: 5 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@
#include <console/console.h>
#include "bootutil/image.h"
#include "bootutil/bootutil.h"
#include "bootutil/bootutil_log.h"

#define BOOT_AREA_DESC_MAX    (256)
#define AREA_DESC_MAX         (BOOT_AREA_DESC_MAX)
@@ -67,10 +68,14 @@ main(void)

    hal_bsp_init();

#if defined(MCUBOOT_SERIAL) || defined(MCUBOOT_HAVE_LOGGING)
    /* initialize uart without os */
    os_dev_initialize_all(OS_DEV_INIT_PRIMARY);
    sysinit();
    console_blocking_mode();
#else
    flash_map_init();
#endif

#ifdef MCUBOOT_SERIAL
    /*