[tuxdroid-svn] r391 - firmware/tuxup/trunk
Status: Beta
Brought to you by:
ks156
From: neimad <c2m...@c2...> - 2007-06-17 11:36:11
|
Author: neimad Date: 2007-06-17 13:36:07 +0200 (Sun, 17 Jun 2007) New Revision: 391 Modified: firmware/tuxup/trunk/main.c Log: * Simplified the Tux detection loop. Modified: firmware/tuxup/trunk/main.c =================================================================== --- firmware/tuxup/trunk/main.c 2007-06-17 11:26:12 UTC (rev 390) +++ firmware/tuxup/trunk/main.c 2007-06-17 11:36:07 UTC (rev 391) @@ -109,33 +109,31 @@ for (;;) { device = usb_find_tux(); - if (device == NULL) - { - if (!wait) - { - fprintf(stderr, "The dongle was not found, now exiting.\n"); - exit(1); - } - } - else - { - if (verbose) - printf("The dongle was found.\n"); - /* Check if we have the old firmware that requires entering - * bootloader mode manually, exits with a message that exlains what - * to do in such a case. */ - if (device->descriptor.bcdDevice < 0x100) - { - fprintf(stderr, msg_old_firmware); - exit(1); - } + if (device != NULL || wait == 0) break; - } sleep(1); wait--; } + if (device == NULL) + { + fprintf(stderr, "The dongle was not found, now exiting.\n"); + exit(1); + } + + if (verbose) + printf("The dongle was found.\n"); + + /* Check if we have the old firmware that requires entering + * bootloader mode manually, exits with a message that exlains what + * to do in such a case. */ + if (device->descriptor.bcdDevice < 0x100) + { + fprintf(stderr, msg_old_firmware); + exit(1); + } + /* open USB device */ if ((dev_h = usb_open_tux(device)) == NULL) { |