AP_HAL_VRBRAIN: UARTDriver: remove commented out code
This is not working and there's no reason to keep it around.
This commit is contained in:
parent
a3140df24a
commit
d3b5089a12
@ -361,28 +361,8 @@ int VRBRAINUARTDriver::_write_fd(const uint8_t *buf, uint16_t n)
|
|||||||
|
|
||||||
if (AP_HAL::micros64() - _last_write_time > 2000 &&
|
if (AP_HAL::micros64() - _last_write_time > 2000 &&
|
||||||
_flow_control == FLOW_CONTROL_DISABLE) {
|
_flow_control == FLOW_CONTROL_DISABLE) {
|
||||||
#if 0
|
_last_write_time = AP_HAL::micros64();
|
||||||
// this trick is disabled for now, as it sometimes blocks on
|
|
||||||
// re-opening the ttyACM0 port, which would cause a crash
|
|
||||||
if (AP_HAL::micros64() - _last_write_time > 2000000) {
|
|
||||||
// we haven't done a successful write for 2 seconds - try
|
|
||||||
// reopening the port
|
|
||||||
_initialised = false;
|
|
||||||
::close(_fd);
|
|
||||||
_fd = ::open(_devpath, O_RDWR);
|
|
||||||
if (_fd == -1) {
|
|
||||||
fprintf(stdout, "Failed to reopen UART device %s - %s\n",
|
|
||||||
_devpath, strerror(errno));
|
|
||||||
// leave it uninitialised
|
|
||||||
return n;
|
|
||||||
}
|
|
||||||
|
|
||||||
_last_write_time = AP_HAL::micros64();
|
|
||||||
_initialised = true;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
_last_write_time = AP_HAL::micros64();
|
|
||||||
#endif
|
|
||||||
// we haven't done a successful write for 2ms, which means the
|
// we haven't done a successful write for 2ms, which means the
|
||||||
// port is running at less than 500 bytes/sec. Start
|
// port is running at less than 500 bytes/sec. Start
|
||||||
// discarding bytes, even if this is a blocking port. This
|
// discarding bytes, even if this is a blocking port. This
|
||||||
@ -480,5 +460,4 @@ void VRBRAINUARTDriver::_timer_tick(void)
|
|||||||
_in_timer = false;
|
_in_timer = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // CONFIG_HAL_BOARD
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user