Browse Source

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.
sbg
Jean Cyr 11 years ago
parent
commit
3a4da7c5fa
  1. 3
      src/drivers/px4io/px4io_uploader.cpp

3
src/drivers/px4io/px4io_uploader.cpp

@ -274,12 +274,11 @@ int @@ -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;
}

Loading…
Cancel
Save