Appiko
log.h
1 
19 #ifndef CODEBASE_PERIPHERAL_MODULES_LOG_H_
20 #define CODEBASE_PERIPHERAL_MODULES_LOG_H_
21 
22 #if defined LOG_BMP_SWO
23 #define log_printf(...)
24 #elif defined LOG_SEGGER_RTT
25 #include "SEGGER_RTT.h"
26 #define log_init()
27 #define log_printf(...) SEGGER_RTT_printf(0, __VA_ARGS__)
28 #elif defined LOG_UART_DMA_PRINTF//UARTE printf
29 #include "nrf.h"
30 #include "tinyprintf.h"
31 #include "uart_printf.h"
32 #define log_init() uart_printf_init(UART_PRINTF_BAUD_1M)
33 #pragma GCC diagnostic ignored "-Wformat"
34 #pragma GCC diagnostic push
35 #define log_printf(...) tfp_printf(__VA_ARGS__)
36 #pragma GCC diagnostic pop
37 #elif defined LOG_UART_PRINTF//UART printf
38 #include "nrf.h"
39 #include "tinyprintf.h"
40 #include "hal_uart.h"
41 #define log_init() hal_uart_init(HAL_UART_BAUD_1M, NULL)
42 #pragma GCC diagnostic ignored "-Wformat"
43 #pragma GCC diagnostic push
44 #define log_printf(...) tfp_printf(__VA_ARGS__)
45 #pragma GCC diagnostic pop
46 #else
47 #define log_init()
48 #define log_printf(...)
49 #endif
50 
51 #endif /* CODEBASE_PERIPHERAL_MODULES_LOG_H_ */