[tuxdroid-svn] r1234 - firmware/fuxusb/trunk/src
Status: Beta
Brought to you by:
ks156
From: Paul_R <c2m...@c2...> - 2008-06-16 10:27:09
|
Author: Paul_R Date: 2008-06-16 12:27:10 +0200 (Mon, 16 Jun 2008) New Revision: 1234 Modified: firmware/fuxusb/trunk/src/usb_commands.c firmware/fuxusb/trunk/src/usb_commands.h Log: * Added a parser for the ID, sleep and wifi functions. The functions aren't implemented yet. * Changed the way to enter on USB bootloader mode. When the BLJB fuse is activated, we need to have a command to reset it. The dongle can be blocked on bootloader mode, else, the dongle is blocked on the bootloader mode. I've changed the command to activate the bootloader without setting the BLJB fuse. Now, even if the process fail, the bootloader is exited when the dongle is plugged. Modified: firmware/fuxusb/trunk/src/usb_commands.c =================================================================== --- firmware/fuxusb/trunk/src/usb_commands.c 2008-06-13 15:06:44 UTC (rev 1233) +++ firmware/fuxusb/trunk/src/usb_commands.c 2008-06-16 10:27:10 UTC (rev 1234) @@ -32,8 +32,8 @@ #include "bootloader.h" #include "fifo_stt.h" #include "rf.h" -#include "lib_mcu\fa-usb\flash_api.h" -#include "lib_mcu\usb\usb_drv.h" +#include "lib_mcu/fa-usb/flash_api.h" +#include "lib_mcu/usb/usb_drv.h" /* Statics defs */ static void dongle_cmd_parser(void); @@ -163,11 +163,40 @@ * This function parse the commands for dongle. */ static void dongle_cmd_parser(void) -{ - if (command_received[0] == DONGLE_CMD) +{ + /* Communication commands (0x00) */ + if (command_received[0] == COMMUNICATION_CMD) { + switch (command_received[1]) + { + case DISCONNECT_TUX: + break; + + case CONNECT_TUX: + break; + + case REQUEST_USB_ID: + break; + + case REQUEST_RF_ID: + break; + + case SET_ID: + break; + + case WAKE_UP: + break; + + case SET_CHANNEL_RANGE: + break; + } + } + /* Dongle commands (0x01) */ + else if (command_received[0] == DONGLE_CMD) + { // XXX I don't know if bytes 1 and 2 will be used in the future. // ATM, they're not used, so I don't test them. + // Maybe tuxdriver must be changed to put the command on byte 1. /* Maintenance commands */ switch (command_received[3]) { @@ -188,7 +217,7 @@ break; } } - /* TTS commands */ + /* TTS commands (0x02) */ else if (command_received[0] == TTS_CMD) { switch (command_received[1]) @@ -202,7 +231,7 @@ break; } } - /* Dongle version command */ + /* Dongle version command (0x06) */ else if (command_received[0] == INFO_FUXUSB_CMD) { FIFO_STT_flush(); @@ -266,7 +295,8 @@ * bootloader mode. */ rf_reset_signal = 0; - __api_clr_BLJB(); + + __api_wr_EB(1); __api_wr_SBV (0xF4); reattach_usb(); Modified: firmware/fuxusb/trunk/src/usb_commands.h =================================================================== --- firmware/fuxusb/trunk/src/usb_commands.h 2008-06-13 15:06:44 UTC (rev 1233) +++ firmware/fuxusb/trunk/src/usb_commands.h 2008-06-16 10:27:10 UTC (rev 1234) @@ -41,6 +41,8 @@ * @{ */ /** \name Commands sub-types for the dongle * @{ */ +/** Wifi, ID, Sleep */ +#define COMMUNICATION_CMD 0 /** Maintenance */ #define DONGLE_CMD 1 /** Audio */ @@ -50,6 +52,24 @@ /** \name Maintenance commands sub-type * @{ */ +/** Disconnect */ +#define DISCONNECT_TUX 1 +/** Connect */ +#define CONNECT_TUX 2 +/** Dongle ID request */ +#define REQUEST_USB_ID 3 +/** RF ID request */ +#define REQUEST_RF_ID 4 +/** Set ID */ +#define SET_ID 5 +/** Wakeup */ +#define WAKE_UP 6 +/** Change channel range */ +#define SET_CHANNEL_RANGE 7 +/* @} */ + +/** \name Misc commands sub-type + * @{ */ /** New status request */ #define STATUS_REQUEST 0x00 /** RF reset request */ |