[beken-72xx] Replace delay() define with inline function

This commit is contained in:
Kuba Szczodrzyński
2022-10-03 15:12:15 +02:00
parent 2a75bdbeda
commit 18653781d5
3 changed files with 7 additions and 4 deletions

View File

@@ -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 <api/ArduinoAPI.h>
#include <core/LibreTuyaAPI.h>
#undef delay
// Include family-specific code
#include "WVariant.h"

View File

@@ -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;

View File

@@ -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": {