[tuxdroid-svn] r1108 - firmware/tuxdefs
Status: Beta
Brought to you by:
ks156
From: jaguarondi <c2m...@c2...> - 2008-05-06 09:17:58
|
Author: jaguarondi Date: 2008-05-06 11:18:01 +0200 (Tue, 06 May 2008) New Revision: 1108 Modified: firmware/tuxdefs/commands.h Log: * Added a global error command that will be used to report firmware errors to the computer. This will be used in the "assert" way, for conditions that shouldn't normally happen. * Wrong bit for the STATUS_VCC_MK mask. * Comment update. Modified: firmware/tuxdefs/commands.h =================================================================== --- firmware/tuxdefs/commands.h 2008-05-06 06:58:50 UTC (rev 1107) +++ firmware/tuxdefs/commands.h 2008-05-06 09:18:01 UTC (rev 1108) @@ -83,11 +83,11 @@ #define LED_ON_CMD 0x1A /* Turn all LEDs on */ #define LED_OFF_CMD 0x1B /* Turn all LEDs off */ -#define LED_TOGGLE_CMD 0x9A /* Turn all LEDs off */ #define LED_L_ON_CMD 0x1C /* Turn left LED on */ #define LED_L_OFF_CMD 0x1D /* Turn left LED off */ #define LED_R_ON_CMD 0x1E /* Turn right LED on */ #define LED_R_OFF_CMD 0x1F /* Turn right LED off */ +#define LED_TOGGLE_CMD 0x9A /* Toggle LEDs */ /* 1st parameter: number of LED toggles */ /* 2nd parameter: delay between each LED toggle, in multiple of 4ms */ @@ -105,19 +105,12 @@ /* 1st parameter: 1 to write the sound * 0 to not write the sound*/ -#define ERASE_FLASH_CMD 0x54 /* get indexes of the flash sound bank [1] */ +#define ERASE_FLASH_CMD 0x54 /* get indexes of the flash sound bank */ -#define TEST_SOUND_CMD 0x10 /* test the audio input and output [1] */ #define MUTE_CMD 0x92 /* mute/unmute the audio amplifier */ /* 1st parameter: mute state 0:unmute 1:mute */ /* 2nd parameter: reserved */ -/* note [1]: those commands are not propagated to the core CPU but - * directly executed from the audio CPU when received from RF, so we can use a - * command with 3 parameters here. These commands can't be combined with other - * commands in the buffer sent by the computer on the USB port otherwise the - * other commands will be lost. */ - /* * Sleep commands */ @@ -187,7 +180,7 @@ #define STATUS_HEADBTN_MK 0x08 #define STATUS_CHARGER_MK 0x10 #define STATUS_RF_MK 0x20 -#define STATUS_VCC_MK 0x20 +#define STATUS_VCC_MK 0x40 #define STATUS_MUTE_MK 0x80 /* 2nd parameter: sound played from the flash * 3rd parameter: audio activity @@ -214,7 +207,7 @@ /* send position counters which is related to the motor status */ #define STATUS_POSITION2_CMD 0xC4 /* 1st parameter: spin position counter */ -/* 2nd parameter: */ +/* 2nd parameter: flippers position */ /* 3rd parameter: */ #define STATUS_IR_CMD 0xC5 @@ -246,11 +239,21 @@ /* * Special commands */ -#define ERROR_CMD 0xF9 +/** Global error command */ +#define GERROR_CMD 0xF9 /* 1st parameter: CPU number */ -/* 2nd parameter: error number */ -/* 3rd parameter: depends on the error number */ -#define ERROR_BUF_FULL 0x01 +/* 2nd parameter: error type */ +/* 3rd parameter: optional parameter */ +enum gerrors +{ + GERROR_NONE = 0, + GERROR_CMDINBUF_OVF, + GERROR_CMDINBUF_EMPTY, + GERROR_CMDOUTBUF_FULL, + GERROR_INV_RECEIVE_LENGTH, + CMDGERROR_OUTBUF_OVF, +}; + #define FEEDBACK_CMD 0xF8 /* 3 paramters sent back depending on the last command sent to tux which is * supposed to send feedback */ |