AP_HAL_Linux: add discard_input method on UARTDriver
This commit is contained in:
parent
b16c1ea647
commit
9a9743e6ba
@ -293,6 +293,15 @@ int16_t UARTDriver::read()
|
||||
return byte;
|
||||
}
|
||||
|
||||
bool UARTDriver::discard_input()
|
||||
{
|
||||
if (!_initialised) {
|
||||
return false;
|
||||
}
|
||||
_readbuf.empty();
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Linux implementations of Print virtual methods */
|
||||
size_t UARTDriver::write(uint8_t c)
|
||||
{
|
||||
|
@ -31,6 +31,8 @@ public:
|
||||
uint32_t txspace() override;
|
||||
int16_t read() override;
|
||||
|
||||
bool discard_input() override;
|
||||
|
||||
/* Linux implementations of Print virtual methods */
|
||||
size_t write(uint8_t c) override;
|
||||
size_t write(const uint8_t *buffer, size_t size) override;
|
||||
|
Loading…
Reference in New Issue
Block a user