Browse Source

Finally fix the timing race between the IO driver, IO uploader and the on-IO firmware by making the uploader tolerant of timing offsets.

sbg
Lorenz Meier 11 years ago
parent
commit
73a483c265
  1. 11
      src/drivers/px4io/px4io_uploader.cpp

11
src/drivers/px4io/px4io_uploader.cpp

@ -121,8 +121,15 @@ PX4IO_Uploader::upload(const char *filenames[]) @@ -121,8 +121,15 @@ PX4IO_Uploader::upload(const char *filenames[])
cfsetspeed(&t, 115200);
tcsetattr(_io_fd, TCSANOW, &t);
/* look for the bootloader */
ret = sync();
/* look for the bootloader for 150 ms */
for (int i = 0; i < 15; i++) {
ret = sync();
if (ret == OK) {
break;
} else {
usleep(10000);
}
}
if (ret != OK) {
/* this is immediately fatal */

Loading…
Cancel
Save