14#if defined(OS_USE_OS_APP_CONFIG_H)
15#include <cmsis-plus/os-app-config.h>
24#ifndef OS_INTEGER_TRACE_PRINTF_TMP_ARRAY_SIZE
25#define OS_INTEGER_TRACE_PRINTF_TMP_ARRAY_SIZE (200)
36 void __attribute__ ((weak))
45 ssize_t __attribute__ ((weak))
46 write (const
void* buf __attribute__ ((unused)),
std::
size_t nbyte)
48 return static_cast<ssize_t
> (nbyte);
51 void __attribute__ ((weak))
58 int __attribute__ ((weak))
62 va_start (args, format);
64 int ret =
vprintf (format, args);
71#elif defined(__GNUC__)
72#pragma GCC diagnostic ignored "-Wuseless-cast"
75 int __attribute__ ((weak))
85#pragma GCC diagnostic push
87#pragma clang diagnostic ignored "-Wformat-nonliteral"
88#elif defined(__GNUC__)
89#pragma GCC diagnostic ignored "-Wformat-nonliteral"
91 int ret = ::vsnprintf (buf,
sizeof (buf), format, args);
92#pragma GCC diagnostic pop
96 ret =
static_cast<int> (
write (buf,
static_cast<size_t> (ret)));
101 int __attribute__ ((weak))
104 int ret =
static_cast<int> (
write (s, strlen (s)));
107 ret =
static_cast<int> (
write (
"\n", 1));
119 int __attribute__ ((weak))
123 =
static_cast<int> (
write (
reinterpret_cast<const char*
> (&c), 1));
134#pragma GCC diagnostic push
135#if defined(__clang__)
136#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
138 void __attribute__ ((weak))
141 printf (
"main(argc=%d, argv=[", argc);
142 for (
int i = 0; i < argc; ++i)
148 printf (
"\"%s\"", argv[i]);
152#pragma GCC diagnostic pop
164void __attribute__ ((weak))
170ssize_t __attribute__ ((weak))
176void __attribute__ ((weak))
184#if defined(__ARM_EABI__)
191int __attribute__ ((weak, alias (
"_ZN2os5trace6printfEPKcz")))
194int __attribute__ ((weak, alias ("_ZN2os5trace7vprintfEPKcSt9__va_list")))
197int __attribute__ ((weak, alias ("_ZN2os5trace4putsEPKc")))
200int __attribute__ ((weak, alias ("_ZN2os5trace7putcharEi")))
203void __attribute__ ((weak, alias ("_ZN2os5trace9dump_argsEiPPc")))
215 va_start (args, format);
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.
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.
#define OS_INTEGER_TRACE_PRINTF_TMP_ARRAY_SIZE
int trace_vprintf(const char *format, va_list args)
void trace_initialize(void)
void trace_dump_args(int argc, char *argv[])
ssize_t trace_write(const void *buf, std::size_t nbyte)
int trace_printf(const char *format,...)
int trace_puts(const char *s)