Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: hello SerialTestv11 SerialTestv12 Sierpinski ... more
TARGET_TY51822R3/TOOLCHAIN_GCC_ARM/app_trace.h@172:65be27845400, 2019-02-20 (annotated)
- Committer:
- AnnaBridge
- Date:
- Wed Feb 20 20:53:29 2019 +0000
- Revision:
- 172:65be27845400
- Parent:
- 171:3a7713b1edbc
mbed library release version 165
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| AnnaBridge | 143:86740a56073b | 1 | #ifndef __DEBUG_H_ |
| AnnaBridge | 143:86740a56073b | 2 | #define __DEBUG_H_ |
| AnnaBridge | 143:86740a56073b | 3 | |
| AnnaBridge | 143:86740a56073b | 4 | #include <stdint.h> |
| AnnaBridge | 143:86740a56073b | 5 | #include <stdio.h> |
| AnnaBridge | 143:86740a56073b | 6 | |
| AnnaBridge | 143:86740a56073b | 7 | /** |
| AnnaBridge | 143:86740a56073b | 8 | * @defgroup app_trace Debug Logger |
| AnnaBridge | 143:86740a56073b | 9 | * @ingroup app_common |
| AnnaBridge | 143:86740a56073b | 10 | * @{ |
| AnnaBridge | 143:86740a56073b | 11 | * @brief Enables debug logs/ trace over UART. |
| AnnaBridge | 143:86740a56073b | 12 | * @details Enables debug logs/ trace over UART. Tracing is enabled only if |
| AnnaBridge | 143:86740a56073b | 13 | * ENABLE_DEBUG_LOG_SUPPORT is defined in the project. |
| AnnaBridge | 143:86740a56073b | 14 | */ |
| AnnaBridge | 143:86740a56073b | 15 | #ifdef ENABLE_DEBUG_LOG_SUPPORT |
| AnnaBridge | 143:86740a56073b | 16 | #include "nrf_log.h" |
| AnnaBridge | 143:86740a56073b | 17 | /** |
| AnnaBridge | 143:86740a56073b | 18 | * @brief Module Initialization. |
| AnnaBridge | 143:86740a56073b | 19 | * |
| AnnaBridge | 143:86740a56073b | 20 | * @details Initializes the module to use UART as trace output. |
| AnnaBridge | 143:86740a56073b | 21 | * |
| AnnaBridge | 143:86740a56073b | 22 | * @warning This function will configure UART using default board configuration. |
| AnnaBridge | 143:86740a56073b | 23 | * Do not call this function if UART is configured from a higher level in the application. |
| AnnaBridge | 143:86740a56073b | 24 | */ |
| AnnaBridge | 143:86740a56073b | 25 | void app_trace_init(void); |
| AnnaBridge | 143:86740a56073b | 26 | |
| AnnaBridge | 143:86740a56073b | 27 | /** |
| AnnaBridge | 143:86740a56073b | 28 | * @brief Log debug messages. |
| AnnaBridge | 143:86740a56073b | 29 | * |
| AnnaBridge | 143:86740a56073b | 30 | * @details This API logs messages over UART. The module must be initialized before using this API. |
| AnnaBridge | 143:86740a56073b | 31 | * |
| AnnaBridge | 143:86740a56073b | 32 | * @note Though this is currently a macro, it should be used used and treated as function. |
| AnnaBridge | 143:86740a56073b | 33 | */ |
| AnnaBridge | 143:86740a56073b | 34 | #define app_trace_log NRF_LOG_PRINTF |
| AnnaBridge | 143:86740a56073b | 35 | |
| AnnaBridge | 143:86740a56073b | 36 | /** |
| AnnaBridge | 143:86740a56073b | 37 | * @brief Dump auxiliary byte buffer to the debug trace. |
| AnnaBridge | 143:86740a56073b | 38 | * |
| AnnaBridge | 143:86740a56073b | 39 | * @details This API logs messages over UART. The module must be initialized before using this API. |
| AnnaBridge | 143:86740a56073b | 40 | * |
| AnnaBridge | 143:86740a56073b | 41 | * @param[in] p_buffer Buffer to be dumped on the debug trace. |
| AnnaBridge | 143:86740a56073b | 42 | * @param[in] len Size of the buffer. |
| AnnaBridge | 143:86740a56073b | 43 | */ |
| AnnaBridge | 143:86740a56073b | 44 | void app_trace_dump(uint8_t * p_buffer, uint32_t len); |
| AnnaBridge | 143:86740a56073b | 45 | |
| AnnaBridge | 143:86740a56073b | 46 | #else // ENABLE_DEBUG_LOG_SUPPORT |
| AnnaBridge | 143:86740a56073b | 47 | |
| AnnaBridge | 143:86740a56073b | 48 | #define app_trace_init(...) |
| AnnaBridge | 143:86740a56073b | 49 | #define app_trace_log(...) |
| AnnaBridge | 143:86740a56073b | 50 | #define app_trace_dump(...) |
| AnnaBridge | 143:86740a56073b | 51 | |
| AnnaBridge | 143:86740a56073b | 52 | #endif // ENABLE_DEBUG_LOG_SUPPORT |
| AnnaBridge | 143:86740a56073b | 53 | |
| AnnaBridge | 143:86740a56073b | 54 | /** @} */ |
| AnnaBridge | 143:86740a56073b | 55 | |
| AnnaBridge | 143:86740a56073b | 56 | #endif //__DEBUG_H_ |


