Author: Paul_R
Date: 2008-08-25 16:28:55 +0200 (Mon, 25 Aug 2008)
New Revision: 1580

Modified:
   firmware/tuxup/trunk/bootloader.c
   firmware/tuxup/trunk/main.c
Log:
* Now, read the BOOT_INIT ACK when the dongle is a Libusb version.
* Removed the dongle reset. I've changed the USB firmware to restart properly
  the radio after the bootloading sequence.


Modified: firmware/tuxup/trunk/bootloader.c
===================================================================
--- firmware/tuxup/trunk/bootloader.c   2008-08-25 14:23:29 UTC (rev 1579)
+++ firmware/tuxup/trunk/bootloader.c   2008-08-25 14:28:55 UTC (rev 1580)
@@ -716,7 +716,7 @@
 #endif
 {
     int rc = FALSE;
-    unsigned char data_buffer[5];
+    unsigned char data_buffer[64];
     uint8_t page_size = 64;   /* XXX Should depend on CPU type */
     uint8_t packet_total = 2; /* XXX should depend on CPU type */
     int ret;
@@ -754,7 +754,10 @@
 #ifndef WIN32
     else
     { 
+        /* Send the command to active the bootloader */
         ret = usb_send_commands(dev_h, data_buffer, 5);
+        /* ... and read the status to be ure that it's correctly initialized */
+        ret = usb_get_commands(dev_h, data_buffer, 5);
     }
 #endif
 #ifdef WIN32
@@ -778,8 +781,11 @@
 #if (PRINT_DATA)
         printf("Boot init status: %x\n", ret);
 #endif
-        if (ret != 5)
-            return FALSE;           /* initialization failed */
+        if ((ret != 5) && data_buffer[2] != BOOT_INIT_ACK)
+        {
+            fprintf(stderr, "\nInitialization failed\n");
+            return FALSE;
+        }
     }
 #endif
 

Modified: firmware/tuxup/trunk/main.c
===================================================================
--- firmware/tuxup/trunk/main.c 2008-08-25 14:23:29 UTC (rev 1579)
+++ firmware/tuxup/trunk/main.c 2008-08-25 14:28:55 UTC (rev 1580)
@@ -726,17 +726,6 @@
 
     if (!pretend)
     {
-        uint8_t send_data[5] = { 0x01, 0x01, 0x00, 0x00, 0xFE };
-        if (HID)
-        {
-            tux_hid_write(5, send_data);
-        }
-#ifndef WIN32
-        else
-        {
-            ret = usb_send_commands(dev_h, send_data, 5);
-        }
-#endif
         fux_disconnect();
     }
 


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to