HAL_SITL: allow for more data before GPS pipe flush

This commit is contained in:
Andrew Tridgell 2015-07-04 15:14:39 +10:00
parent 93800fb3a1
commit 88a90495b2

View File

@ -49,7 +49,7 @@ ssize_t SITL_State::gps_read(int fd, void *buf, size_t count)
#ifdef FIONREAD #ifdef FIONREAD
// use FIONREAD to get exact value if possible // use FIONREAD to get exact value if possible
int num_ready; int num_ready;
while (ioctl(fd, FIONREAD, &num_ready) == 0 && num_ready > 256) { while (ioctl(fd, FIONREAD, &num_ready) == 0 && num_ready > 3000) {
// the pipe is filling up - drain it // the pipe is filling up - drain it
uint8_t tmp[128]; uint8_t tmp[128];
if (read(fd, tmp, sizeof(tmp)) != sizeof(tmp)) { if (read(fd, tmp, sizeof(tmp)) != sizeof(tmp)) {