From 04a821d35a191bd55a540a0ee3cb04cb35e0d06e Mon Sep 17 00:00:00 2001 From: zhaohe Date: Sat, 17 Feb 2024 18:16:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E9=83=A8=E5=88=86=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E8=AD=A6=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/znordic.h | 16 +++++++--------- src/znordic.c | 1 + 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/include/znordic.h b/include/znordic.h index ace0ed6..f1b605b 100644 --- a/include/znordic.h +++ b/include/znordic.h @@ -100,21 +100,19 @@ const char* hex2str(const uint8_t* data, uint16_t len); #define ZPIN(port, num) NRF_GPIO_PIN_MAP(port, num) -#define ZERROR_CHECK(err_code) \ - do { \ - const uint32_t LOCAL_ERR_CODE = (err_code); \ - if (LOCAL_ERR_CODE != NRF_SUCCESS) { \ - ZLOGI("%s:%d ZERROR_CHECK(%s) fail:%d", __FILE__, __LINE__, #err_code, LOCAL_ERR_CODE); \ - NRF_LOG_PROCESS(); \ - APP_ERROR_CHECK(LOCAL_ERR_CODE); \ - } \ +#define ZERROR_CHECK(err_code) \ + do { \ + const uint32_t _zecode = (err_code); \ + if (_zecode != NRF_SUCCESS) { \ + ZLOGI("%s:%d ZERROR_CHECK(%s) fail:%d", __FILE__, __LINE__, #err_code, _zecode); \ + APP_ERROR_CHECK(_zecode); \ + } \ } while (0) #define ZASSERT(expr) \ do { \ if (!(expr)) { \ ZLOGI("%s:%d ZASSERT(%s) fail", __FILE__, __LINE__, #expr); \ - NRF_LOG_PROCESS(); \ APP_ERROR_CHECK_BOOL(false); \ } \ } while (0) \ No newline at end of file diff --git a/src/znordic.c b/src/znordic.c index 2822804..e7339d3 100644 --- a/src/znordic.c +++ b/src/znordic.c @@ -13,6 +13,7 @@ #include "nrf_log_ctrl.h" #include "nrf_log_default_backends.h" #include "nrfx_rtc.h" +#include "ble_dfu.h" /********************************************************************* * INCLUDES */