AP_HAL: UARTDriver: remove _P() variants

They aren't used anymore so remove.
This commit is contained in:
Lucas De Marchi 2015-10-26 09:37:49 -02:00 committed by Randy Mackay
parent 1b07dabeb7
commit a65c98485c
3 changed files with 0 additions and 49 deletions

View File

@ -25,19 +25,6 @@
all boards, although they can be overridden by a port
*/
void AP_HAL::UARTDriver::print_P(const char *s)
{
char c;
while ('\0' != (c = pgm_read_byte((const char *)s++)))
write(c);
}
void AP_HAL::UARTDriver::println_P(const char *s)
{
print_P(s);
println();
}
void AP_HAL::UARTDriver::printf(const char *fmt, ...)
{
va_list ap;
@ -50,16 +37,3 @@ void AP_HAL::UARTDriver::vprintf(const char *fmt, va_list ap)
{
print_vprintf((AP_HAL::Print*)this, 0, fmt, ap);
}
void AP_HAL::UARTDriver::_printf_P(const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
vprintf_P(fmt, ap);
va_end(ap);
}
void AP_HAL::UARTDriver::vprintf_P(const char *fmt, va_list ap)
{
print_vprintf((AP_HAL::Print*)this, 1, fmt, ap);
}

View File

@ -51,13 +51,8 @@ public:
* provided by AP_HAL to ensure consistency between ports to
* different boards
*/
void print_P(const char *s);
void println_P(const char *s);
void printf(const char *s, ...) FORMAT(2, 3);
void _printf_P(const char *s, ...) FORMAT(2, 3);
void vprintf(const char *s, va_list ap);
void vprintf_P(const char *s, va_list ap);
};
#endif // __AP_HAL_UART_DRIVER_H__

View File

@ -25,33 +25,15 @@
#include <AP_Common/AP_Common.h>
#include <AP_HAL/AP_HAL_Namespace.h>
/* char: */
#include <AP_Progmem/AP_Progmem.h>
#include "Stream.h"
/* AP_HAL::BetterStream is a pure virtual interface. It resembles
* Michael Smith's BetterStream library for Arduino.
* The Michael Smith BetterStream provided some implementations for AVR based
* on _vprintf().
* Please provide your own platform-specic implementation of vprintf, sprintf,
* etc. to implement the printf functions.
*/
class AP_HAL::BetterStream : public AP_HAL::Stream {
public:
BetterStream(void) {}
virtual void print_P(const char *) = 0;
virtual void println_P(const char *) = 0;
virtual void printf(const char *, ...) FORMAT(2, 3) = 0;
/* No format checking on printf_P: can't currently support that on AVR */
virtual void _printf_P(const char *, ...) = 0;
#define printf_P(fmt, ...) _printf_P((const char *)fmt, ## __VA_ARGS__)
virtual void vprintf(const char *, va_list) = 0;
virtual void vprintf_P(const char *, va_list) = 0;
};
#endif // __AP_HAL_UTILITY_BETTERSTREAM_H__