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:
parent
8ea65c2dc2
commit
5f432eaa2d
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user