AP_Mount_Alexmos : take into account available negative numbers

uartdriver->available () function brings back a signed int, we should be carefull to avoid an endless loop if that happens.
This commit is contained in:
Matthias Badaire 2015-01-19 10:12:41 +01:00 committed by Andrew Tridgell
parent 8ea65c2dc2
commit 5f432eaa2d

View File

@ -220,6 +220,11 @@ void AP_Mount_Alexmos::read_incoming()
int16_t numc;
numc = _port->available();
if (numc < 0 ){
return;
}
for (int16_t i = 0; i < numc; i++) { // Process bytes received
data = _port->read();
switch (_step) {