Macro that was defined in the `common/log.h` has been moved to the newly created `common/assert.h` file. Files that were using those macro has been updated consequently. Also, the include of `common/log.h` has been removed of files that were actually not using any logging methods. Some `#include "common/log.h"` have been removed. Those were required before when including `hal/debug.h`. With this change, `hal/debug.h` no longer has this requirement, because the replacement, `common/assert.h` includes what it uses. Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
31 lines
752 B
C
31 lines
752 B
C
/*
|
|
* Copyright (c) 2016 Nordic Semiconductor ASA
|
|
* Copyright (c) 2016 Vinayak Kariappa Chettimada
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
#include "common/assert.h"
|
|
|
|
#ifdef CONFIG_BT_CTLR_ASSERT_HANDLER
|
|
void bt_ctlr_assert_handle(char *file, uint32_t line);
|
|
#define LL_ASSERT(cond) \
|
|
if (!(cond)) { \
|
|
BT_ASSERT_PRINT(cond); \
|
|
bt_ctlr_assert_handle(__FILE__, __LINE__); \
|
|
}
|
|
#define LL_ASSERT_MSG(cond, fmt, ...) \
|
|
if (!(cond)) { \
|
|
BT_ASSERT_PRINT(cond); \
|
|
BT_ASSERT_PRINT_MSG(fmt, ##__VA_ARGS__); \
|
|
bt_ctlr_assert_handle(__FILE__, __LINE__); \
|
|
}
|
|
#else
|
|
#define LL_ASSERT(cond) \
|
|
BT_ASSERT(cond)
|
|
#define LL_ASSERT_MSG(cond, fmt, ...) \
|
|
BT_ASSERT_MSG(cond, fmt, ##__VA_ARGS__)
|
|
#endif
|
|
|
|
#include "hal/debug_vendor_hal.h"
|