1 /* 2 * Copyright (c) 2023, Nordic Semiconductor ASA 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #ifndef NRF_802154_ASSERT_ZEPHYR_H__ 8 #define NRF_802154_ASSERT_ZEPHYR_H__ 9 10 #if defined(CONFIG_NRF_802154_ASSERT_ZEPHYR) 11 12 #include <zephyr/sys/__assert.h> 13 14 #define NRF_802154_ASSERT(condition) __ASSERT_NO_MSG(condition) 15 16 #elif defined(CONFIG_NRF_802154_ASSERT_ZEPHYR_MINIMAL) 17 18 extern void nrf_802154_assert_handler(void); 19 20 #define NRF_802154_ASSERT(condition) \ 21 do { \ 22 if (!(condition)) { \ 23 nrf_802154_assert_handler(); \ 24 } \ 25 } while (0) 26 27 #endif /* CONFIG_NRF_802154_ASSERT_ZEPHYR_MINIMAL */ 28 29 #endif /* NRF_802154_ASSERT_ZEPHYR_H__*/ 30