ardupilot/libraries/FastSerial/BetterStream.h
DrZiplok@gmail.com 43262a573f Bring in floating point support for BetterStream::printf, courtesy of the avr-libc implementation.
Strip the stdio integration from FastSerial as we aren't using it and it just wastes space.

Note that this does not attempt to fix the bogus floating point handling in ::print(ln).  That's an issue for another day.

BetterStream::printf(_P) aka FastSerial::printf(_P) support is now as documented for avr-libc printf with floating point support enabled.


git-svn-id: https://arducopter.googlecode.com/svn/trunk@895 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-11-23 00:38:16 +00:00

34 lines
915 B
C++

// -*- Mode: C++; c-basic-offset: 8; indent-tabs-mode: nil -*-
//
// Copyright (c) 2010 Michael Smith. All rights reserved.
//
// This is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License as published by the
// Free Software Foundation; either version 2.1 of the License, or (at
// your option) any later version.
//
#ifndef __BETTERSTREAM_H
#define __BETTERSTREAM_H
#include <Stream.h>
#include <avr/pgmspace.h>
class BetterStream : public Stream {
public:
BetterStream(void) {
}
// Stream extensions
void print_P(const char *);
void println_P(const char *);
void printf(const char *, ...);
void printf_P(const char *, ...);
private:
void _vprintf(unsigned char, const char *, va_list);
};
#endif // __BETTERSTREAM_H