replace space() with txspace()

space() was actually intended to be tx buffer space, it just had a
bug. The name txspace() is clearer however, and should prevent
confusion as to which buffer its for

git-svn-id: https://arducopter.googlecode.com/svn/trunk@3247 f9c3cf11-9bcb-44bc-f272-b75c42450872
This commit is contained in:
tridge60@gmail.com 2011-09-04 22:52:11 +00:00
parent 2dde50366f
commit 6cfb9a9c2b
4 changed files with 3 additions and 11 deletions

View File

@ -54,8 +54,8 @@ BetterStream::_printf_P(const prog_char *fmt, ...)
}
int
BetterStream::space(void)
BetterStream::txspace(void)
{
// by default claim that there is always space
// by default claim that there is always space in transmit buffer
return(INT_MAX);
}

View File

@ -28,7 +28,7 @@ public:
void _printf_P(const prog_char *, ...);
__attribute__ ((format(__printf__, 2, 3)));
virtual int space(void);
virtual int txspace(void);
#define printf_P(fmt, ...) _printf_P((const prog_char *)fmt, ## __VA_ARGS__)

View File

@ -142,13 +142,6 @@ int FastSerial::available(void)
return ((_rxBuffer->head - _rxBuffer->tail) & _rxBuffer->mask);
}
int FastSerial::space(void)
{
if (!_open)
return (-1);
return (((_rxBuffer->tail - _rxBuffer->head) & _rxBuffer->mask) - 1);
}
int FastSerial::txspace(void)
{
if (!_open)

View File

@ -110,7 +110,6 @@ public:
virtual void begin(long baud);
virtual void end(void);
virtual int available(void);
virtual int space(void);
virtual int txspace(void);
virtual int read(void);
virtual int peek(void);