px4io: improved reliability of forceupdate re-starting px4io

this adds a 0.1s delay after update to give px4io time to boot. It
removes the need for the user to reboot after an IO update
This commit is contained in:
Andrew Tridgell 2014-01-24 11:06:33 +11:00 committed by Lorenz Meier
parent 4524fe3e48
commit d8c1131f1e
1 changed files with 6 additions and 0 deletions

View File

@ -51,6 +51,7 @@
#include <poll.h>
#include <termios.h>
#include <sys/stat.h>
#include <nuttx/arch.h>
#include <crc32.h>
@ -226,6 +227,11 @@ PX4IO_Uploader::upload(const char *filenames[])
close(_fw_fd);
close(_io_fd);
_io_fd = -1;
// sleep for enough time for the IO chip to boot. This makes
// forceupdate more reliably startup IO again after update
up_udelay(100*1000);
return ret;
}