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

Method uart_rx_thread

libraries/AP_HAL_ChibiOS/UARTDriver.cpp:162–180  ·  view source on GitHub ↗

thread for handling UART receive We use events indexed by serial_num to trigger a more rapid send for unbuffered_write uarts, and run at 1kHz for general UART handling */

Source from the content-addressed store, hash-verified

160 unbuffered_write uarts, and run at 1kHz for general UART handling
161 */
162void UARTDriver::uart_rx_thread(void* arg)
163{
164 while (uart_rx_thread_ctx == nullptr) {
165 hal.scheduler->delay_microseconds(1000);
166 }
167
168 while (true) {
169 hal.scheduler->delay_microseconds(1000);
170
171 for (uint8_t i=0; i<UART_MAX_DRIVERS; i++) {
172 if (serial_drivers[i] == nullptr) {
173 continue;
174 }
175 if (serial_drivers[i]->_rx_initialised) {
176 serial_drivers[i]->_rx_timer_tick();
177 }
178 }
179 }
180}
181
182/*
183 initialise UART RX thread

Callers

nothing calls this directly

Calls 2

_rx_timer_tickMethod · 0.80
delay_microsecondsMethod · 0.45

Tested by

no test coverage detected