2013-05-08 03:17:36 -03:00
|
|
|
/// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
|
2012-12-18 21:13:01 -04:00
|
|
|
|
|
|
|
#include <AP_HAL.h>
|
|
|
|
#if CONFIG_HAL_BOARD == HAL_BOARD_AVR_SITL
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdarg.h>
|
2013-05-08 03:17:36 -03:00
|
|
|
#include "utility/print_vprintf.h"
|
2012-12-18 21:13:01 -04:00
|
|
|
|
2013-05-08 03:17:36 -03:00
|
|
|
int libc_vsnprintf(char* str, size_t size, const char *format, va_list ap)
|
|
|
|
{
|
|
|
|
return print_vsnprintf(str, size, format, ap);
|
2012-12-18 21:13:01 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
#include "Util.h"
|
|
|
|
using namespace AVR_SITL;
|
|
|
|
|
|
|
|
int SITLUtil::snprintf(char* str, size_t size, const char *format, ...)
|
|
|
|
{
|
|
|
|
va_list ap;
|
|
|
|
va_start(ap, format);
|
|
|
|
int res = libc_vsnprintf(str, size, format, ap);
|
|
|
|
va_end(ap);
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
int SITLUtil::snprintf_P(char* str, size_t size, const prog_char_t *format, ...)
|
|
|
|
{
|
|
|
|
va_list ap;
|
|
|
|
va_start(ap, format);
|
|
|
|
int res = libc_vsnprintf(str, size, format, ap);
|
|
|
|
va_end(ap);
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int SITLUtil::vsnprintf(char* str, size_t size, const char *format, va_list ap)
|
|
|
|
{
|
|
|
|
return libc_vsnprintf(str, size, format, ap);
|
|
|
|
}
|
|
|
|
|
|
|
|
int SITLUtil::vsnprintf_P(char* str, size_t size, const prog_char_t *format,
|
|
|
|
va_list ap)
|
|
|
|
{
|
|
|
|
return libc_vsnprintf(str, size, format, ap);
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // CONFIG_HAL_BOARD == HAL_BOARD_AVR_SITL
|