mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-05 13:18:52 +08:00
gps fix sign-compare
This commit is contained in:
@@ -404,10 +404,11 @@ int GPS::pollOrRead(uint8_t *buf, size_t buf_length, int timeout)
|
||||
* If more bytes are available, we'll go back to poll() again.
|
||||
*/
|
||||
#ifdef __PX4_NUTTX
|
||||
int err = 0, bytesAvailable = 0;
|
||||
int err = 0;
|
||||
int bytesAvailable = 0;
|
||||
err = ioctl(_serial_fd, FIONREAD, (unsigned long)&bytesAvailable);
|
||||
|
||||
if ((err != 0) || (bytesAvailable < buf_length)) {
|
||||
if ((err != 0) || (bytesAvailable < (int)buf_length)) {
|
||||
usleep(GPS_WAIT_BEFORE_READ * 1000);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user