btc_common: Redefine BTC assert macro to use standard assert

Allows assert to be disabled, made silent, etc.

Progress towards https://github.com/espressif/esp-idf/issues/6306
pull/6718/head
Angus Gratton 2021-02-18 10:15:56 +11:00
rodzic a0c73c5f92
commit 0d26c89b6b
2 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -342,7 +342,7 @@ static void btc_dm_auth_cmpl_evt (tBTA_DM_AUTH_CMPL *p_auth_cmpl)
)
#endif
if (1) {
bt_status_t ret;
bt_status_t ret __attribute__((unused));
BTC_TRACE_DEBUG("%s: Storing link key. key_type=0x%x",
__FUNCTION__, p_auth_cmpl->key_type);
ret = btc_storage_add_bonded_device(&bd_addr,

Wyświetl plik

@ -16,12 +16,12 @@
#ifndef __BTC_COMMON_H__
#define __BTC_COMMON_H__
#include <assert.h>
#include "common/bt_trace.h"
#include "stack/bt_types.h"
#include "osi/osi.h"
#define BTC_ASSERTC(cond, msg, val) if (!(cond)) { LOG_ERROR( \
"### ASSERT : %s line %d %s (%d) ###", __FILE__, __LINE__, msg, val);}
#define BTC_ASSERTC(cond, msg, val) assert(cond && msg)
#define BTC_HAL_CBACK(P_CB, P_CBACK, ...)\
if (P_CB && P_CB->P_CBACK) { \