28#ifndef CMSIS_PLUS_DIAG_TRACE_H_
29#define CMSIS_PLUS_DIAG_TRACE_H_
33#if defined(__cplusplus)
46#if defined(__cplusplus)
66__attribute__((always_inline))
69#if defined(__ARM_EABI__)
70 asm volatile (
"bkpt 0");
76#if defined(__cplusplus)
114 write (
const void* buf, std::size_t nbyte);
126 printf (
const char* format, ...);
137 vprintf (
const char* format, std::va_list args);
147 puts (
const char* s);
185 __attribute__((always_inline))
196#if defined(__cplusplus)
233#if defined(__cplusplus)
241#if defined(__cplusplus)
253 write (
const void* buf, std::size_t nbyte);
258 printf (
const char* format, ...);
261 vprintf (
const char* format, std::va_list args);
264 puts (
const char* s);
274 inline void __attribute__((always_inline))
279#pragma GCC diagnostic push
280#pragma GCC diagnostic ignored "-Wunused-parameter"
282 inline ssize_t __attribute__((always_inline))
283 write (
const void* buf, std::size_t nbyte)
285 return static_cast<ssize_t
> (nbyte);
288 inline void __attribute__((always_inline))
294 inline int __attribute__((always_inline))
295 printf (
const char* format, ...)
300 inline int __attribute__((always_inline))
301 vprintf (
const char* format, std::va_list args)
306 inline int __attribute__((always_inline))
312 inline int __attribute__((always_inline))
318 inline void __attribute__((always_inline))
323#pragma GCC diagnostic pop
330#if defined(__cplusplus)
360#if defined(__cplusplus)
365__attribute__((always_inline))
371#pragma GCC diagnostic push
372#pragma GCC diagnostic ignored "-Wunused-parameter"
374#pragma GCC diagnostic push
375#if defined(__cplusplus)
376#pragma GCC diagnostic ignored "-Wold-style-cast"
380__attribute__((always_inline))
383 return (ssize_t) (nbyte);
387__attribute__((always_inline))
393#pragma GCC diagnostic pop
396__attribute__((always_inline))
403__attribute__((always_inline))
410__attribute__((always_inline))
417__attribute__((always_inline))
424__attribute__((always_inline))
429#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)