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. 9
      src/drivers/px4io/px4io_uploader.cpp

9
src/drivers/px4io/px4io_uploader.cpp

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

Loading…
Cancel
Save