Author: Paul_R
Date: 2008-09-16 12:03:33 +0200 (Tue, 16 Sep 2008)
New Revision: 1850

Modified:
   firmware/fuxusb/trunk/fuxusb.Opt
   firmware/fuxusb/trunk/src/bootloader.c
   firmware/fuxusb/trunk/src/bootloader.h
   firmware/fuxusb/trunk/src/usb_commands.c
   firmware/fuxusb/trunk/src/usb_commands.h
Log:
* Compatibility :
  New versions of tuxup will send the code 0x03 instead of 0x02 to enter the
  bootloader mode.
  The changes are done to keep the compatibility between the old and new tuxup
  version. 

  - The new version of tuxup will wait for the Boot_init ACK, which is used for
    the synchronisation.
  - Send 64 bytes instead of 5 (libusb version) for the ACK.

  This version should be fully compatible with old releases of tuxup, even if 
the
  dongle has been compiled for the libusb.


Modified: firmware/fuxusb/trunk/fuxusb.Opt
===================================================================
(Binary files differ)

Modified: firmware/fuxusb/trunk/src/bootloader.c
===================================================================
--- firmware/fuxusb/trunk/src/bootloader.c      2008-09-16 10:00:01 UTC (rev 
1849)
+++ firmware/fuxusb/trunk/src/bootloader.c      2008-09-16 10:03:33 UTC (rev 
1850)
@@ -38,6 +38,7 @@
 static uint8_t counter = 0;
 /* Externs defs */
 bit i2c_bootloading_Flag;
+bit oldBootloaderFlag;
 
 /* Statics defs */
 /** This flag indicate if the bootloader is activated or not.
@@ -230,10 +231,10 @@
 
     EX0 = 0; /* Disable INT0 interrupt */
 
-
-#ifdef HID_DEVICE
-    bl_acknowledge(True, BOOT_INIT_ACK, 0, 0);
-#endif
+    if (!oldBootloaderFlag)
+    {
+        bl_acknowledge(True, BOOT_INIT_ACK, 0, 0);
+    }
 }
 
 /**

Modified: firmware/fuxusb/trunk/src/bootloader.h
===================================================================
--- firmware/fuxusb/trunk/src/bootloader.h      2008-09-16 10:00:01 UTC (rev 
1849)
+++ firmware/fuxusb/trunk/src/bootloader.h      2008-09-16 10:03:33 UTC (rev 
1850)
@@ -56,6 +56,7 @@
 
 /* Variables */
 extern bit i2c_bootloading_Flag;
+extern bit oldBootloaderFlag;
 extern blHeader_t blHeader;
 
 /* Functions */

Modified: firmware/fuxusb/trunk/src/usb_commands.c
===================================================================
--- firmware/fuxusb/trunk/src/usb_commands.c    2008-09-16 10:00:01 UTC (rev 
1849)
+++ firmware/fuxusb/trunk/src/usb_commands.c    2008-09-16 10:03:33 UTC (rev 
1850)
@@ -82,7 +82,13 @@
             break;
 
         /* Bootloader commands */
+        case OLD_BOOTLOADER_CMD_HDR:
+            oldBootloaderFlag = True;
+            bootloader_cmd_parser();
+            break;
+
         case BOOTLOADER_CMD_HDR:
+            oldBootloaderFlag = False;
             bootloader_cmd_parser();
             break;
         }
@@ -146,9 +152,6 @@
  */
 void bl_acknowledge(uint8_t ack, uint8_t p1, uint8_t p2, uint8_t p3)
 {
-#ifdef HID_DEVICE
-       uint8_t i;
-#endif
     Usb_select_ep(EP_CMD_IN);
 
     Usb_write_byte(BOOTLOADER_CMD);
@@ -157,12 +160,14 @@
     Usb_write_byte(p2);
     Usb_write_byte(p3);
 
-#ifdef HID_DEVICE
-       for (i = 0; i < 59; i ++)
-       {
-               Usb_write_byte(0);
-       }
-#endif
+    if (!oldBootloaderFlag)
+    {
+        uint8_t i;
+       for (i = 0; i < 59; i ++)
+       {
+               Usb_write_byte(0);
+       }
+    }
 
     CMD_IN_Bank_Nb ++;
 

Modified: firmware/fuxusb/trunk/src/usb_commands.h
===================================================================
--- firmware/fuxusb/trunk/src/usb_commands.h    2008-09-16 10:00:01 UTC (rev 
1849)
+++ firmware/fuxusb/trunk/src/usb_commands.h    2008-09-16 10:03:33 UTC (rev 
1850)
@@ -33,8 +33,10 @@
 #define TUX_CMD_HDR 0
 /** Commands for the dongle */
 #define DONGLE_CMD_HDR 1
-/** Commands for the bootloader */
-#define BOOTLOADER_CMD_HDR 2
+/** Commands for the bootloader - For tuxup version less than 0.5.0 */
+#define OLD_BOOTLOADER_CMD_HDR 2
+/** Commands for the bootloader - For tuxup version 0.5.0 or higher */
+#define BOOTLOADER_CMD_HDR 3
 /* @} */
 
 /** \name Commands sub-type


-------------------------------------------------------------------------
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