MCPcopy Create free account
hub / github.com/ArduPilot/ardupilot / _read

Method _read

libraries/AP_HAL_ChibiOS/UARTDriver.cpp:753–772  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

751}
752
753ssize_t UARTDriver::_read(uint8_t *buffer, uint16_t count)
754{
755 if (_uart_owner_thd != chThdGetSelfX()){
756 return -1;
757 }
758 if (!_rx_initialised) {
759 return -1;
760 }
761
762 const uint32_t ret = _readbuf.read(buffer, count);
763 if (ret == 0) {
764 return 0;
765 }
766
767 if (!_rts_is_active) {
768 update_rts_line();
769 }
770
771 return ret;
772}
773
774/* write a block of bytes to the port */
775size_t UARTDriver::_write(const uint8_t *buffer, size_t size)

Callers

nothing calls this directly

Calls 1

readMethod · 0.45

Tested by

no test coverage detected