HAL_PX4: don't check USB for data if not connected

This commit is contained in:
Andrew Tridgell 2013-11-05 14:41:42 +11:00
parent 8dc6b758f3
commit 24d1cf3bd6
1 changed files with 5 additions and 0 deletions

View File

@ -418,6 +418,11 @@ void PX4UARTDriver::_timer_tick(void)
if (!_initialised) return;
// don't try IO on a disconnected USB port
if (strcmp(_devpath, "/dev/ttyACM0") == 0 && !hal.gpio->usb_connected()) {
return;
}
_in_timer = true;
// write any pending bytes