mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-03 15:58:53 +08:00
Finally fix the timing race between the IO driver, IO uploader and the on-IO firmware by making the uploader tolerant of timing offsets.
This commit is contained in:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user