From b42577bb72fb82ac5429034329652189ca94bf4c Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Sat, 11 Jun 2011 14:26:52 -0300 Subject: [PATCH] atusb/fw/boot.c: adjusted the delay loop and don't race with dfu-util - boot.c (MS_TO_LOOPS): increased loop count now that we no longer have to poll - boot.c (main): increased delay from 2.0 s to 2.5 s, because we were racing with a sleep(2) in dfu-util --- atusb/fw/boot.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/atusb/fw/boot.c b/atusb/fw/boot.c index 6b81524..6826ac6 100644 --- a/atusb/fw/boot.c +++ b/atusb/fw/boot.c @@ -28,7 +28,7 @@ #include "atusb/ep0.h" -#define MS_TO_LOOPS(ms) ((uint32_t) (ms)*81) +#define MS_TO_LOOPS(ms) ((uint32_t) (ms)*335) static void (*run_payload)(void) = 0; @@ -59,7 +59,7 @@ int main(void) led(1); - while (loop != MS_TO_LOOPS(2000)) { + while (loop != MS_TO_LOOPS(2500)) { if (dfu.state == dfuIDLE && pgm_read_byte(zero) != 0xff) loop++; else