PX4: use a minimum transmit buffer for UARTs of 512 bytes

this avoids writes stalling on the GPS port. We can't afford this
memory on APM2, but we can on PX4, and it means that while the GPS is
blocking at startup it doesn't cause any scheduler slips
This commit is contained in:
Andrew Tridgell 2013-08-06 12:10:44 +10:00
parent 2e75dd50be
commit 2340bb6220
1 changed files with 5 additions and 2 deletions

View File

@ -62,8 +62,11 @@ void PX4UARTDriver::begin(uint32_t b, uint16_t rxS, uint16_t txS)
if (rxS == 0) {
rxS = 128;
}
if (txS == 0) {
txS = 128;
// on PX4 we have enough memory to have a larger transmit
// buffer for all ports. This means we don't get delays while
// waiting to write GPS config packets
if (txS < 512) {
txS = 512;
}
}