Browse Source

AP_HAL_PX4: fix resetting TX buffer

We can't give the TX buffer 16 bytes more since next time begin() is
called it will compare the buffer size to the value the caller is trying
to set.  In this case we would free and alloc the buffer again each time
begin was called.
master
Lucas De Marchi 8 years ago committed by Andrew Tridgell
parent
commit
4346f1dd83
  1. 2
      libraries/AP_HAL_PX4/UARTDriver.cpp

2
libraries/AP_HAL_PX4/UARTDriver.cpp

@ -90,7 +90,7 @@ void PX4UARTDriver::begin(uint32_t b, uint16_t rxS, uint16_t txS) @@ -90,7 +90,7 @@ void PX4UARTDriver::begin(uint32_t b, uint16_t rxS, uint16_t txS)
while (_in_timer) {
hal.scheduler->delay(1);
}
_writebuf.set_size(txS+16);
_writebuf.set_size(txS);
}
if (_fd == -1) {

Loading…
Cancel
Save