15#if defined(OS_USE_OS_APP_CONFIG_H)
16#include <cmsis-plus/os-app-config.h>
25#ifndef OS_INTEGER_TRACE_PRINTF_TMP_ARRAY_SIZE
26#define OS_INTEGER_TRACE_PRINTF_TMP_ARRAY_SIZE (200)
37 void __attribute__((weak))
46 ssize_t __attribute__((weak))
47 write (const
void* buf __attribute__((unused)),
std::
size_t nbyte)
49 return static_cast<ssize_t
> (nbyte);
52 void __attribute__((weak))
59 int __attribute__((weak))
63 va_start(args, format);
65 int ret =
vprintf (format, args);
72#elif defined(__GNUC__)
73#pragma GCC diagnostic ignored "-Wuseless-cast"
76 int __attribute__((weak))
86#pragma GCC diagnostic push
88#pragma clang diagnostic ignored "-Wformat-nonliteral"
89#elif defined(__GNUC__)
90#pragma GCC diagnostic ignored "-Wformat-nonliteral"
92 int ret = ::vsnprintf (buf,
sizeof(buf), format, args);
93#pragma GCC diagnostic pop
97 ret =
static_cast<int> (
write (buf,
static_cast<size_t> (ret)));
102 int __attribute__((weak))
105 int ret =
static_cast<int> (
write (s, strlen (s)));
108 ret =
static_cast<int> (
write (
"\n", 1));
120 int __attribute__((weak))
123 int ret =
static_cast<int> (
write (
reinterpret_cast<const char*
> (&c), 1));
134 void __attribute__((weak))
137 printf (
"main(argc=%d, argv=[", argc);
138 for (
int i = 0; i < argc; ++i)
144 printf (
"\"%s\"", argv[i]);
159void __attribute__((weak))
165ssize_t __attribute__((weak))
171void __attribute__((weak))
179#if defined(__ARM_EABI__)
186int __attribute__((weak, alias (
"_ZN2os5trace6printfEPKcz")))
189int __attribute__((weak, alias ("_ZN2os5trace7vprintfEPKcSt9__va_list")))
192int __attribute__((weak, alias("_ZN2os5trace4putsEPKc")))
195int __attribute__((weak, alias("_ZN2os5trace7putcharEi")))
198void __attribute__((weak, alias("_ZN2os5trace9dump_argsEiPPc")))
210 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)