13#ifndef CMSIS_PLUS_DIAG_TRACE_H_
14#define CMSIS_PLUS_DIAG_TRACE_H_
18#if defined(__cplusplus)
31#if defined(__cplusplus)
51__attribute__((always_inline))
54#if defined(__ARM_EABI__)
55 __asm__
volatile (
"bkpt 0");
61#if defined(__cplusplus)
99 write (
const void* buf, std::size_t nbyte);
111 printf (
const char* format, ...);
122 vprintf (
const char* format, std::va_list args);
132 puts (
const char* s);
170 __attribute__((always_inline))
181#if defined(__cplusplus)
218#if defined(__cplusplus)
226#if defined(__cplusplus)
238 write (
const void* buf, std::size_t nbyte);
243 printf (
const char* format, ...);
246 vprintf (
const char* format, std::va_list args);
249 puts (
const char* s);
259 inline void __attribute__((always_inline))
264#pragma GCC diagnostic push
265#if defined(__clang__)
266#pragma clang diagnostic ignored "-Wunused-parameter"
267#elif defined(__GNUC__)
268#pragma GCC diagnostic ignored "-Wunused-parameter"
271 inline ssize_t __attribute__((always_inline))
272 write (
const void* buf, std::size_t nbyte)
274 return static_cast<ssize_t
> (nbyte);
277 inline void __attribute__((always_inline))
282 inline int __attribute__((always_inline))
283 printf (
const char* format, ...)
288 inline int __attribute__((always_inline))
289 vprintf (
const char* format, std::va_list args)
294 inline int __attribute__((always_inline))
300 inline int __attribute__((always_inline))
306 inline void __attribute__((always_inline))
311#pragma GCC diagnostic pop
318#if defined(__cplusplus)
348#if defined(__cplusplus)
353__attribute__((always_inline))
358#pragma GCC diagnostic push
359#if defined(__clang__)
360#pragma clang diagnostic ignored "-Wunused-parameter"
361#elif defined(__GNUC__)
362#pragma GCC diagnostic ignored "-Wunused-parameter"
365#pragma GCC diagnostic push
366#if defined(__clang__)
367#pragma clang diagnostic ignored "-Wold-style-cast"
368#elif defined(__GNUC__)
369#if defined(__cplusplus)
370#pragma GCC diagnostic ignored "-Wold-style-cast"
375__attribute__((always_inline))
378 return (ssize_t) (nbyte);
382__attribute__((always_inline))
387#pragma GCC diagnostic pop
390__attribute__((always_inline))
397__attribute__((always_inline))
404__attribute__((always_inline))
411__attribute__((always_inline))
418__attribute__((always_inline))
423#pragma GCC diagnostic pop
int puts(const char *s)
Write the string and a line terminator to the trace device.
int vprintf(const char *format, std::va_list args)
Write a formatted variable arguments list to the trace device.
int printf(const char *format,...)
Write a formatted string to the trace device.
int putchar(int c)
Write the single character to the trace device.
void dump_args(int argc, char *argv[])
Write the argv[] array to the trace device.
void dbg_bkpt(void)
Insert a BKPT0 for debugger usage.
ssize_t write(const void *buf, std::size_t nbyte)
Write the given number of bytes to the trace output channel.
void flush(void)
Flush the output.
int trace_vprintf(const char *format, va_list args)
void trace_initialize(void)
void trace_dbg_bkpt(void)
Insert a BKPT0 for debugger usage.
void trace_dump_args(int argc, char *argv[])
int trace_printf(const char *format,...)
ssize_t trace_write(const void *buf, size_t nbyte)
int trace_puts(const char *s)