[beken-72xx] Fix linking with SDK framework

This commit is contained in:
Kuba Szczodrzyński
2022-06-21 18:53:02 +02:00
parent 4f15805246
commit fa7957f5e2
3 changed files with 5 additions and 4 deletions

View File

@@ -15,6 +15,7 @@ assert isdir(LT_ARDUINO_DIR)
# Flags
env.Append(
CPPDEFINES=[
("LIBRETUYA_ARDUINO", "1"),
("ARDUINO", 10812),
"ARDUINO_SDK",
],

View File

@@ -26,7 +26,7 @@ void entry_set_world_flag(void) {
extern void main(void);
#ifdef LIBRETUYA
#ifdef LIBRETUYA_ARDUINO
// beken-72xx has printf_port.h
extern void __wrap_bk_printf_disable();
extern void __wrap_bk_printf_enable();
@@ -38,7 +38,7 @@ void entry_main(void) {
entry_set_world_flag();
#endif
// suppress all output during initialization
#if LIBRETUYA
#if LIBRETUYA_ARDUINO
__wrap_bk_printf_disable();
#endif
// read reboot cause into bk_misc_get_start_type()
@@ -57,7 +57,7 @@ void entry_main(void) {
bk_wdg_reload();
#endif
// enable bk_printf output again
#if LIBRETUYA
#if LIBRETUYA_ARDUINO
__wrap_bk_printf_enable();
#endif
// run the app

View File

@@ -4,7 +4,7 @@
#include_next "uart_pub.h"
#ifdef LIBRETUYA
#ifdef LIBRETUYA_ARDUINO
// make uart.c call __wrap_bk_printf() instead of bk_printf()
// standard wrapping does not work in this case, as bk_printf()
// is implemented in the same translation unit