mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-12-24 07:29:42 +00:00
792eae91c6
sprintf that use strformat, so there's no need to pull in the newlib implementation. Build system improvements.
31 lines
462 B
C
31 lines
462 B
C
#include <stdio.h>
|
|
#include <debug-uart.h>
|
|
#include <string.h>
|
|
#include <strformat.h>
|
|
|
|
static StrFormatResult
|
|
write_str(void *user_data, const char *data, unsigned int len)
|
|
{
|
|
dbg_send_bytes((unsigned char*)data, len);
|
|
return STRFORMAT_OK;
|
|
}
|
|
|
|
|
|
static StrFormatContext ctxt =
|
|
{
|
|
write_str,
|
|
NULL
|
|
};
|
|
int
|
|
printf(const char *fmt, ...)
|
|
{
|
|
int res;
|
|
va_list ap;
|
|
va_start(ap, fmt);
|
|
res = format_str_v(&ctxt, fmt, ap);
|
|
va_end(ap);
|
|
return res;
|
|
}
|
|
|
|
|