mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-23 09:08:30 -04:00
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:
parent
7774ac534e
commit
2e989fd101
@ -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);
|
||||
}
|
||||
|
@ -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__)
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user