diff --git a/arduino/beken-72xx/cores/arduino/Arduino.h b/arduino/beken-72xx/cores/arduino/Arduino.h index 84b8544..c2df300 100644 --- a/arduino/beken-72xx/cores/arduino/Arduino.h +++ b/arduino/beken-72xx/cores/arduino/Arduino.h @@ -6,8 +6,10 @@ #include "WCharacterFixup.h" #endif +#define delay delayMilliseconds // change delay()'s signature - it's defined as static inline in WVariant.h #include #include +#undef delay // Include family-specific code #include "WVariant.h" diff --git a/arduino/beken-72xx/cores/arduino/WVariant.h b/arduino/beken-72xx/cores/arduino/WVariant.h index 1fda7a0..cbe3777 100644 --- a/arduino/beken-72xx/cores/arduino/WVariant.h +++ b/arduino/beken-72xx/cores/arduino/WVariant.h @@ -9,9 +9,10 @@ extern "C" { #include "sdk_extern.h" #include "sdk_mem.h" -// allow BDK use its own delay() and let Arduino code use delayMilliseconds() -void delayMilliseconds(unsigned long); -#define delay delayMilliseconds +// define an inline delay() which overrides BDK's delay() +static inline __attribute__((always_inline)) void delay(unsigned long ms) { + delayMilliseconds(ms); +} // from fixups/arch_main.c extern unsigned char __bk_rf_is_init; diff --git a/platform.json b/platform.json index c705341..6f0db2f 100644 --- a/platform.json +++ b/platform.json @@ -127,7 +127,7 @@ }, "tool-ltchiptool": { "type": "uploader", - "version": "https://github.com/libretuya/ltchiptool#v1.6.0", + "version": "https://github.com/libretuya/ltchiptool#v1.6.1", "note": "This is used only for C/C++ code from ltchiptool." }, "tool-openocd": {