BetterStream: use common macro for printf formatting

Since this needs an additional header, also put them in correct order.
This commit is contained in:
Lucas De Marchi 2015-10-25 18:31:40 -02:00 committed by Randy Mackay
parent 20c6ffc5e3
commit 2556fc8dbe

View File

@ -22,12 +22,14 @@
#define __AP_HAL_UTILITY_BETTERSTREAM_H__ #define __AP_HAL_UTILITY_BETTERSTREAM_H__
#include <stdarg.h> #include <stdarg.h>
#include <AP_HAL/AP_HAL_Namespace.h>
#include "Stream.h"
#include <AP_Common/AP_Common.h>
#include <AP_HAL/AP_HAL_Namespace.h>
/* prog_char_t: */ /* prog_char_t: */
#include <AP_Progmem/AP_Progmem.h> #include <AP_Progmem/AP_Progmem.h>
#include "Stream.h"
/* AP_HAL::BetterStream is a pure virtual interface. It resembles /* AP_HAL::BetterStream is a pure virtual interface. It resembles
* Michael Smith's BetterStream library for Arduino. * Michael Smith's BetterStream library for Arduino.
* The Michael Smith BetterStream provided some implementations for AVR based * The Michael Smith BetterStream provided some implementations for AVR based
@ -45,8 +47,7 @@ public:
virtual void print_P(const prog_char_t *) = 0; virtual void print_P(const prog_char_t *) = 0;
virtual void println_P(const prog_char_t *) = 0; virtual void println_P(const prog_char_t *) = 0;
virtual void printf(const char *, ...) virtual void printf(const char *, ...) FORMAT(2, 3) = 0;
__attribute__ ((format(__printf__, 2, 3))) = 0;
/* No format checking on printf_P: can't currently support that on AVR */ /* No format checking on printf_P: can't currently support that on AVR */
virtual void _printf_P(const prog_char *, ...) = 0; virtual void _printf_P(const prog_char *, ...) = 0;