From 94e8b9f87e64763fb094e2410e9a9f8e6b640d2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Wed, 22 Jun 2022 23:37:12 +0200 Subject: [PATCH] [beken-72xx] Fix suppressing SDK output during init --- platform/beken-72xx/fixups/arch_main.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/platform/beken-72xx/fixups/arch_main.c b/platform/beken-72xx/fixups/arch_main.c index d544652..e5f76c5 100644 --- a/platform/beken-72xx/fixups/arch_main.c +++ b/platform/beken-72xx/fixups/arch_main.c @@ -26,11 +26,9 @@ void entry_set_world_flag(void) { extern void main(void); -#ifdef LIBRETUYA_ARDUINO -// beken-72xx has printf_port.h -extern void __wrap_bk_printf_disable(); -extern void __wrap_bk_printf_enable(); -#endif +// declare as weak to override with Arduino framework +__attribute__((weak)) void __wrap_bk_printf_disable(); +__attribute__((weak)) void __wrap_bk_printf_enable(); void entry_main(void) { // compatibility with BK7231S_1.0.5 @@ -38,9 +36,7 @@ void entry_main(void) { entry_set_world_flag(); #endif // suppress all output during initialization -#if LIBRETUYA_ARDUINO __wrap_bk_printf_disable(); -#endif // read reboot cause into bk_misc_get_start_type() bk_misc_init_start_type(); // register all sctrl drivers (driver/common/dd.c dd_init_tbl[]) @@ -57,9 +53,7 @@ void entry_main(void) { bk_wdg_reload(); #endif // enable bk_printf output again -#if LIBRETUYA_ARDUINO __wrap_bk_printf_enable(); -#endif // run the app main(); }