HAL_FLYMAPLE: implement a dummy buffered write
This commit is contained in:
parent
a8c97f99d1
commit
9624821493
@ -72,4 +72,8 @@ size_t FLYMAPLEConsoleDriver::write(uint8_t c) {
|
|||||||
return _base_uart->write(c);
|
return _base_uart->write(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t FLYMAPLEConsoleDriver::write(const uint8_t *buffer, size_t size) {
|
||||||
|
return _base_uart->write(buffer, size);
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -18,6 +18,7 @@ public:
|
|||||||
int16_t read();
|
int16_t read();
|
||||||
|
|
||||||
size_t write(uint8_t c);
|
size_t write(uint8_t c);
|
||||||
|
size_t write(const uint8_t *buffer, size_t size);
|
||||||
private:
|
private:
|
||||||
AP_HAL::UARTDriver* _base_uart;
|
AP_HAL::UARTDriver* _base_uart;
|
||||||
};
|
};
|
||||||
|
@ -98,4 +98,13 @@ size_t FLYMAPLEUARTDriver::write(uint8_t c)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t FLYMAPLEUARTDriver::write(const uint8_t *buffer, size_t size)
|
||||||
|
{
|
||||||
|
size_t n = 0;
|
||||||
|
while (size--) {
|
||||||
|
n += write(*buffer++);
|
||||||
|
}
|
||||||
|
return n;
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -43,6 +43,7 @@ public:
|
|||||||
|
|
||||||
/* FLYMAPLE implementations of Print virtual methods */
|
/* FLYMAPLE implementations of Print virtual methods */
|
||||||
size_t write(uint8_t c);
|
size_t write(uint8_t c);
|
||||||
|
size_t write(const uint8_t *buffer, size_t size);
|
||||||
private:
|
private:
|
||||||
HardwareSerial* _hws;
|
HardwareSerial* _hws;
|
||||||
uint8_t* _txBuf; // If need more than libmaple usart driver buffer of 63
|
uint8_t* _txBuf; // If need more than libmaple usart driver buffer of 63
|
||||||
|
Loading…
Reference in New Issue
Block a user