mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-24 07:09:48 +08:00
Revert to original loop
Original loop was correct, and slightly more efficient. Retain initialization of ret to handle the case where passed in count is 0.
This commit is contained in:
@@ -274,12 +274,11 @@ int
|
||||
PX4IO_Uploader::recv_bytes(uint8_t *p, unsigned count)
|
||||
{
|
||||
int ret = OK;
|
||||
while (count) {
|
||||
while (count--) {
|
||||
ret = recv_byte_with_timeout(p++, 5000);
|
||||
|
||||
if (ret != OK)
|
||||
break;
|
||||
count--;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user