30 #include <cmsis-plus/os-app-config.h> 37 #ifndef OS_INTEGER_TRACE_PRINTF_TMP_ARRAY_SIZE 38 #define OS_INTEGER_TRACE_PRINTF_TMP_ARRAY_SIZE (200) 49 void __attribute__((weak))
59 ssize_t __attribute__((weak))
60 write (const
void* buf __attribute__((unused)),
std::
size_t nbyte)
62 return static_cast<ssize_t
> (nbyte);
65 void __attribute__((weak))
73 int __attribute__((weak))
77 va_start(args, format);
79 int ret =
vprintf (format, args);
85 int __attribute__((weak))
95 #pragma GCC diagnostic push 96 #pragma GCC diagnostic ignored "-Wformat-nonliteral" 97 int ret = ::vsnprintf (buf,
sizeof(buf), format, args);
98 #pragma GCC diagnostic pop 102 ret =
static_cast<int> (
write (buf, static_cast<size_t> (ret)));
107 int __attribute__((weak))
110 int ret =
static_cast<int> (
write (s, strlen (s)));
113 ret =
static_cast<int> (
write (
"\n", 1));
125 int __attribute__((weak))
128 int ret =
static_cast<int> (
write (reinterpret_cast<const char*> (&c), 1));
139 void __attribute__((weak))
142 printf (
"main(argc=%d, argv=[", argc);
143 for (
int i = 0; i < argc; ++i)
149 printf (
"\"%s\"", argv[i]);
164 void __attribute__((weak))
170 ssize_t __attribute__((weak))
176 void __attribute__((weak))
184 #if defined(__ARM_EABI__) 191 int __attribute__((weak, alias (
"_ZN2os5trace6printfEPKcz")))
194 int __attribute__((weak, alias (
"_ZN2os5trace7vprintfEPKcSt9__va_list")))
197 int __attribute__((weak, alias(
"_ZN2os5trace4putsEPKc")))
200 int __attribute__((weak, alias(
"_ZN2os5trace7putcharEi")))
203 void __attribute__((weak, alias(
"_ZN2os5trace9dump_argsEiPPc")))
215 va_start(args, format);
251 #endif // defined(TRACE) int puts(const char *s)
Write the string and a line terminator to the trace device.
ssize_t trace_write(const void *buf, std::size_t nbyte)
int trace_puts(const char *s)
int putchar(int c)
Write the single character to the trace device.
int trace_vprintf(const char *format,...)
int printf(const char *format,...)
Write a formatted string to the trace device.
void trace_initialize(void)
#define OS_INTEGER_TRACE_PRINTF_TMP_ARRAY_SIZE
void dump_args(int argc, char *argv[])
Write the argv[] array to the trace device.
void flush(void)
Flush the output.
ssize_t write(const void *buf, std::size_t nbyte)
Write the given number of bytes to the trace output channel.
int vprintf(const char *format, std::va_list args)
Write a formatted variable arguments list to the trace device.
int trace_printf(const char *format,...)
void trace_dump_args(int argc, char *argv[])