AP_HAL: change txspace from a BetterStream method to a Stream method.
This commit is contained in:
parent
9a653a1a75
commit
36154559fc
@ -60,10 +60,10 @@ public:
|
|||||||
void println_P(const prog_char_t *pstr) {}
|
void println_P(const prog_char_t *pstr) {}
|
||||||
void printf(const char *pstr, ...) {}
|
void printf(const char *pstr, ...) {}
|
||||||
void _printf_P(const prog_char *pstr, ...) {}
|
void _printf_P(const prog_char *pstr, ...) {}
|
||||||
int txspace() { return 1; }
|
|
||||||
|
|
||||||
/* Empty implementations of Stream virtual methods */
|
/* Empty implementations of Stream virtual methods */
|
||||||
int available() { return 0; }
|
int available() { return 0; }
|
||||||
|
int txspace() { return 1; }
|
||||||
int read() { return -1; }
|
int read() { return -1; }
|
||||||
int peek() { return -1; }
|
int peek() { return -1; }
|
||||||
|
|
||||||
|
@ -32,9 +32,6 @@ class AP_HAL::BetterStream : public AP_HAL::Stream {
|
|||||||
public:
|
public:
|
||||||
BetterStream(void) {}
|
BetterStream(void) {}
|
||||||
|
|
||||||
// Stream extensions
|
|
||||||
virtual int txspace(void) = 0;
|
|
||||||
|
|
||||||
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 *, ...)
|
||||||
|
@ -11,10 +11,15 @@
|
|||||||
class AP_HAL::Stream : public AP_HAL::Print {
|
class AP_HAL::Stream : public AP_HAL::Print {
|
||||||
public:
|
public:
|
||||||
virtual int available() = 0;
|
virtual int available() = 0;
|
||||||
|
/* NB txspace was traditionally a member of BetterStream in the
|
||||||
|
* FastSerial library. As far as concerns go, it belongs with available() */
|
||||||
|
virtual int txspace() = 0;
|
||||||
|
|
||||||
/* return value for read() and peek() :
|
/* return value for read() and peek() :
|
||||||
* -1 if nothing available, uint8_t value otherwise. */
|
* -1 if nothing available, uint8_t value otherwise. */
|
||||||
virtual int read() = 0;
|
virtual int read() = 0;
|
||||||
virtual int peek() = 0;
|
virtual int peek() = 0;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __AP_HAL_UTILITY_STREAM_H__
|
#endif // __AP_HAL_UTILITY_STREAM_H__
|
||||||
|
@ -40,7 +40,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Implementations of BetterStream virtual methods */
|
/* Implementations of BetterStream virtual methods */
|
||||||
int txspace();
|
|
||||||
void print_P(const prog_char_t *s);
|
void print_P(const prog_char_t *s);
|
||||||
void println_P(const prog_char_t *s);
|
void println_P(const prog_char_t *s);
|
||||||
void printf(const char *s, ...)
|
void printf(const char *s, ...)
|
||||||
@ -50,6 +49,7 @@ public:
|
|||||||
|
|
||||||
/* Implementations of Stream virtual methods */
|
/* Implementations of Stream virtual methods */
|
||||||
int available();
|
int available();
|
||||||
|
int txspace();
|
||||||
int read();
|
int read();
|
||||||
int peek();
|
int peek();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user