mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-03 03:31:41 +03:00
feat(openthread): add option to dump 802.15.4 MAC debug info on assert
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "sdkconfig.h"
|
||||
|
||||
#define OT_PLAT_LOG_TAG "OPENTHREAD"
|
||||
|
||||
#ifndef MS_PER_S
|
||||
@@ -21,3 +23,22 @@
|
||||
#endif
|
||||
|
||||
#define ESP_OPENTHREAD_UART_BUFFER_SIZE CONFIG_OPENTHREAD_UART_BUFFER_SIZE
|
||||
|
||||
#if CONFIG_OPENTHREAD_DEBUG
|
||||
|
||||
#if CONFIG_OPENTHREAD_DUMP_MAC_ON_ASSERT && CONFIG_IEEE802154_RECORD
|
||||
#include "esp_ieee802154.h"
|
||||
#define IEEE802154_RECORD_PRINT() esp_ieee802154_record_print()
|
||||
#else
|
||||
#define IEEE802154_RECORD_PRINT()
|
||||
#endif
|
||||
|
||||
#define ESP_OPENTHREAD_ASSERT(a) do { \
|
||||
if(unlikely(!(a))) { \
|
||||
IEEE802154_RECORD_PRINT(); \
|
||||
assert(a); \
|
||||
} \
|
||||
} while (0)
|
||||
#else
|
||||
#define ESP_OPENTHREAD_ASSERT(a) assert(a)
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user