123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- #ifndef ZEPHYR_INCLUDE_SYS_PRINTK_H_
- #define ZEPHYR_INCLUDE_SYS_PRINTK_H_
- #include <toolchain.h>
- #include <stddef.h>
- #include <stdarg.h>
- #include <inttypes.h>
- #if defined(CONFIG_LOG_PRINTK) && defined(CONFIG_LOG2)
- #include <logging/log.h>
- #endif
- #ifdef __cplusplus
- extern "C" {
- #endif
- #ifdef CONFIG_PRINTK
- #if defined(CONFIG_LOG_PRINTK) && defined(CONFIG_LOG2)
- #define printk(...) Z_LOG_PRINTK(__VA_ARGS__)
- static inline __printf_like(1, 0) void vprintk(const char *fmt, va_list ap)
- {
- z_log_msg2_runtime_vcreate(CONFIG_LOG_DOMAIN_ID, NULL,
- LOG_LEVEL_INTERNAL_RAW_STRING, NULL, 0,
- fmt, ap);
- }
- #else
- extern __printf_like(1, 2) void printk(const char *fmt, ...);
- extern __printf_like(1, 0) void vprintk(const char *fmt, va_list ap);
- #endif
- #else
- static inline __printf_like(1, 2) void printk(const char *fmt, ...)
- {
- ARG_UNUSED(fmt);
- }
- static inline __printf_like(1, 0) void vprintk(const char *fmt, va_list ap)
- {
- ARG_UNUSED(fmt);
- ARG_UNUSED(ap);
- }
- #endif
- extern __printf_like(3, 4) int snprintk(char *str, size_t size,
- const char *fmt, ...);
- extern __printf_like(3, 0) int vsnprintk(char *str, size_t size,
- const char *fmt, va_list ap);
- #ifdef CONFIG_ACTIONS_PRINTK_DMA
- void trace_set_panic(void);
- void printk_dma_switch(int sw_dma);
- int uart_dma_send_buf(const uint8_t *buf, int len);
- #endif
- #ifdef __cplusplus
- }
- #endif
- #endif
|