|
@ -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 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) |
|
|
} while (0) |
|
|
|
|
|
|
|
|
#define ZASSERT(expr) \ |
|
|
#define ZASSERT(expr) \ |
|
|
do { \ |
|
|
do { \ |
|
|
if (!(expr)) { \ |
|
|
if (!(expr)) { \ |
|
|
ZLOGI("%s:%d ZASSERT(%s) fail", __FILE__, __LINE__, #expr); \ |
|
|
ZLOGI("%s:%d ZASSERT(%s) fail", __FILE__, __LINE__, #expr); \ |
|
|
NRF_LOG_PROCESS(); \ |
|
|
|
|
|
APP_ERROR_CHECK_BOOL(false); \ |
|
|
APP_ERROR_CHECK_BOOL(false); \ |
|
|
} \ |
|
|
} \ |
|
|
} while (0) |
|
|
} while (0) |