write size bytes to the write buffer */
| 284 | write size bytes to the write buffer |
| 285 | */ |
| 286 | size_t UARTDriver::_write(const uint8_t *buffer, size_t size) |
| 287 | { |
| 288 | if (!_initialised) { |
| 289 | return 0; |
| 290 | } |
| 291 | if (!_write_mutex.take_nonblocking()) { |
| 292 | return 0; |
| 293 | } |
| 294 | |
| 295 | size_t ret = _writebuf.write(buffer, size); |
| 296 | _write_mutex.give(); |
| 297 | return ret; |
| 298 | } |
| 299 | |
| 300 | /* |
| 301 | try writing n bytes, handling an unresponsive port |
nothing calls this directly
no test coverage detected