tux-droid-svn Mailing List for Tux Droid CE (Page 189)
Status: Beta
Brought to you by:
ks156
You can subscribe to this list here.
2007 |
Jan
|
Feb
(32) |
Mar
(108) |
Apr
(71) |
May
(38) |
Jun
(128) |
Jul
(1) |
Aug
(14) |
Sep
(77) |
Oct
(104) |
Nov
(90) |
Dec
(71) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(81) |
Feb
(18) |
Mar
(40) |
Apr
(102) |
May
(151) |
Jun
(74) |
Jul
(151) |
Aug
(257) |
Sep
(447) |
Oct
(379) |
Nov
(404) |
Dec
(430) |
2009 |
Jan
(173) |
Feb
(236) |
Mar
(519) |
Apr
(300) |
May
(112) |
Jun
(232) |
Jul
(314) |
Aug
(58) |
Sep
(203) |
Oct
(293) |
Nov
(26) |
Dec
(109) |
2010 |
Jan
(19) |
Feb
(25) |
Mar
(33) |
Apr
(1) |
May
|
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: remi <c2m...@c2...> - 2008-07-03 12:29:41
|
Author: remi Date: 2008-07-03 14:29:50 +0200 (Thu, 03 Jul 2008) New Revision: 1307 Modified: software_suite_v2/middleware/tuxdriver/trunk/src/version.h Log: * added the revision keyword from svn to version.h Modified: software_suite_v2/middleware/tuxdriver/trunk/src/version.h =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/version.h 2008-07-03 12:27:28 UTC (rev 1306) +++ software_suite_v2/middleware/tuxdriver/trunk/src/version.h 2008-07-03 12:29:50 UTC (rev 1307) @@ -26,6 +26,7 @@ #define VER_MINOR 0 #define VER_UPDATE 1 #define VER_BUILD 11 +#define VER_REVISION "$Rev:: $" #define VER_STATE "BETA" #ifdef WIN32 # define VER_ARCH "WIN32" |
From: remi <c2m...@c2...> - 2008-07-03 12:27:24
|
Author: remi Date: 2008-07-03 14:27:28 +0200 (Thu, 03 Jul 2008) New Revision: 1306 Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_sw_status.c software_suite_v2/middleware/tuxdriver/trunk/src/version.h Log: * added svn:keywords on version.h * updated status setters functions. Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_sw_status.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_sw_status.c 2008-07-03 08:25:45 UTC (rev 1305) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_sw_status.c 2008-07-03 12:27:28 UTC (rev 1306) @@ -212,13 +212,13 @@ LIBLOCAL void tux_sw_status_init(void) { - char driver_symbolic_version[128] = ""; + static char driver_symbolic_version[128] = ""; #ifdef USE_MUTEX mutex_init(__status_mutex); #endif - sprintf(driver_symbolic_version, "Tux_driver_%d.%d.%d - b%.3d (%s) (%s)", + sprintf(driver_symbolic_version, "libtuxdriver-%d.%d.%d-b%.3d(%s)(%s)", VER_MAJOR, VER_MINOR, VER_UPDATE, @@ -444,12 +444,28 @@ { if (delta >= sw_status_table[id].event_threshold) { +#ifdef USE_MUTEX + mutex_lock(__status_mutex); +#endif sw_status_table[id].intvalue = value; +#ifdef USE_MUTEX + mutex_unlock(__status_mutex); +#endif tux_sw_status_get_state_str(id, state_str); event_funct(state_str); } } } + else + { +#ifdef USE_MUTEX + mutex_lock(__status_mutex); +#endif + sw_status_table[id].intvalue = value; +#ifdef USE_MUTEX + mutex_unlock(__status_mutex); +#endif + } #ifdef USE_MUTEX mutex_lock(__status_mutex); @@ -491,12 +507,28 @@ { if ((1000*delta) >= sw_status_table[id].event_threshold) { +#ifdef USE_MUTEX + mutex_lock(__status_mutex); +#endif sw_status_table[id].floatvalue = value; +#ifdef USE_MUTEX + mutex_unlock(__status_mutex); +#endif tux_sw_status_get_state_str(id, state_str); event_funct(state_str); } } } + else + { +#ifdef USE_MUTEX + mutex_lock(__status_mutex); +#endif + sw_status_table[id].floatvalue = value; +#ifdef USE_MUTEX + mutex_unlock(__status_mutex); +#endif + } #ifdef USE_MUTEX mutex_lock(__status_mutex); @@ -538,12 +570,28 @@ if (sw_status_table[id].event_threshold && (value != sw_status_table[id].strvalue)) { +#ifdef USE_MUTEX + mutex_lock(__status_mutex); +#endif sw_status_table[id].strvalue = value; +#ifdef USE_MUTEX + mutex_unlock(__status_mutex); +#endif tux_sw_status_get_state_str(id, state_str); event_funct(state_str); } } } + else + { +#ifdef USE_MUTEX + mutex_lock(__status_mutex); +#endif + sw_status_table[id].strvalue = value; +#ifdef USE_MUTEX + mutex_unlock(__status_mutex); +#endif + } #ifdef USE_MUTEX mutex_lock(__status_mutex); Modified: software_suite_v2/middleware/tuxdriver/trunk/src/version.h =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/version.h 2008-07-03 08:25:45 UTC (rev 1305) +++ software_suite_v2/middleware/tuxdriver/trunk/src/version.h 2008-07-03 12:27:28 UTC (rev 1306) @@ -17,6 +17,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA. */ + /* SVN : $Id$ */ #ifndef _VERSION_H_ #define _VERSION_H_ @@ -24,7 +25,7 @@ #define VER_MAJOR 0 #define VER_MINOR 0 #define VER_UPDATE 1 -#define VER_BUILD 10 +#define VER_BUILD 11 #define VER_STATE "BETA" #ifdef WIN32 # define VER_ARCH "WIN32" Property changes on: software_suite_v2/middleware/tuxdriver/trunk/src/version.h ___________________________________________________________________ Name: svn:keywords + Revision Date Id |
From: Paul_R <c2m...@c2...> - 2008-07-03 09:30:25
|
Author: Paul_R Date: 2008-07-03 10:25:45 +0200 (Thu, 03 Jul 2008) New Revision: 1305 Modified: software/tuxgi/trunk/tuxgi.py Log: * Changed the port according with the changes of the server. Modified: software/tuxgi/trunk/tuxgi.py =================================================================== --- software/tuxgi/trunk/tuxgi.py 2008-07-02 15:08:50 UTC (rev 1304) +++ software/tuxgi/trunk/tuxgi.py 2008-07-03 08:25:45 UTC (rev 1305) @@ -87,7 +87,7 @@ sys.stderr.write("Warning: couldn't find any suitable terminal" " to use as Tux Droid shell\n") # Create a tux api object -tux = TuxAPI("127.0.0.1", 81) +tux = TuxAPI("127.0.0.1", 270) # Set the auto connection tux.server.autoConnect(CLIENT_LEVEL_RESTRICTED, "Tuxgi", "Passwd") |
From: jaguarondi <c2m...@c2...> - 2008-07-02 15:08:55
|
Author: jaguarondi Date: 2008-07-02 17:08:50 +0200 (Wed, 02 Jul 2008) New Revision: 1304 Modified: firmware/tuxaudio/trunk/PC_communication.c firmware/tuxaudio/trunk/communication.c firmware/tuxaudio/trunk/i2c.c firmware/tuxaudio/trunk/i2c.h firmware/tuxaudio/trunk/main.c firmware/tuxaudio/trunk/parser.c firmware/tuxaudio/trunk/parser.h firmware/tuxaudio/trunk/varis.c firmware/tuxaudio/trunk/varis.h Log: * Replaced the (commented) audio adaptation with a much simpler scheme. * Split the command parsing from the I2C interrupt. * Some cleanup. Modified: firmware/tuxaudio/trunk/PC_communication.c =================================================================== --- firmware/tuxaudio/trunk/PC_communication.c 2008-07-02 14:03:43 UTC (rev 1303) +++ firmware/tuxaudio/trunk/PC_communication.c 2008-07-02 15:08:50 UTC (rev 1304) @@ -29,6 +29,8 @@ #include "spi.h" #include "hardware.h" +void adapt_audio_rate(void); + void spiTransaction(void) { if (spi_start) // Wait start @@ -129,98 +131,7 @@ } spi_master = PUT_SOUND_FIFO; // Go to the next state - - if (!programmingFlash && !flashPlay) // XXX code must be review it's very strange ..... - { - if (!(spi_master_config & 0x02)) - { - if (!lockAdaptFifo) - { - //adaptFifo(PWMFifo); // Adaptative FIFO -#if 0 -/** \brief 3 levels adaptative function. - * \param p fifo pointer - * - * High and low thresholds are used to differentiate 3 levels of the buffer. In - * each level, a custom code or a function call can be provided to do the - * adaptation. - */ -void adaptFifo(fifo_t * p) -{ - unsigned char fifoLevel; - - fifoLevel = fifoLength(p); - if (!p->adpt_cycle) - { - if (p->matched == 8) - { - if (OCR0A < 254) - p->pwm_max = OCR0A + 2; - else - p->pwm_max = 255; - if (OCR0A > 231) - p->pwm_min = OCR0A - 2; - else - p->pwm_min = 230; - p->matched = 9; - } - - if (fifoLevel >= FIFO_ADAPT_HIGH) - { - if (OCR0A > p->pwm_min) - { - OCR0A--; - p->pwm_adpt_sens = 1; - } - } - else if (fifoLevel < FIFO_ADAPT_LOW) - { - if (OCR0A < p->pwm_max) - { - OCR0A++; - p->pwm_adpt_sens = 2; - } - } - else - { - if (p->pwm_adpt_sens) - { - if ((p->pwm_adpt_sens) == 1) - { - if (OCR0A < p->pwm_max) - OCR0A++; } - else - { - if (OCR0A > p->pwm_min) - OCR0A--; - } - p->pwm_adpt_sens = 0; - p->matched = 0; - } - else - { - if (p->matched != 9) - p->matched++; - } - } - } - p->adpt_cycle++; - p->adpt_cycle &= (FIFO_ADAPT_RATE << 1) - 1; -} -#endif - lockAdaptFifo = 1; - } - else - FifoClear(PWMFifo); - } - else - { - lockAdaptFifo = 0; - } - } - - } else if (spi_master == PUT_SOUND_FIFO) { if (spi_master_config & 0x02) @@ -229,7 +140,11 @@ FifoPut(PWMFifo, SPDR); // Put into the FIFO } if (spi_count == (spi_lenght_data + 1)) + { spi_master = READ_COMMAND; // Go to the next state + if (spi_master_config & 0x02) + adapt_audio_rate(); + } } else if (spi_master == READ_COMMAND) @@ -259,3 +174,28 @@ } } +/** + * \brief Adapt the audio output rate to keep the stack at a mean level. + * Called only once when all 17 bytes have been received. All is here, nothing + * else is necessary. + */ +void adapt_audio_rate(void) +{ + static uint8_t prescaler = 0; + uint8_t static prev_stack_length = 0; + uint8_t stack_length = FifoLength(PWMFifo); + uint8_t slope; + + if (++prescaler == 0) + { + /* Determine if the stack is growing or decreasing. */ + slope = (stack_length >= prev_stack_length); + prev_stack_length = stack_length; + + /* Adaptation */ + if (slope && stack_length > 40 && OCR0A > 240) + OCR0A--; + if (!slope && stack_length < 80 && OCR0A < 254) + OCR0A++; + } +} Modified: firmware/tuxaudio/trunk/communication.c =================================================================== --- firmware/tuxaudio/trunk/communication.c 2008-07-02 14:03:43 UTC (rev 1303) +++ firmware/tuxaudio/trunk/communication.c 2008-07-02 15:08:50 UTC (rev 1304) @@ -34,6 +34,8 @@ /* I2C read message (in) */ static uint8_t in_buf[CMD_SIZE]; static struct i2c_msg msg_in = {0, 0, in_buf}; +/* I2C last received command */ +static uint8_t *received_cmd = 0; /** Size of the stack buffer to tuxcore */ #define CORE_OUT_BUF_SIZE 16 @@ -176,32 +178,21 @@ * \param msg I2C message received * \return 0 if a stop should be sent, 1 for a restart. */ -bool i2c_master_receive_service(struct i2c_msg *msg) +void i2c_master_receive_service(struct i2c_msg *msg) { if (msg->len != CMD_SIZE) /* Error here. */ - return 0; + return; if (*(msg->buf) == 0) { /* Got nothing so stop reading. */ - return 0; + return; } if (msg->addr == TUXCORE_ADDR) /* From tuxcore */ { - /* New pointer necessary as parse_cmd modifies the pointer. */ - uint8_t *cmd = msg->buf; - /* Parse the command */ - parse_cmd(cmd); - /* and forward if it isn't dropped. */ - if (cmd) - queue_rf_cmd(cmd); - /* As we got something, there's maybe more so if the stack is not full, - * continue */ - if (FifoLength(rf_cmdout_buf) <= RF_OUT_BUF_SIZE - CMD_SIZE) - return 1; + received_cmd = msg->buf; } - return 0; } /* @@ -251,6 +242,14 @@ return; } + /* Parse the received command and forward if it isn't dropped. */ + if (received_cmd) + { + if (!parse_cmd(received_cmd)) + queue_rf_cmd(received_cmd); + received_cmd = 0; + } + /* Send otherwise get commands. */ if (!send_core_cmds()) { Modified: firmware/tuxaudio/trunk/i2c.c =================================================================== --- firmware/tuxaudio/trunk/i2c.c 2008-07-02 14:03:43 UTC (rev 1303) +++ firmware/tuxaudio/trunk/i2c.c 2008-07-02 15:08:50 UTC (rev 1304) @@ -84,7 +84,7 @@ /* function pointer to i2c receive routine */ /* I2cSlaveReceive is called when this processor is addressed as a slave for * writing */ -static bool (*i2c_master_receive) (struct i2c_msg *msg); +static void (*i2c_master_receive) (struct i2c_msg *msg); /* I2cSlaveTransmit is called when this processor is addressed as a slave for * reading */ static uint8_t(*i2cSlaveTransmit) (uint8_t transmitDataLengthMax, @@ -99,7 +99,7 @@ //i2c_resume(); /* Set the user function which handles receiving (incoming) data as a slave */ -void i2c_master_receive_handler(bool (*i2cMasterRx_func) (struct i2c_msg *msg)) +void i2c_master_receive_handler(void (*i2cMasterRx_func) (struct i2c_msg *msg)) { i2c_master_receive = i2cMasterRx_func; } @@ -362,14 +362,8 @@ m_msg->state = i2c_state; if (i2c_master_receive) { - if (i2c_master_receive(m_msg)) - { - buf_idx = 0; - i2c_state = I2C_BUSY; - twi_send_start(); /* restart a read */ - } - else - twi_send_stop(); /* end of data stream */ + i2c_master_receive(m_msg); + twi_send_stop(); /* end of data stream */ } break; case TW_MT_SLA_NACK: /* 0x20 */ Modified: firmware/tuxaudio/trunk/i2c.h =================================================================== --- firmware/tuxaudio/trunk/i2c.h 2008-07-02 14:03:43 UTC (rev 1303) +++ firmware/tuxaudio/trunk/i2c.h 2008-07-02 15:08:50 UTC (rev 1304) @@ -80,7 +80,7 @@ /* Functions */ void i2cInit(void); -void i2c_master_receive_handler(bool (*i2cMasterRx_func) (struct i2c_msg *msg)); +void i2c_master_receive_handler(void (*i2cMasterRx_func) (struct i2c_msg *msg)); void i2cSetSlaveTransmitHandler(uint8_t(*i2cSlaveTx_func) (uint8_t transmitDataLengthMax, Modified: firmware/tuxaudio/trunk/main.c =================================================================== --- firmware/tuxaudio/trunk/main.c 2008-07-02 14:03:43 UTC (rev 1303) +++ firmware/tuxaudio/trunk/main.c 2008-07-02 15:08:50 UTC (rev 1304) @@ -167,10 +167,7 @@ if (commandRX) // commend RX from radio { commandRX = 0; // Reset flag - parse_cmd(spi_commandRX); - /* XXX there are some empty commands getting through, removed from - * here for now. */ - if (spi_commandRX && spi_commandRX[0]) + if (!parse_cmd(spi_commandRX)) queue_core_cmd(spi_commandRX); } @@ -286,20 +283,13 @@ if (!FifoGet(PWMFifo, (uint8_t *)&OCR0B)) /* set the sample value to timer pulse width */ { - Fifoinert = 0; if (tuxaudio_config.automute) /* XXX mute functions should not be called here each time a sample is placed, this is silly */ unmute_amp(); } else { - Fifoinert++; - if (Fifoinert >= 30) - { - if (tuxaudio_config.automute) - mute_amp(); - Fifoinert = 30; - //OCR0A = 250; // Normal operation for ADC sampling if FIFO Adaptative is on - } + if (tuxaudio_config.automute) + mute_amp(); } /* XXX we should move this timer away from here */ /* send status to the behavioural CPU, 8KHz divided by 256 lead to a Modified: firmware/tuxaudio/trunk/parser.c =================================================================== --- firmware/tuxaudio/trunk/parser.c 2008-07-02 14:03:43 UTC (rev 1303) +++ firmware/tuxaudio/trunk/parser.c 2008-07-02 15:08:50 UTC (rev 1304) @@ -32,94 +32,101 @@ /** * Parse a cmd received by the computer or by tuxcore and drop it if it * shouldn't be forwarded. + * \return True if the command has been parsed and shouldn't be forwarded, + * false if it should be forwarded. */ -void parse_cmd(uint8_t *cmd) +bool parse_cmd(uint8_t *cmd) { + /* XXX there are some empty commands getting through, removed from + * here for now. */ - /* - * Commands that should be forwarded - */ - - /* Ping */ - if (cmd[0] == PONG_CMD) + /* + * Commands that shouldn't be forwarded. + */ + /* Version */ + if (cmd[0] == NULL_CMD) { - /* Index of the pong that is supposed to be received from tuxcore */ - static uint8_t pong_received; - /* Counter of the missed pongs */ - static uint8_t pong_missed; - if (pong_received-- < cmd[1]) /* new ping, reset */ - { - pong_received = cmd[1]; - pong_missed = 0; - } - else /* pongs */ - { - pong_missed += pong_received - cmd[1]; - pong_received = cmd[1]; /* resync */ - } - cmd[2] = pong_missed; } - else if (cmd[0] == SLEEP_CMD) + else if (cmd[0] == INFO_TUXAUDIO_CMD) { - /* XXX sleep commented for now */ - /* Forwards the cmd to the rf CPU */ - /*cmd[0] = SLEEP_ACK_CMD;*/ - /*cmd[1] = 0;*/ - /*cmd[2] = 0;*/ - /*cmd[3] = 0;*/ - /*pre_sleep_delay = 30; [> handle sleep in its own function <]*/ - /*sleep_f = 1;*/ - /*statusFlag = 1;*/ + send_info(); } - else + else if (cmd[0] == PLAY_SOUND_CMD) + /* param: cmd[1] : sound number */ + /* cmd[2] : mic sound intensity */ { - /* - * Commands that shouldn't be forwarded. - */ - /* Version */ - if (cmd[0] == INFO_TUXAUDIO_CMD) + /* Drop the cmd if a sound is already playing */ + if (!(flashPlay || programmingFlash)) { - send_info(); - } - else if (cmd[0] == PLAY_SOUND_CMD) - /* param: cmd[1] : sound number */ - /* cmd[2] : mic sound intensity */ - { - /* postpone the cmd if a sound is already playing */ - if (flashPlay || programmingFlash) - return; audioLevel = cmd[2]; - //playingAudio(cmd[1]); /* start playing the sound */ soundToPlay = cmd[1]; flashPlay = 1; flash_state = 1; } - else if (cmd[0] == MUTE_CMD) + } + else if (cmd[0] == MUTE_CMD) + { + if (cmd[1]) + mute_amp(); + else + unmute_amp(); + } + else if (cmd[0] == STORE_SOUND_CMD) + { + if (flashPlay) + flashPlay = 0; + flash_state = 1; /* Erasing flash flag */ + programmingFlash = 1; /* Set the flag to enter programming sequence */ + } + else if (cmd[0] == ERASE_FLASH_CMD) + { + eraseFlag = 1; + } + else if (cmd[0] == CONFIRM_STORAGE_CMD) + { + if (cmd[1]) + write_toc = 1; + else + write_toc = 2; + } + else + { + /* + * Commands that should be forwarded + */ + + /* Ping */ + if (cmd[0] == PONG_CMD) { - if (cmd[1]) - mute_amp(); - else - unmute_amp(); + /* Index of the pong that is supposed to be received from tuxcore */ + static uint8_t pong_received; + /* Counter of the missed pongs */ + static uint8_t pong_missed; + if (pong_received-- < cmd[1]) /* new ping, reset */ + { + pong_received = cmd[1]; + pong_missed = 0; + } + else /* pongs */ + { + pong_missed += pong_received - cmd[1]; + pong_received = cmd[1]; /* resync */ + } + cmd[2] = pong_missed; } - else if (cmd[0] == STORE_SOUND_CMD) + else if (cmd[0] == SLEEP_CMD) { - if (flashPlay) - flashPlay = 0; - flash_state = 1; /* Erasing flash flag */ - programmingFlash = 1; /* Set the flag to enter programming sequence */ + /* XXX sleep commented for now */ + /* Forwards the cmd to the rf CPU */ + /*cmd[0] = SLEEP_ACK_CMD;*/ + /*cmd[1] = 0;*/ + /*cmd[2] = 0;*/ + /*cmd[3] = 0;*/ + /*pre_sleep_delay = 30; [> handle sleep in its own function <]*/ + /*sleep_f = 1;*/ + /*statusFlag = 1;*/ } - else if (cmd[0] == ERASE_FLASH_CMD) - { - eraseFlag = 1; - } - else if (cmd[0] == CONFIRM_STORAGE_CMD) - { - if (cmd[1]) - write_toc = 1; - else - write_toc = 2; - } - /* Drop the command */ - cmd = NULL; + return false; } + return true; } Modified: firmware/tuxaudio/trunk/parser.h =================================================================== --- firmware/tuxaudio/trunk/parser.h 2008-07-02 14:03:43 UTC (rev 1303) +++ firmware/tuxaudio/trunk/parser.h 2008-07-02 15:08:50 UTC (rev 1304) @@ -24,6 +24,6 @@ #include <stdbool.h> -void parse_cmd(uint8_t *cmd); +bool parse_cmd(uint8_t *cmd); #endif /* PARSER_H */ Modified: firmware/tuxaudio/trunk/varis.c =================================================================== --- firmware/tuxaudio/trunk/varis.c 2008-07-02 14:03:43 UTC (rev 1303) +++ firmware/tuxaudio/trunk/varis.c 2008-07-02 15:08:50 UTC (rev 1304) @@ -67,10 +67,6 @@ volatile unsigned char spiCommandFlasg = 0; -volatile unsigned char lockAdaptFifo = 1; - -volatile unsigned char Fifoinert = 0; - uint16_t frame_without_sound = 0; uint16_t frame_without_sound_timeout= 0; uint8_t sound_played = 0; Modified: firmware/tuxaudio/trunk/varis.h =================================================================== --- firmware/tuxaudio/trunk/varis.h 2008-07-02 14:03:43 UTC (rev 1303) +++ firmware/tuxaudio/trunk/varis.h 2008-07-02 15:08:50 UTC (rev 1304) @@ -78,9 +78,6 @@ extern volatile unsigned char spiCommandFlasg; -extern volatile unsigned char lockAdaptFifo; - -extern volatile unsigned char Fifoinert; extern uint16_t frame_without_sound; extern uint16_t frame_without_sound_timeout; extern uint8_t sound_played; |
From: remi <c2m...@c2...> - 2008-07-02 14:03:34
|
Author: remi Date: 2008-07-02 16:03:43 +0200 (Wed, 02 Jul 2008) New Revision: 1303 Added: software_suite_v2/middleware/tuxdriver/tags/0.0.1.010-beta/ Log: * Tagged the trunk to 0.0.1.010-beta Copied: software_suite_v2/middleware/tuxdriver/tags/0.0.1.010-beta (from rev 1302, software_suite_v2/middleware/tuxdriver/trunk) |
From: remi <c2m...@c2...> - 2008-07-02 14:00:55
|
Author: remi Date: 2008-07-02 16:01:04 +0200 (Wed, 02 Jul 2008) New Revision: 1302 Modified: software_suite_v2/middleware/tuxdriver/trunk/src/version.h Log: * Updated the version header file to BETA state Modified: software_suite_v2/middleware/tuxdriver/trunk/src/version.h =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/version.h 2008-07-02 13:58:21 UTC (rev 1301) +++ software_suite_v2/middleware/tuxdriver/trunk/src/version.h 2008-07-02 14:01:04 UTC (rev 1302) @@ -24,8 +24,8 @@ #define VER_MAJOR 0 #define VER_MINOR 0 #define VER_UPDATE 1 -#define VER_BUILD 7 -#define VER_STATE "APLHA" +#define VER_BUILD 10 +#define VER_STATE "BETA" #ifdef WIN32 # define VER_ARCH "WIN32" #else |
From: remi <c2m...@c2...> - 2008-07-02 13:58:15
|
Author: remi Date: 2008-07-02 15:58:21 +0200 (Wed, 02 Jul 2008) New Revision: 1301 Modified: software_suite_v2/middleware/tuxdriver/trunk/AUTHORS software_suite_v2/middleware/tuxdriver/trunk/README Log: * Updated AUTHORS and README files Modified: software_suite_v2/middleware/tuxdriver/trunk/AUTHORS =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/AUTHORS 2008-07-02 13:56:21 UTC (rev 1300) +++ software_suite_v2/middleware/tuxdriver/trunk/AUTHORS 2008-07-02 13:58:21 UTC (rev 1301) @@ -1,4 +1,4 @@ -tux_driver was written by: +libtuxdriver was written by: Remi Jocaille <rem...@c2...> Frans Meulenbroeks aka eFfeM Modified: software_suite_v2/middleware/tuxdriver/trunk/README =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/README 2008-07-02 13:56:21 UTC (rev 1300) +++ software_suite_v2/middleware/tuxdriver/trunk/README 2008-07-02 13:58:21 UTC (rev 1301) @@ -1,8 +1,8 @@ -tuxdriver-0.0.1 b007 ALPHA +tuxdriver-0.0.1 b010 BETA -tux_driver is a shared library to control the tuxdroid robot. +libtuxdriver is a shared library to control Tuxdroid. -For all information about tuxdroid, please visit: +For all information about Tuxdroid, please visit: http://www.tuxisalive.com |
From: remi <c2m...@c2...> - 2008-07-02 13:56:12
|
Author: remi Date: 2008-07-02 15:56:21 +0200 (Wed, 02 Jul 2008) New Revision: 1300 Removed: software_suite_v2/middleware/tuxdriver/trunk/test/descriptor.txt Modified: software_suite_v2/middleware/tuxdriver/trunk/test/test_macro.txt Log: * Replaced the "wings" command by the "flippers" command * Deleted a unnecessary file Deleted: software_suite_v2/middleware/tuxdriver/trunk/test/descriptor.txt =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/test/descriptor.txt 2008-07-02 13:53:28 UTC (rev 1299) +++ software_suite_v2/middleware/tuxdriver/trunk/test/descriptor.txt 2008-07-02 13:56:21 UTC (rev 1300) @@ -1,77 +0,0 @@ -Tux droid descriptor --------------------- - -- Firmwares - - Global release package : [Unofficial package] - - CPU 1 - CPU id : 0 - CPU name : Tuxcore - Version major : 0 - Version minor : 4 - Version update : 0 - Revision : 938 - Released : True - Local modification : False - Mixed revisions : False - Author id : 0 - Variation : 0 - Symbolic version : [Tuxcore_0.4.0] - - CPU 2 - CPU id : 1 - CPU name : Tuxaudio - Version major : 0 - Version minor : 4 - Version update : 0 - Revision : 764 - Released : True - Local modification : False - Mixed revisions : False - Author id : 0 - Variation : 0 - Symbolic version : [Tuxaudio_0.4.0] - - CPU 3 - CPU id : 2 - CPU name : TuxRF - Version major : 0 - Version minor : 3 - Version update : 0 - Revision : 681 - Released : True - Local modification : False - Mixed revisions : False - Author id : 0 - Variation : 0 - Symbolic version : [TuxRF_0.3.0] - - CPU 4 - CPU id : 3 - CPU name : FuxRF - Version major : 0 - Version minor : 3 - Version update : 0 - Revision : 681 - Released : True - Local modification : False - Mixed revisions : False - Author id : 0 - Variation : 0 - Symbolic version : [FuxRF_0.3.0] - - CPU 5 - CPU id : 4 - CPU name : FuxUSB - Version major : 0 - Version minor : 4 - Version update : 1 - Revision : 0 - Released : True - Local modification : False - Mixed revisions : False - Author id : 0 - Variation : 0 - Symbolic version : [FuxUSB_0.4.1] -- Sound flash - Number of sounds : 17 - Last used block : 52 - Available record time (sec) : 38 -- ID connection - - number : [0] - Modified: software_suite_v2/middleware/tuxdriver/trunk/test/test_macro.txt =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/test/test_macro.txt 2008-07-02 13:53:28 UTC (rev 1299) +++ software_suite_v2/middleware/tuxdriver/trunk/test/test_macro.txt 2008-07-02 13:56:21 UTC (rev 1300) @@ -2,7 +2,7 @@ 1.0:TUX_CMD:LED:OFF:LED_BOTH 2.0:TUX_CMD:LED:SET:LED_BOTH,1.0,GRADIENT_DELTA,3.0,30 1.0:TUX_CMD:SOUND_FLASH:PLAY:1:100 -1.0:TUX_CMD:WINGS:ON_DURING:2.0,DOWN +1.0:TUX_CMD:FLIPPERS:ON_DURING:2.0,DOWN 4.0:TUX_CMD:EYES:ON_DURING:2.0,OPEN 7.0:TUX_CMD:MOUTH:ON_DURING:2.0,CLOSE 10.0:TUX_CMD:SPINNING:LEFT_ON:1 |
From: remi <c2m...@c2...> - 2008-07-02 13:53:19
|
Author: remi Date: 2008-07-02 15:53:28 +0200 (Wed, 02 Jul 2008) New Revision: 1299 Modified: software_suite_v2/middleware/tuxdriver/trunk/doc/Notes.txt Log: * updated a notes ... Modified: software_suite_v2/middleware/tuxdriver/trunk/doc/Notes.txt =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/doc/Notes.txt 2008-07-02 13:50:23 UTC (rev 1298) +++ software_suite_v2/middleware/tuxdriver/trunk/doc/Notes.txt 2008-07-02 13:53:28 UTC (rev 1299) @@ -1,5 +1,8 @@ -Directives of compilations: +Defines: +======== + USE_MUTEX LOCK_TUX USB_DEBUG +USB_IDFRAME GENERATE_DOC \ No newline at end of file |
From: remi <c2m...@c2...> - 2008-07-02 13:50:14
|
Author: remi Date: 2008-07-02 15:50:23 +0200 (Wed, 02 Jul 2008) New Revision: 1298 Added: software_suite_v2/middleware/tuxdriver/trunk/doc/TuxSSV2-Tuxware-Libtuxdriver.odt Removed: software_suite_v2/middleware/tuxdriver/trunk/doc/TuxSSV2-Tuxware-Libtuxdriver Log: * Updated the name of the doc file of libtuxdriver (missed *.odt extention ...) Deleted: software_suite_v2/middleware/tuxdriver/trunk/doc/TuxSSV2-Tuxware-Libtuxdriver =================================================================== (Binary files differ) Copied: software_suite_v2/middleware/tuxdriver/trunk/doc/TuxSSV2-Tuxware-Libtuxdriver.odt (from rev 1297, software_suite_v2/middleware/tuxdriver/trunk/doc/TuxSSV2-Tuxware-Libtuxdriver) =================================================================== (Binary files differ) |
From: remi <c2m...@c2...> - 2008-07-02 13:49:11
|
Author: remi Date: 2008-07-02 15:49:20 +0200 (Wed, 02 Jul 2008) New Revision: 1297 Added: software_suite_v2/middleware/tuxdriver/trunk/doc/TuxSSV2-Tuxware-Libtuxdriver Removed: software_suite_v2/middleware/tuxdriver/trunk/doc/TuxSSV2-Middleware-Driver.odt Log: * Updated the name of the doc file of libtuxdriver Deleted: software_suite_v2/middleware/tuxdriver/trunk/doc/TuxSSV2-Middleware-Driver.odt =================================================================== (Binary files differ) Copied: software_suite_v2/middleware/tuxdriver/trunk/doc/TuxSSV2-Tuxware-Libtuxdriver (from rev 1296, software_suite_v2/middleware/tuxdriver/trunk/doc/TuxSSV2-Middleware-Driver.odt) =================================================================== (Binary files differ) |
From: remi <c2m...@c2...> - 2008-07-02 13:47:01
|
Author: remi Date: 2008-07-02 15:47:05 +0200 (Wed, 02 Jul 2008) New Revision: 1296 Modified: software_suite_v2/middleware/tuxdriver/trunk/doc/TuxSSV2-Middleware-Driver.odt Log: * Updated the doc file of libtuxdriver Modified: software_suite_v2/middleware/tuxdriver/trunk/doc/TuxSSV2-Middleware-Driver.odt =================================================================== (Binary files differ) |
From: remi <c2m...@c2...> - 2008-07-02 08:13:53
|
Author: remi Date: 2008-07-02 10:13:56 +0200 (Wed, 02 Jul 2008) New Revision: 1295 Modified: software_suite_v2/middleware/tuxdriver/trunk/include/tux_driver.h software_suite_v2/middleware/tuxdriver/trunk/include/tux_driver.pas software_suite_v2/middleware/tuxdriver/trunk/include/tux_driver.py software_suite_v2/middleware/tuxdriver/trunk/src/tux_cmd_parser.c software_suite_v2/middleware/tuxdriver/trunk/src/tux_driver.c software_suite_v2/middleware/tuxdriver/trunk/src/tux_flippers.c software_suite_v2/middleware/tuxdriver/trunk/src/tux_flippers.h software_suite_v2/middleware/tuxdriver/trunk/src/tux_hw_cmd.h software_suite_v2/middleware/tuxdriver/trunk/src/tux_hw_status.c software_suite_v2/middleware/tuxdriver/trunk/src/tux_hw_status.h software_suite_v2/middleware/tuxdriver/trunk/src/tux_movements.c software_suite_v2/middleware/tuxdriver/trunk/src/tux_sw_status.c software_suite_v2/middleware/tuxdriver/trunk/src/tux_sw_status.h software_suite_v2/middleware/tuxdriver/trunk/src/tux_types.h Log: * replaced the word "wings" by "flippers" in the whole of lituxdriver. Modified: software_suite_v2/middleware/tuxdriver/trunk/include/tux_driver.h =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/include/tux_driver.h 2008-07-02 07:40:23 UTC (rev 1294) +++ software_suite_v2/middleware/tuxdriver/trunk/include/tux_driver.h 2008-07-02 08:13:56 UTC (rev 1295) @@ -27,8 +27,8 @@ * Id enumeration of high level status. */ typedef enum { - SW_ID_WINGS_POSITION = 0, - SW_ID_WINGS_REMAINING_MVM, + SW_ID_FLIPPERS_POSITION = 0, + SW_ID_FLIPPERS_REMAINING_MVM, SW_ID_SPINNING_DIRECTION, SW_ID_SPINNING_REMAINING_MVM, SW_ID_LEFT_WING_BUTTON, Modified: software_suite_v2/middleware/tuxdriver/trunk/include/tux_driver.pas =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/include/tux_driver.pas 2008-07-02 07:40:23 UTC (rev 1294) +++ software_suite_v2/middleware/tuxdriver/trunk/include/tux_driver.pas 2008-07-02 08:13:56 UTC (rev 1295) @@ -48,8 +48,8 @@ {** * Id enumeration of high level status. *} - SW_ID_WINGS_POSITION = 0; - SW_ID_WINGS_REMAINING_MVM = 1; + SW_ID_FLIPPERS_POSITION = 0; + SW_ID_FLIPPERS_REMAINING_MVM = 1; SW_ID_SPINNING_DIRECTION = 2; SW_ID_SPINNING_REMAINING_MVM = 3; SW_ID_LEFT_WING_BUTTON = 4; Modified: software_suite_v2/middleware/tuxdriver/trunk/include/tux_driver.py =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/include/tux_driver.py 2008-07-02 07:40:23 UTC (rev 1294) +++ software_suite_v2/middleware/tuxdriver/trunk/include/tux_driver.py 2008-07-02 08:13:56 UTC (rev 1295) @@ -32,8 +32,8 @@ E_TUXDRV_BUSY = E_TUXDRV_BEGIN + 8 E_TUXDRV_WAVSIZEEXCEDED = E_TUXDRV_BEGIN + 9 -SW_ID_WINGS_POSITION = 0 -SW_ID_WINGS_REMAINING_MVM = 1 +SW_ID_FLIPPERS_POSITION = 0 +SW_ID_FLIPPERS_REMAINING_MVM = 1 SW_ID_SPINNING_DIRECTION = 2 SW_ID_SPINNING_REMAINING_MVM = 3 SW_ID_LEFT_WING_BUTTON = 4 @@ -74,8 +74,8 @@ SW_ID_SPIN_RIGHT_MOTOR_ON = 39 SW_NAME_DRIVER = [ - "wings_position", - "wings_remaining_movements", + "flippers_position", + "flippers_remaining_movements", "spinning_direction", "spinning_remaining_movements", "left_wing_button", Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_cmd_parser.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_cmd_parser.c 2008-07-02 07:40:23 UTC (rev 1294) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_cmd_parser.c 2008-07-02 08:13:56 UTC (rev 1295) @@ -544,7 +544,7 @@ * */ static TuxDrvError -parse_tux_wings_command(tokens_t tokens, delay_cmd_t *cmd) +parse_tux_flippers_command(tokens_t tokens, delay_cmd_t *cmd) { TuxDrvError ret = E_TUXDRV_INVALIDCOMMAND; @@ -561,8 +561,8 @@ else if (strcmp(tokens[2], "ON") == 0) { cmd->sub_command = ON; - if (str_to_uint8(tokens[3], &cmd->wings_on_parameters.nr_movements) && - str_to_state_t(tokens[4], &cmd->wings_on_parameters.state)) + if (str_to_uint8(tokens[3], &cmd->flippers_on_parameters.nr_movements) && + str_to_state_t(tokens[4], &cmd->flippers_on_parameters.state)) { ret = E_TUXDRV_NOERROR; } @@ -570,8 +570,8 @@ else if (strcmp(tokens[2], "ON_DURING") == 0) { cmd->sub_command = ON_DURING; - if (str_to_float(tokens[3], &cmd->wings_on_during_parameters.duration) && - str_to_state_t(tokens[4], &cmd->wings_on_during_parameters.state)) + if (str_to_float(tokens[3], &cmd->flippers_on_during_parameters.duration) && + str_to_state_t(tokens[4], &cmd->flippers_on_during_parameters.state)) { ret = E_TUXDRV_NOERROR; } @@ -586,7 +586,7 @@ else if (strcmp(tokens[2], "SPEED") == 0) { cmd->sub_command = SPEED; - if (str_to_uint8(tokens[3], &cmd->wings_speed_parameters.speed)) + if (str_to_uint8(tokens[3], &cmd->flippers_speed_parameters.speed)) { ret = E_TUXDRV_NOERROR; } @@ -637,10 +637,10 @@ cmd->command = SPINNING; ret = parse_tux_spinning_command(tokens, cmd); } - else if (strcmp(tokens[1], "WINGS") == 0) + else if (strcmp(tokens[1], "FLIPPERS") == 0) { - cmd->command = WINGS; - ret = parse_tux_wings_command(tokens, cmd); + cmd->command = FLIPPERS; + ret = parse_tux_flippers_command(tokens, cmd); } return ret; } @@ -917,33 +917,33 @@ * */ static void -execute_wings_command (delay_cmd_t *cmd) +execute_flippers_command (delay_cmd_t *cmd) { switch (cmd->sub_command) { case ON: - tux_wings_cmd_on( - cmd->wings_on_parameters.nr_movements, - cmd->wings_on_parameters.state); + tux_flippers_cmd_on( + cmd->flippers_on_parameters.nr_movements, + cmd->flippers_on_parameters.state); break; case ON_DURING: - tux_wings_cmd_on_during( - cmd->wings_on_during_parameters.duration, - cmd->wings_on_during_parameters.state); + tux_flippers_cmd_on_during( + cmd->flippers_on_during_parameters.duration, + cmd->flippers_on_during_parameters.state); break; case OFF: - tux_wings_cmd_off(); + tux_flippers_cmd_off(); break; case UP: - tux_wings_cmd_up(); + tux_flippers_cmd_up(); break; case DOWN: - tux_wings_cmd_down(); + tux_flippers_cmd_down(); break; case SPEED: - tux_wings_cmd_speed(cmd->wings_speed_parameters.speed); + tux_flippers_cmd_speed(cmd->flippers_speed_parameters.speed); break; default: /* should not occur */ - log_error("execute invalid wings command"); + log_error("execute invalid flippers command"); } } @@ -986,8 +986,8 @@ case SPINNING: execute_spinning_command(cmd); break; - case WINGS: - execute_wings_command(cmd); + case FLIPPERS: + execute_flippers_command(cmd); break; } } Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_driver.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_driver.c 2008-07-02 07:40:23 UTC (rev 1294) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_driver.c 2008-07-02 08:13:56 UTC (rev 1295) @@ -138,7 +138,7 @@ case FRAME_HEADER_POSITION1: if (header == ret) { - tux_wings_update_movements_remaining(); + tux_flippers_update_movements_remaining(); tux_mouth_update_movements_remaining(); tux_eyes_update_movements_remaining(); } @@ -146,11 +146,11 @@ case FRAME_HEADER_POSITION2: if (header == ret) { - tux_wings_update_position(); + tux_flippers_update_position(); tux_spinning_update_movements_remaining(); tux_eyes_update_motor(); tux_mouth_update_motor(); - tux_wings_update_motor(); + tux_flippers_update_motor(); tux_spinning_update_left_motor(); tux_spinning_update_right_motor(); } @@ -418,7 +418,7 @@ { TuxDrv_PerformCommand(0.0, "TUX_CMD:EYES:OPEN"); TuxDrv_PerformCommand(0.3, "TUX_CMD:MOUTH:CLOSE"); - TuxDrv_PerformCommand(0.0, "TUX_CMD:WINGS:DOWN"); + TuxDrv_PerformCommand(0.0, "TUX_CMD:FLIPPERS:DOWN"); TuxDrv_PerformCommand(0.0, "TUX_CMD:SPINNING:OFF"); TuxDrv_PerformCommand(0.0, "TUX_CMD:LED:ON:LED_BOTH,1.0"); } Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_flippers.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_flippers.c 2008-07-02 07:40:23 UTC (rev 1294) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_flippers.c 2008-07-02 08:13:56 UTC (rev 1295) @@ -1,5 +1,5 @@ /* - * Tux Droid - Wings + * Tux Droid - Flippers * Copyright (C) 2008 C2ME Sa * * This program is free software; you can redistribute it and/or modify @@ -35,11 +35,11 @@ * */ LIBLOCAL void -tux_wings_update_position(void) +tux_flippers_update_position(void) { char *new_position = ""; - if (!hw_status_table.position2.wings_down) + if (!hw_status_table.position2.flippers_down) { new_position = STRING_VALUE_DOWN; } @@ -48,14 +48,14 @@ new_position = STRING_VALUE_UP; } - tux_sw_status_set_strvalue(SW_ID_WINGS_POSITION, new_position, true); + tux_sw_status_set_strvalue(SW_ID_FLIPPERS_POSITION, new_position, true); } /** * Update the status of the motor state of the flippers. */ LIBLOCAL void -tux_wings_update_motor(void) +tux_flippers_update_motor(void) { unsigned char new_state; @@ -67,21 +67,21 @@ * */ LIBLOCAL void -tux_wings_update_movements_remaining(void) +tux_flippers_update_movements_remaining(void) { unsigned char new_count; - new_count = hw_status_table.position1.wings_remaining_mvm; + new_count = hw_status_table.position1.flippers_remaining_mvm; mvmt_counter = new_count; - tux_sw_status_set_intvalue(SW_ID_WINGS_REMAINING_MVM, new_count, true); + tux_sw_status_set_intvalue(SW_ID_FLIPPERS_REMAINING_MVM, new_count, true); } /** * */ LIBLOCAL bool -tux_wings_cmd_speed(unsigned char speed) +tux_flippers_cmd_speed(unsigned char speed) { return tux_movement_perform(MOVE_FLIPPERS, 0, 0.0, speed, FINAL_ST_UNDEFINED, true); @@ -91,7 +91,7 @@ * */ LIBLOCAL bool -tux_wings_cmd_on(unsigned char counter, unsigned char final_state) +tux_flippers_cmd_on(unsigned char counter, unsigned char final_state) { return tux_movement_cmd_on(MOVE_FLIPPERS, counter, final_state); } @@ -100,11 +100,11 @@ * */ LIBLOCAL bool -tux_wings_cmd_on_during(float timeout, unsigned char final_state) +tux_flippers_cmd_on_during(float timeout, unsigned char final_state) { bool ret; - data_frame frame = {WINGS_WAVE_CMD, 0, 5, 0}; - delay_cmd_t cmd = { 0.0, TUX_CMD, WINGS }; + data_frame frame = {FLIPPERS_WAVE_CMD, 0, 5, 0}; + delay_cmd_t cmd = { 0.0, TUX_CMD, FLIPPERS }; /* Short movements */ if (timeout < 0.3) @@ -121,7 +121,7 @@ } mvmt_counter = 255; - tux_sw_status_set_intvalue(SW_ID_WINGS_REMAINING_MVM, mvmt_counter, true); + tux_sw_status_set_intvalue(SW_ID_FLIPPERS_REMAINING_MVM, mvmt_counter, true); switch (final_state) { case FINAL_ST_UNDEFINED: @@ -146,7 +146,7 @@ * */ LIBLOCAL bool -tux_wings_cmd_up(void) +tux_flippers_cmd_up(void) { return tux_movement_perform(MOVE_FLIPPERS, 0, 0, 5, FINAL_ST_OPEN_UP, false); } @@ -155,7 +155,7 @@ * */ LIBLOCAL bool -tux_wings_cmd_down(void) +tux_flippers_cmd_down(void) { return tux_movement_perform(MOVE_FLIPPERS, 0, 0, 5, FINAL_ST_CLOSE_DOWN, false); } @@ -164,14 +164,14 @@ * */ LIBLOCAL bool -tux_wings_cmd_off(void) +tux_flippers_cmd_off(void) { bool ret; - tux_cmd_parser_clean_sys_command(WINGS); + tux_cmd_parser_clean_sys_command(FLIPPERS); ret = tux_movement_perform(MOVE_FLIPPERS, 0, 0, 5, FINAL_ST_STOP, false); mvmt_counter = 0; - tux_sw_status_set_intvalue(SW_ID_WINGS_REMAINING_MVM, mvmt_counter, true); + tux_sw_status_set_intvalue(SW_ID_FLIPPERS_REMAINING_MVM, mvmt_counter, true); return ret; } Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_flippers.h =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_flippers.h 2008-07-02 07:40:23 UTC (rev 1294) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_flippers.h 2008-07-02 08:13:56 UTC (rev 1295) @@ -1,5 +1,5 @@ /* - * Tux Droid - Wings + * Tux Droid - Flippers * Copyright (C) 2008 C2ME Sa * * This program is free software; you can redistribute it and/or modify @@ -18,22 +18,22 @@ * 02111-1307, USA. */ -#ifndef _TUX_WINGS_H_ -#define _TUX_WINGS_H_ +#ifndef _TUX_FLIPPERS_H_ +#define _TUX_FLIPPERS_H_ #include <stdbool.h> -#define TUX_WINGS_POSITION_DOWN 0 -#define TUX_WINGS_POSITION_UP 1 +#define TUX_FLIPPERS_POSITION_DOWN 0 +#define TUX_FLIPPERS_POSITION_UP 1 -extern void tux_wings_update_position(void); -extern void tux_wings_update_motor(void); -extern void tux_wings_update_movements_remaining(void); -extern bool tux_wings_cmd_speed(unsigned char speed); -extern bool tux_wings_cmd_on(unsigned char counter, unsigned char final_state); -extern bool tux_wings_cmd_on_during(float timeout, unsigned char final_state); -extern bool tux_wings_cmd_up(void); -extern bool tux_wings_cmd_down(void); -extern bool tux_wings_cmd_off(void); +extern void tux_flippers_update_position(void); +extern void tux_flippers_update_motor(void); +extern void tux_flippers_update_movements_remaining(void); +extern bool tux_flippers_cmd_speed(unsigned char speed); +extern bool tux_flippers_cmd_on(unsigned char counter, unsigned char final_state); +extern bool tux_flippers_cmd_on_during(float timeout, unsigned char final_state); +extern bool tux_flippers_cmd_up(void); +extern bool tux_flippers_cmd_down(void); +extern bool tux_flippers_cmd_off(void); -#endif /* _TUX_WINGS_H_ */ +#endif /* _TUX_FLIPPERS_H_ */ Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_hw_cmd.h =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_hw_cmd.h 2008-07-02 07:40:23 UTC (rev 1294) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_hw_cmd.h 2008-07-02 08:13:56 UTC (rev 1295) @@ -59,10 +59,10 @@ MOUTH_MOVE_CMD = 0x41, MOUTH_STOP_CMD = 0x36, - WINGS_RAISE_CMD = 0x39, - WINGS_LOWER_CMD = 0x3A, - WINGS_WAVE_CMD = 0x80, - WINGS_STOP_CMD = 0x30, + FLIPPERS_RAISE_CMD = 0x39, + FLIPPERS_LOWER_CMD = 0x3A, + FLIPPERS_WAVE_CMD = 0x80, + FLIPPERS_STOP_CMD = 0x30, SPIN_LEFT_CMD = 0x82, SPIN_RIGHT_CMD = 0x83, Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_hw_status.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_hw_status.c 2008-07-02 07:40:23 UTC (rev 1294) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_hw_status.c 2008-07-02 08:13:56 UTC (rev 1295) @@ -306,14 +306,14 @@ { ret = FRAME_HEADER_POSITION1; } - if (hw_status_table.position1.wings_remaining_mvm != frame[3]) + if (hw_status_table.position1.flippers_remaining_mvm != frame[3]) { ret = FRAME_HEADER_POSITION1; } hw_status_table.position1.eyes_remaining_mvm = frame[1]; hw_status_table.position1.mouth_remaining_mvm = frame[2]; - hw_status_table.position1.wings_remaining_mvm = frame[3]; + hw_status_table.position1.flippers_remaining_mvm = frame[3]; return ret; } @@ -330,7 +330,7 @@ { ret = FRAME_HEADER_POSITION2; } - if (hw_status_table.position2.wings_down != frame[2]) + if (hw_status_table.position2.flippers_down != frame[2]) { ret = FRAME_HEADER_POSITION2; } @@ -340,7 +340,7 @@ } hw_status_table.position2.spin_remaining_mvm = frame[1]; - hw_status_table.position2.wings_down = frame[2]; + hw_status_table.position2.flippers_down = frame[2]; hw_status_table.position2.motors.Byte = frame[3]; return ret; Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_hw_status.h =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_hw_status.h 2008-07-02 07:40:23 UTC (rev 1294) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_hw_status.h 2008-07-02 08:13:56 UTC (rev 1295) @@ -62,7 +62,7 @@ typedef struct { - _BIT_ wings_motor_backward:1; + _BIT_ flippers_motor_backward:1; _BIT_ spin_motor_forward:1; _BIT_ spin_motor_backward:1; _BIT_ mouth_open_switch:1; @@ -81,7 +81,7 @@ typedef struct { _BIT_ photo_transistor_pull_up:1; - _BIT_ wings_position_switch:1; + _BIT_ flippers_position_switch:1; _BIT_ right_blue_led:1; _BIT_ left_blue_led:1; _BIT_ i2c_sda_line:1; @@ -102,7 +102,7 @@ _BIT_ head_motor_for_eyes:1; _BIT_ ir_receiver_signal:1; _BIT_ spin_position_switch:1; - _BIT_ wings_motor_forward:1; + _BIT_ flippers_motor_forward:1; _BIT_ ir_led:1; _BIT_ eyes_open_switch:1; _BIT_ eyes_closed_switch:1; @@ -243,13 +243,13 @@ { unsigned char eyes_remaining_mvm; unsigned char mouth_remaining_mvm; - unsigned char wings_remaining_mvm; + unsigned char flippers_remaining_mvm; } frame_body_position1_t; typedef struct { unsigned char spin_remaining_mvm; - unsigned char wings_down; + unsigned char flippers_down; _MOTORS_STATUS_BYTE_ motors; } frame_body_position2_t; Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_movements.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_movements.c 2008-07-02 07:40:23 UTC (rev 1294) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_movements.c 2008-07-02 08:13:56 UTC (rev 1295) @@ -136,7 +136,7 @@ } case (MOVE_FLIPPERS): { - condition = !hw_status_table.position2.wings_down; + condition = !hw_status_table.position2.flippers_down; if (value) { value = movement_status_control(final_state, value, condition); @@ -257,19 +257,19 @@ case (MOVE_FLIPPERS): if (final_state == FINAL_ST_OPEN_UP) { - frame[0] = WINGS_RAISE_CMD; + frame[0] = FLIPPERS_RAISE_CMD; } else { if (final_state == FINAL_ST_CLOSE_DOWN) { - frame[0] = WINGS_LOWER_CMD; + frame[0] = FLIPPERS_LOWER_CMD; } else { if (final_state == FINAL_ST_STOP) { - frame[0] = WINGS_STOP_CMD; + frame[0] = FLIPPERS_STOP_CMD; } } } @@ -305,7 +305,7 @@ * \param motor Which motor should be configured * \param counter The number of movements to execute * \param timeout The duration of the movement (if counter = 0) - * \param speed The PWM value. Only applicable for the wings and the spinning. + * \param speed The PWM value. Only applicable for the flippers and the spinning. * \param final_state The final state to reach * \param refresh Flag indicate if the entire command must be sent, or just the * new PWM value. Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_sw_status.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_sw_status.c 2008-07-02 07:40:23 UTC (rev 1294) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_sw_status.c 2008-07-02 08:13:56 UTC (rev 1295) @@ -76,11 +76,11 @@ { id, name, value_fmt, {.strvalue = initval}, threshold, value_doc, 0.0 }, sw_status_t sw_status_table[SW_STATUS_NUMBER] = { - INIT_STRINGID(SW_ID_WINGS_POSITION, ID_FMT_STRING, - "wings_position", "DOWN|UP", STRING_VALUE_DOWN, 1) + INIT_STRINGID(SW_ID_FLIPPERS_POSITION, ID_FMT_STRING, + "flippers_position", "DOWN|UP", STRING_VALUE_DOWN, 1) - INIT_INTID(SW_ID_WINGS_REMAINING_MVM, ID_FMT_UINT8, - "wings_remaining_movements", "range[0..255]", 0, 1) + INIT_INTID(SW_ID_FLIPPERS_REMAINING_MVM, ID_FMT_UINT8, + "flippers_remaining_movements", "range[0..255]", 0, 1) INIT_STRINGID(SW_ID_SPINNING_DIRECTION, ID_FMT_STRING, "spinning_direction", "NONE|LEFT|RIGHT", STRING_VALUE_NONE, 1) Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_sw_status.h =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_sw_status.h 2008-07-02 07:40:23 UTC (rev 1294) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_sw_status.h 2008-07-02 08:13:56 UTC (rev 1295) @@ -54,8 +54,8 @@ #define STRING_VALUE_ERROR_USB "ERROR_USB" typedef enum { - SW_ID_WINGS_POSITION = 0, - SW_ID_WINGS_REMAINING_MVM, + SW_ID_FLIPPERS_POSITION = 0, + SW_ID_FLIPPERS_REMAINING_MVM, SW_ID_SPINNING_DIRECTION, SW_ID_SPINNING_REMAINING_MVM, SW_ID_LEFT_WING_BUTTON, Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_types.h =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_types.h 2008-07-02 07:40:23 UTC (rev 1294) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_types.h 2008-07-02 08:13:56 UTC (rev 1295) @@ -46,7 +46,7 @@ MOUTH, SOUND_FLASH, SPINNING, - WINGS + FLIPPERS } tux_command_t; /* subcommands */ @@ -175,20 +175,20 @@ unsigned char speed; } spinning_speed_parameters_t; -/* wings */ +/* flippers */ typedef struct { move_final_state_t state; unsigned char nr_movements; -} wings_on_parameters_t; +} flippers_on_parameters_t; typedef struct { move_final_state_t state; float duration; -} wings_on_during_parameters_t; +} flippers_on_during_parameters_t; typedef struct { unsigned char speed; -} wings_speed_parameters_t; +} flippers_speed_parameters_t; /* raw */ typedef struct { @@ -221,9 +221,9 @@ spinning_on_parameters_t spinning_on_parameters; spinning_on_during_parameters_t spinning_on_during_parameters; spinning_speed_parameters_t spinning_speed_parameters; - wings_on_parameters_t wings_on_parameters; - wings_on_during_parameters_t wings_on_during_parameters; - wings_speed_parameters_t wings_speed_parameters; + flippers_on_parameters_t flippers_on_parameters; + flippers_on_during_parameters_t flippers_on_during_parameters; + flippers_speed_parameters_t flippers_speed_parameters; raw_parameters_t raw_parameters; }; float inserted_at_time; |
From: jaguarondi <c2m...@c2...> - 2008-07-02 07:40:14
|
Author: jaguarondi Date: 2008-07-02 09:40:23 +0200 (Wed, 02 Jul 2008) New Revision: 1294 Added: firmware/rf/trunk/main.c Removed: firmware/rf/trunk/device.c Modified: firmware/rf/trunk/Makefile Log: * Renamed device.c into main.c. Modified: firmware/rf/trunk/Makefile =================================================================== --- firmware/rf/trunk/Makefile 2008-07-02 07:38:17 UTC (rev 1293) +++ firmware/rf/trunk/Makefile 2008-07-02 07:40:23 UTC (rev 1294) @@ -1,5 +1,5 @@ ############################################################################### -# Makefile for the project device +# Makefile for [TF]UXRF ############################################################################### ## General Flags @@ -53,9 +53,9 @@ ## Objects that must be built in order to link ifeq ($(BOOTLOADER),1) -OBJECTS = device.o init.o misc.o prot.o rf_ctrl.o varis.o interface.o bootloader.o +OBJECTS = main.o init.o misc.o prot.o rf_ctrl.o varis.o interface.o bootloader.o else -OBJECTS = device.o init.o misc.o prot.o rf_ctrl.o varis.o interface.o +OBJECTS = main.o init.o misc.o prot.o rf_ctrl.o varis.o interface.o endif ## Objects explicitly added by the user @@ -65,7 +65,7 @@ all: svnrev.h $(TARGET) $(PROJECT).hex $(PROJECT).eep $(PROJECT).lss size ## Compile -device.o: device.c +main.o: main.c $(CC) $(INCLUDES) $(CFLAGS) -c $< init.o: init.c @@ -112,7 +112,7 @@ ## Clean target .PHONY: clean clean: - -rm -rf $(OBJECTS) device.elf dep/* $(PROJECT).* svnrev.h + -rm -rf $(OBJECTS) main.elf dep/* $(PROJECT).* svnrev.h ## Other dependencies Deleted: firmware/rf/trunk/device.c =================================================================== --- firmware/rf/trunk/device.c 2008-07-02 07:38:17 UTC (rev 1293) +++ firmware/rf/trunk/device.c 2008-07-02 07:40:23 UTC (rev 1294) @@ -1,114 +0,0 @@ -/* - * [TF]UXRF - Firmware for the 2 RF CPU of tuxdroid (TUXRF and FUXRF) - * Copyright (C) 2007 KySoH S.A. <in...@ky...> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* $Id$ */ - -#include "defines.h" -#include "init.h" -#include "interface.h" -#include "misc.h" -#include "varis.h" -#include "prot.h" -#include "rf_ctrl.h" - -/* - * Version number - */ -#include "version.h" -#include "svnrev.h" -#include "common/api.h" -#include "common/defines.h" - -#ifdef _SLAVE -#define CPU_NUMBER TUXRF_CPU_NUM /* TUXRF CPU */ -#else -#define CPU_NUMBER FUXRF_CPU_NUM /* FUXRF CPU */ -#endif -const author_t author __attribute__ ((section("version.3"))) = -{AUTHOR_CMD, AUTHOR_ID, VARIATION}; -const revision_t svn_revision __attribute__ ((section("version.2"))) = -{REVISION_CMD, SVN_REV, RELEASE_TYPE}; -const version_t tag_version __attribute__ ((section("version.1"))) = -{VERSION_CMD, CPU_VER_JOIN(CPU_NUMBER, VER_MAJOR), VER_MINOR, VER_UPDATE}; - -/* Set to 1 to enable stack debugging. */ -#define DBG_STACK 0 - -#if (BOOTLOADER) -#include "bootloader.h" -#endif - -#if (DBG_STACK) -extern uint16_t __heap_start; -void init_ram(void) __attribute__ ((naked)) - __attribute__ ((section(".init1"))); -void init_ram(void) -{ - uint8_t *ptr; - - for (ptr = (uint8_t *) &__heap_start; ptr < (uint8_t *) 0x800300; ptr++) - *ptr = 0x5F; -} -#endif - -/** - * Main function of the RF firmware. - * After initialization, the RF is completely handled by interrupts, the main - * loop is empty. - */ -int main(void) -{ -#ifdef _SLAVE - volatile uint16_t _count=0; - /* Wait for the head button signal to rise if it isn't pressed. */ - for (;_count<0xFFFF; _count++); - /* If head is pushed at startup */ - if (!(PIND & 0x40)) - /* jump to bootloader */ -#if (BOOTLOADER) - asm volatile ("rjmp bootloader" ::); -#else - asm volatile ("rjmp bootloader_start" ::); -#endif -#elif defined(_MASTER) - /* If SPI_SS is cleared at startup */ - if (!(PINB & 0x04)) - /* jump to bootloader */ -#if (BOOTLOADER) - asm volatile ("rjmp bootloader" ::); -#else - asm volatile ("rjmp bootloader_start" ::); -#endif -#endif - - /* System init */ - init_avr(); - init_varis(); - interface_init(); - - /* XXX debug */ - DDRB |= _BV(PB3) | _BV(PB5); - DDRC |= _BV(PC3); - - - sei(); - system_start_up(); - for(;;){ - } -} Copied: firmware/rf/trunk/main.c (from rev 1293, firmware/rf/trunk/device.c) =================================================================== --- firmware/rf/trunk/main.c (rev 0) +++ firmware/rf/trunk/main.c 2008-07-02 07:40:23 UTC (rev 1294) @@ -0,0 +1,114 @@ +/* + * [TF]UXRF - Firmware for the 2 RF CPU of tuxdroid (TUXRF and FUXRF) + * Copyright (C) 2007 KySoH S.A. <in...@ky...> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* $Id$ */ + +#include "defines.h" +#include "init.h" +#include "interface.h" +#include "misc.h" +#include "varis.h" +#include "prot.h" +#include "rf_ctrl.h" + +/* + * Version number + */ +#include "version.h" +#include "svnrev.h" +#include "common/api.h" +#include "common/defines.h" + +#ifdef _SLAVE +#define CPU_NUMBER TUXRF_CPU_NUM /* TUXRF CPU */ +#else +#define CPU_NUMBER FUXRF_CPU_NUM /* FUXRF CPU */ +#endif +const author_t author __attribute__ ((section("version.3"))) = +{AUTHOR_CMD, AUTHOR_ID, VARIATION}; +const revision_t svn_revision __attribute__ ((section("version.2"))) = +{REVISION_CMD, SVN_REV, RELEASE_TYPE}; +const version_t tag_version __attribute__ ((section("version.1"))) = +{VERSION_CMD, CPU_VER_JOIN(CPU_NUMBER, VER_MAJOR), VER_MINOR, VER_UPDATE}; + +/* Set to 1 to enable stack debugging. */ +#define DBG_STACK 0 + +#if (BOOTLOADER) +#include "bootloader.h" +#endif + +#if (DBG_STACK) +extern uint16_t __heap_start; +void init_ram(void) __attribute__ ((naked)) + __attribute__ ((section(".init1"))); +void init_ram(void) +{ + uint8_t *ptr; + + for (ptr = (uint8_t *) &__heap_start; ptr < (uint8_t *) 0x800300; ptr++) + *ptr = 0x5F; +} +#endif + +/** + * Main function of the RF firmware. + * After initialization, the RF is completely handled by interrupts, the main + * loop is empty. + */ +int main(void) +{ +#ifdef _SLAVE + volatile uint16_t _count=0; + /* Wait for the head button signal to rise if it isn't pressed. */ + for (;_count<0xFFFF; _count++); + /* If head is pushed at startup */ + if (!(PIND & 0x40)) + /* jump to bootloader */ +#if (BOOTLOADER) + asm volatile ("rjmp bootloader" ::); +#else + asm volatile ("rjmp bootloader_start" ::); +#endif +#elif defined(_MASTER) + /* If SPI_SS is cleared at startup */ + if (!(PINB & 0x04)) + /* jump to bootloader */ +#if (BOOTLOADER) + asm volatile ("rjmp bootloader" ::); +#else + asm volatile ("rjmp bootloader_start" ::); +#endif +#endif + + /* System init */ + init_avr(); + init_varis(); + interface_init(); + + /* XXX debug */ + DDRB |= _BV(PB3) | _BV(PB5); + DDRC |= _BV(PC3); + + + sei(); + system_start_up(); + for(;;){ + } +} Property changes on: firmware/rf/trunk/main.c ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Name: svn:mergeinfo + Name: svn:eol-style + native |
From: jaguarondi <c2m...@c2...> - 2008-07-02 07:38:10
|
Author: jaguarondi Date: 2008-07-02 09:38:17 +0200 (Wed, 02 Jul 2008) New Revision: 1293 Modified: firmware/rf/trunk/device.c firmware/rf/trunk/init.c Log: * Some cleanup. Modified: firmware/rf/trunk/device.c =================================================================== --- firmware/rf/trunk/device.c 2008-07-02 07:04:25 UTC (rev 1292) +++ firmware/rf/trunk/device.c 2008-07-02 07:38:17 UTC (rev 1293) @@ -1,47 +1,24 @@ -//***************************************************************************** -//* Project: RF-Firmware Point to Multipoint for ISM - Transceiver ATR2406 * -//* Version: V1.0 * -//* File: appl.c * -//* Target MCU: ATMega88 * -//* Compiler: GCC * -//* Simulator: AVRStudio 4.08 * -//* Emulator: JTAG ICE * -//* Author: Christian Bechter * -//* Date: 31.01.06 * -//* Used Hardware: DEV-KIT-III * -//***************************************************************************** -//***************************************************************************** -//* Copyright 2006, Atmel Germany GmbH * -//* * -//* This software is owned by the Atmel Germany GmbH * -//* and is protected by and subject to worldwide patent protection. * -//* Atmel hereby grants to licensee a personal, * -//* non-exclusive, non-transferable license to copy, use, modify, create * -//* derivative works of, and compile the Atmel Source Code and derivative * -//* works for the sole purpose of creating custom software in support of * -//* licensee product to be used only in conjunction with a Atmel integrated * -//* circuit as specified in the applicable agreement. Any reproduction, * -//* modification, translation, compilation, or representation of this * -//* software except as specified above is prohibited without the express * -//* written permission of Atmel. * -//* * -//* Disclaimer: ATMEL MAKES NO WARRANTY OF ANY KIND,EXPRESS OR IMPLIED, * -//* WITH REGARD TO THIS MATERIAL, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * -//* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * -//* Atmel reserves the right to make changes without further notice to the * -//* materials described herein. Atmel does not assume any liability arising * -//* out of the application or use of any product or circuit described herein. * -//* Atmel does not authorize its products for use as critical components in * -//* life-support systems where a malfunction or failure may reasonably be * -//* expected to result in significant injury to the user. The inclusion of * -//* Atmel products in a life-support systems application implies that the * -//* manufacturer assumes all risk of such use and in doing so indemnifies * -//* Atmel against all charges. * -//* * -//* Use may be limited by and subject to the applicable Atmel software * -//* license agreement. * -//***************************************************************************** +/* + * [TF]UXRF - Firmware for the 2 RF CPU of tuxdroid (TUXRF and FUXRF) + * Copyright (C) 2007 KySoH S.A. <in...@ky...> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +/* $Id$ */ + #include "defines.h" #include "init.h" #include "interface.h" @@ -90,31 +67,11 @@ } #endif -//***************************************************************************** -//* Project: RF-Firmware for ISM * -//* Function: main * -//* Parameters: NONE * -//* Returns: NONE * -//* Action: Main routine of the Device * -//* Duration: tbd * -//* Size: tbd * -//* Date: 31.01.06 * -//* Description: Get connected to the Basestation, get values from the sensors* -//* and digital I/O * -//***************************************************************************** -//***************************************************************************** -// SETUP of RF_BUFFER_TX: * -// 0 - 5 -> Preamble * -// 6 - 7 -> Sync * -// 8 - 11 -> SOF * -// 12 -> LEN * -// 13 -> Command * -// 14 - 30 -> Payload * -// 31 -> Checksum * -//***************************************************************************** -typedef void (*AppPtr_t)(void); -const AppPtr_t RunBoot = (AppPtr_t) 0x0785; - +/** + * Main function of the RF firmware. + * After initialization, the RF is completely handled by interrupts, the main + * loop is empty. + */ int main(void) { #ifdef _SLAVE Modified: firmware/rf/trunk/init.c =================================================================== --- firmware/rf/trunk/init.c 2008-07-02 07:04:25 UTC (rev 1292) +++ firmware/rf/trunk/init.c 2008-07-02 07:38:17 UTC (rev 1293) @@ -121,16 +121,16 @@ //***************************************************************************** void init_varis(void) { - //************************************************************************* - // SETUP of RF_BUFFER_TX: * - // 0 - 5 -> Preamble * - // 6 - 7 -> Sync * - // 8 - 11 -> SOF * - // 12 -> LEN * - // 13 -> Command * - // 14 - 30 -> Payload * - // 31 -> Checksum * - //************************************************************************* +//***************************************************************************** +// SETUP of RF_BUFFER_TX: * +// 0 - 5 -> Preamble * +// 6 - 7 -> Sync * +// 8 - 11 -> SOF * +// 12 -> LEN * +// 13 -> Command * +// 14 - 30 -> Payload * +// 31 -> Checksum * +//***************************************************************************** //Default setup of the rf_buffer_tx// rf_buffer_tx[0] = rf_buffer_tx[1] = rf_buffer_tx[2] = 0x55 ^ SCRAMBLE_BYTE; rf_buffer_tx[3] = rf_buffer_tx[4] = rf_buffer_tx[5] = 0x55 ^ SCRAMBLE_BYTE; |
From: remi <c2m...@c2...> - 2008-07-02 07:04:21
|
Author: remi Date: 2008-07-02 09:04:25 +0200 (Wed, 02 Jul 2008) New Revision: 1292 Added: software_suite_v2/middleware/tuxdriver/trunk/src/tux_flippers.c software_suite_v2/middleware/tuxdriver/trunk/src/tux_flippers.h Removed: software_suite_v2/middleware/tuxdriver/trunk/src/tux_wings.c software_suite_v2/middleware/tuxdriver/trunk/src/tux_wings.h Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_cmd_parser.c software_suite_v2/middleware/tuxdriver/trunk/src/tux_driver.c software_suite_v2/middleware/tuxdriver/trunk/unix/Makefile software_suite_v2/middleware/tuxdriver/trunk/win32/Makefile Log: *renamed tux_wings.* to tux_flippers.* Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_cmd_parser.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_cmd_parser.c 2008-07-01 16:32:24 UTC (rev 1291) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_cmd_parser.c 2008-07-02 07:04:25 UTC (rev 1292) @@ -39,7 +39,7 @@ #include "tux_types.h" #include "tux_usb.h" #include "tux_user_inputs.h" -#include "tux_wings.h" +#include "tux_flippers.h" #define NRCMDS 512 Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_driver.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_driver.c 2008-07-01 16:32:24 UTC (rev 1291) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_driver.c 2008-07-02 07:04:25 UTC (rev 1292) @@ -39,7 +39,7 @@ #include "tux_user_inputs.h" #include "tux_spinning.h" #include "tux_usb.h" -#include "tux_wings.h" +#include "tux_flippers.h" #include "version.h" static bool driver_started = false; Copied: software_suite_v2/middleware/tuxdriver/trunk/src/tux_flippers.c (from rev 1291, software_suite_v2/middleware/tuxdriver/trunk/src/tux_wings.c) =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_flippers.c (rev 0) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_flippers.c 2008-07-02 07:04:25 UTC (rev 1292) @@ -0,0 +1,177 @@ +/* + * Tux Droid - Wings + * Copyright (C) 2008 C2ME Sa + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#include <string.h> + +#include "tux_cmd_parser.h" +#include "tux_hw_status.h" +#include "tux_hw_cmd.h" +#include "tux_movements.h" +#include "tux_sw_status.h" +#include "tux_types.h" +#include "tux_usb.h" +#include "tux_flippers.h" + +static unsigned char mvmt_counter = 0; + +/** + * + */ +LIBLOCAL void +tux_wings_update_position(void) +{ + char *new_position = ""; + + if (!hw_status_table.position2.wings_down) + { + new_position = STRING_VALUE_DOWN; + } + else + { + new_position = STRING_VALUE_UP; + } + + tux_sw_status_set_strvalue(SW_ID_WINGS_POSITION, new_position, true); +} + +/** + * Update the status of the motor state of the flippers. + */ +LIBLOCAL void +tux_wings_update_motor(void) +{ + unsigned char new_state; + + new_state = hw_status_table.position2.motors.bits.flippers_on; + tux_sw_status_set_intvalue(SW_ID_FLIPPERS_MOTOR_ON, new_state, true); +} + +/** + * + */ +LIBLOCAL void +tux_wings_update_movements_remaining(void) +{ + unsigned char new_count; + + new_count = hw_status_table.position1.wings_remaining_mvm; + + mvmt_counter = new_count; + tux_sw_status_set_intvalue(SW_ID_WINGS_REMAINING_MVM, new_count, true); +} + +/** + * + */ +LIBLOCAL bool +tux_wings_cmd_speed(unsigned char speed) +{ + return tux_movement_perform(MOVE_FLIPPERS, 0, 0.0, speed, + FINAL_ST_UNDEFINED, true); +} + +/** + * + */ +LIBLOCAL bool +tux_wings_cmd_on(unsigned char counter, unsigned char final_state) +{ + return tux_movement_cmd_on(MOVE_FLIPPERS, counter, final_state); +} + +/** + * + */ +LIBLOCAL bool +tux_wings_cmd_on_during(float timeout, unsigned char final_state) +{ + bool ret; + data_frame frame = {WINGS_WAVE_CMD, 0, 5, 0}; + delay_cmd_t cmd = { 0.0, TUX_CMD, WINGS }; + + /* Short movements */ + if (timeout < 0.3) + { + return tux_movement_perform(MOVE_FLIPPERS, 0, timeout, 5, final_state, + false); + } + + /* Long movements */ + ret = tux_usb_send_to_tux(frame); + if (!ret) + { + return false; + } + + mvmt_counter = 255; + tux_sw_status_set_intvalue(SW_ID_WINGS_REMAINING_MVM, mvmt_counter, true); + + switch (final_state) { + case FINAL_ST_UNDEFINED: + cmd.sub_command = OFF; + break; + case FINAL_ST_OPEN_UP: + cmd.sub_command = UP; + break; + case FINAL_ST_CLOSE_DOWN: + cmd.sub_command = DOWN; + break; + case FINAL_ST_STOP: + cmd.sub_command = OFF; + break; + } + ret = tux_cmd_parser_insert_sys_command(timeout, &cmd); + + return ret; +} + +/** + * + */ +LIBLOCAL bool +tux_wings_cmd_up(void) +{ + return tux_movement_perform(MOVE_FLIPPERS, 0, 0, 5, FINAL_ST_OPEN_UP, false); +} + +/** + * + */ +LIBLOCAL bool +tux_wings_cmd_down(void) +{ + return tux_movement_perform(MOVE_FLIPPERS, 0, 0, 5, FINAL_ST_CLOSE_DOWN, false); +} + +/** + * + */ +LIBLOCAL bool +tux_wings_cmd_off(void) +{ + bool ret; + + tux_cmd_parser_clean_sys_command(WINGS); + ret = tux_movement_perform(MOVE_FLIPPERS, 0, 0, 5, FINAL_ST_STOP, false); + mvmt_counter = 0; + tux_sw_status_set_intvalue(SW_ID_WINGS_REMAINING_MVM, mvmt_counter, true); + + return ret; +} Copied: software_suite_v2/middleware/tuxdriver/trunk/src/tux_flippers.h (from rev 1291, software_suite_v2/middleware/tuxdriver/trunk/src/tux_wings.h) =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_flippers.h (rev 0) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_flippers.h 2008-07-02 07:04:25 UTC (rev 1292) @@ -0,0 +1,39 @@ +/* + * Tux Droid - Wings + * Copyright (C) 2008 C2ME Sa + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +#ifndef _TUX_WINGS_H_ +#define _TUX_WINGS_H_ + +#include <stdbool.h> + +#define TUX_WINGS_POSITION_DOWN 0 +#define TUX_WINGS_POSITION_UP 1 + +extern void tux_wings_update_position(void); +extern void tux_wings_update_motor(void); +extern void tux_wings_update_movements_remaining(void); +extern bool tux_wings_cmd_speed(unsigned char speed); +extern bool tux_wings_cmd_on(unsigned char counter, unsigned char final_state); +extern bool tux_wings_cmd_on_during(float timeout, unsigned char final_state); +extern bool tux_wings_cmd_up(void); +extern bool tux_wings_cmd_down(void); +extern bool tux_wings_cmd_off(void); + +#endif /* _TUX_WINGS_H_ */ Deleted: software_suite_v2/middleware/tuxdriver/trunk/src/tux_wings.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_wings.c 2008-07-01 16:32:24 UTC (rev 1291) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_wings.c 2008-07-02 07:04:25 UTC (rev 1292) @@ -1,177 +0,0 @@ -/* - * Tux Droid - Wings - * Copyright (C) 2008 C2ME Sa - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - */ - -#include <string.h> - -#include "tux_cmd_parser.h" -#include "tux_hw_status.h" -#include "tux_hw_cmd.h" -#include "tux_movements.h" -#include "tux_sw_status.h" -#include "tux_types.h" -#include "tux_usb.h" -#include "tux_wings.h" - -static unsigned char mvmt_counter = 0; - -/** - * - */ -LIBLOCAL void -tux_wings_update_position(void) -{ - char *new_position = ""; - - if (!hw_status_table.position2.wings_down) - { - new_position = STRING_VALUE_DOWN; - } - else - { - new_position = STRING_VALUE_UP; - } - - tux_sw_status_set_strvalue(SW_ID_WINGS_POSITION, new_position, true); -} - -/** - * Update the status of the motor state of the flippers. - */ -LIBLOCAL void -tux_wings_update_motor(void) -{ - unsigned char new_state; - - new_state = hw_status_table.position2.motors.bits.flippers_on; - tux_sw_status_set_intvalue(SW_ID_FLIPPERS_MOTOR_ON, new_state, true); -} - -/** - * - */ -LIBLOCAL void -tux_wings_update_movements_remaining(void) -{ - unsigned char new_count; - - new_count = hw_status_table.position1.wings_remaining_mvm; - - mvmt_counter = new_count; - tux_sw_status_set_intvalue(SW_ID_WINGS_REMAINING_MVM, new_count, true); -} - -/** - * - */ -LIBLOCAL bool -tux_wings_cmd_speed(unsigned char speed) -{ - return tux_movement_perform(MOVE_FLIPPERS, 0, 0.0, speed, - FINAL_ST_UNDEFINED, true); -} - -/** - * - */ -LIBLOCAL bool -tux_wings_cmd_on(unsigned char counter, unsigned char final_state) -{ - return tux_movement_cmd_on(MOVE_FLIPPERS, counter, final_state); -} - -/** - * - */ -LIBLOCAL bool -tux_wings_cmd_on_during(float timeout, unsigned char final_state) -{ - bool ret; - data_frame frame = {WINGS_WAVE_CMD, 0, 5, 0}; - delay_cmd_t cmd = { 0.0, TUX_CMD, WINGS }; - - /* Short movements */ - if (timeout < 0.3) - { - return tux_movement_perform(MOVE_FLIPPERS, 0, timeout, 5, final_state, - false); - } - - /* Long movements */ - ret = tux_usb_send_to_tux(frame); - if (!ret) - { - return false; - } - - mvmt_counter = 255; - tux_sw_status_set_intvalue(SW_ID_WINGS_REMAINING_MVM, mvmt_counter, true); - - switch (final_state) { - case FINAL_ST_UNDEFINED: - cmd.sub_command = OFF; - break; - case FINAL_ST_OPEN_UP: - cmd.sub_command = UP; - break; - case FINAL_ST_CLOSE_DOWN: - cmd.sub_command = DOWN; - break; - case FINAL_ST_STOP: - cmd.sub_command = OFF; - break; - } - ret = tux_cmd_parser_insert_sys_command(timeout, &cmd); - - return ret; -} - -/** - * - */ -LIBLOCAL bool -tux_wings_cmd_up(void) -{ - return tux_movement_perform(MOVE_FLIPPERS, 0, 0, 5, FINAL_ST_OPEN_UP, false); -} - -/** - * - */ -LIBLOCAL bool -tux_wings_cmd_down(void) -{ - return tux_movement_perform(MOVE_FLIPPERS, 0, 0, 5, FINAL_ST_CLOSE_DOWN, false); -} - -/** - * - */ -LIBLOCAL bool -tux_wings_cmd_off(void) -{ - bool ret; - - tux_cmd_parser_clean_sys_command(WINGS); - ret = tux_movement_perform(MOVE_FLIPPERS, 0, 0, 5, FINAL_ST_STOP, false); - mvmt_counter = 0; - tux_sw_status_set_intvalue(SW_ID_WINGS_REMAINING_MVM, mvmt_counter, true); - - return ret; -} Deleted: software_suite_v2/middleware/tuxdriver/trunk/src/tux_wings.h =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_wings.h 2008-07-01 16:32:24 UTC (rev 1291) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_wings.h 2008-07-02 07:04:25 UTC (rev 1292) @@ -1,39 +0,0 @@ -/* - * Tux Droid - Wings - * Copyright (C) 2008 C2ME Sa - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - */ - -#ifndef _TUX_WINGS_H_ -#define _TUX_WINGS_H_ - -#include <stdbool.h> - -#define TUX_WINGS_POSITION_DOWN 0 -#define TUX_WINGS_POSITION_UP 1 - -extern void tux_wings_update_position(void); -extern void tux_wings_update_motor(void); -extern void tux_wings_update_movements_remaining(void); -extern bool tux_wings_cmd_speed(unsigned char speed); -extern bool tux_wings_cmd_on(unsigned char counter, unsigned char final_state); -extern bool tux_wings_cmd_on_during(float timeout, unsigned char final_state); -extern bool tux_wings_cmd_up(void); -extern bool tux_wings_cmd_down(void); -extern bool tux_wings_cmd_off(void); - -#endif /* _TUX_WINGS_H_ */ Modified: software_suite_v2/middleware/tuxdriver/trunk/unix/Makefile =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/unix/Makefile 2008-07-01 16:32:24 UTC (rev 1291) +++ software_suite_v2/middleware/tuxdriver/trunk/unix/Makefile 2008-07-02 07:04:25 UTC (rev 1292) @@ -38,7 +38,7 @@ $(OBJ_DIR)/tux_sw_status.o \ $(OBJ_DIR)/tux_usb.o \ $(OBJ_DIR)/tux_user_inputs.o \ - $(OBJ_DIR)/tux_wings.o \ + $(OBJ_DIR)/tux_flippers.o \ $(OBJ_DIR)/log.o @@ -95,7 +95,7 @@ ../src/tux_error.h \ ../src/tux_eyes.h \ ../src/tux_mouth.h \ -../src/tux_wings.h \ +../src/tux_flippers.h \ ../src/tux_spinning.h \ ../src/tux_user_inputs.h \ ../src/tux_leds.h \ @@ -112,7 +112,7 @@ ../src/tux_firmware.h \ ../src/tux_sound_flash.h \ ../src/tux_id.h \ -../src/tux_wings.h \ +../src/tux_flippers.h \ ../src/tux_spinning.h \ ../src/tux_user_inputs.h \ ../src/tux_mouth.h \ @@ -303,7 +303,7 @@ ../src/tux_user_inputs.h $(compile_source) -$(OBJ_DIR)/tux_wings.o: ../src/tux_wings.c \ +$(OBJ_DIR)/tux_flippers.o: ../src/tux_flippers.c \ ../src/tux_hw_status.h \ ../src/tux_sw_status.h \ ../src/tux_misc.h \ @@ -311,7 +311,7 @@ ../src/tux_error.h \ ../src/tux_cmd_parser.h \ ../src/tux_movements.h \ -../src/tux_wings.h +../src/tux_flippers.h $(compile_source) $(OBJ_DIR)/log.o: ../src/log.c \ Modified: software_suite_v2/middleware/tuxdriver/trunk/win32/Makefile =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/win32/Makefile 2008-07-01 16:32:24 UTC (rev 1291) +++ software_suite_v2/middleware/tuxdriver/trunk/win32/Makefile 2008-07-02 07:04:25 UTC (rev 1292) @@ -41,7 +41,7 @@ $(OBJ_DIR)/tux_sw_status.o \ $(OBJ_DIR)/tux_usb.o \ $(OBJ_DIR)/tux_user_inputs.o \ - $(OBJ_DIR)/tux_wings.o \ + $(OBJ_DIR)/tux_flippers.o \ $(OBJ_DIR)/log.o define build_target @@ -90,7 +90,7 @@ ../src/tux_error.h \ ../src/tux_eyes.h \ ../src/tux_mouth.h \ -../src/tux_wings.h \ +../src/tux_flippers.h \ ../src/tux_spinning.h \ ../src/tux_user_inputs.h \ ../src/tux_leds.h \ @@ -107,7 +107,7 @@ ../src/tux_firmware.h \ ../src/tux_sound_flash.h \ ../src/tux_id.h \ -../src/tux_wings.h \ +../src/tux_flippers.h \ ../src/tux_spinning.h \ ../src/tux_user_inputs.h \ ../src/tux_mouth.h \ @@ -298,7 +298,7 @@ ../src/tux_user_inputs.h $(compile_source) -$(OBJ_DIR)/tux_wings.o: ../src/tux_wings.c \ +$(OBJ_DIR)/tux_flippers.o: ../src/tux_flippers.c \ ../src/tux_hw_status.h \ ../src/tux_sw_status.h \ ../src/tux_misc.h \ @@ -306,7 +306,7 @@ ../src/tux_error.h \ ../src/tux_cmd_parser.h \ ../src/tux_movements.h \ -../src/tux_wings.h +../src/tux_flippers.h $(compile_source) $(OBJ_DIR)/log.o: ../src/log.c \ |
From: remi <c2m...@c2...> - 2008-07-01 16:32:21
|
Author: remi Date: 2008-07-01 18:32:24 +0200 (Tue, 01 Jul 2008) New Revision: 1291 Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_driver.c software_suite_v2/middleware/tuxdriver/trunk/src/tux_eyes.c software_suite_v2/middleware/tuxdriver/trunk/src/tux_eyes.h software_suite_v2/middleware/tuxdriver/trunk/src/tux_mouth.c software_suite_v2/middleware/tuxdriver/trunk/src/tux_mouth.h software_suite_v2/middleware/tuxdriver/trunk/src/tux_spinning.c software_suite_v2/middleware/tuxdriver/trunk/src/tux_spinning.h software_suite_v2/middleware/tuxdriver/trunk/src/tux_wings.c software_suite_v2/middleware/tuxdriver/trunk/src/tux_wings.h Log: * added the events for the motor statuses. * updated the "off" function for eyes, mouth, flippers and spinning Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_driver.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_driver.c 2008-07-01 14:49:24 UTC (rev 1290) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_driver.c 2008-07-01 16:32:24 UTC (rev 1291) @@ -148,6 +148,11 @@ { tux_wings_update_position(); tux_spinning_update_movements_remaining(); + tux_eyes_update_motor(); + tux_mouth_update_motor(); + tux_wings_update_motor(); + tux_spinning_update_left_motor(); + tux_spinning_update_right_motor(); } break; case FRAME_HEADER_SENSORS1: Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_eyes.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_eyes.c 2008-07-01 14:49:24 UTC (rev 1290) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_eyes.c 2008-07-01 16:32:24 UTC (rev 1291) @@ -60,6 +60,18 @@ } /** + * Update the status of the motor state of the eyes. + */ +LIBLOCAL void +tux_eyes_update_motor(void) +{ + unsigned char new_state; + + new_state = hw_status_table.position2.motors.bits.eyes_on; + tux_sw_status_set_intvalue(SW_ID_EYES_MOTOR_ON, new_state, true); +} + +/** * Update the status of the eyes movements remaining. */ LIBLOCAL void @@ -155,16 +167,7 @@ bool ret; tux_cmd_parser_clean_sys_command(EYES); - - if (mvmt_counter == 0) - { - ret = tux_movement_perform(MOVE_EYES, 0, 0, 5, FINAL_ST_STOP, false); - } - else - { - ret = tux_movement_cmd_on(MOVE_EYES, 1, FINAL_ST_UNDEFINED); - } - + ret = tux_movement_perform(MOVE_EYES, 0, 0, 5, FINAL_ST_STOP, false); mvmt_counter = 0; tux_sw_status_set_intvalue(SW_ID_EYES_REMAINING_MVM, mvmt_counter, true); Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_eyes.h =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_eyes.h 2008-07-01 14:49:24 UTC (rev 1290) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_eyes.h 2008-07-01 16:32:24 UTC (rev 1291) @@ -26,6 +26,7 @@ #define TUX_EYES_POSITION_CLOSE 2 extern void tux_eyes_update_position(void); +extern void tux_eyes_update_motor(void); extern void tux_eyes_update_movements_remaining(void); extern bool tux_eyes_cmd_on(unsigned char counter, unsigned char final_state); extern bool tux_eyes_cmd_on_during(float timeout, unsigned char final_state); Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_mouth.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_mouth.c 2008-07-01 14:49:24 UTC (rev 1290) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_mouth.c 2008-07-01 16:32:24 UTC (rev 1291) @@ -60,6 +60,18 @@ } /** + * Update the status of the motor state of the mouth. + */ +LIBLOCAL void +tux_mouth_update_motor(void) +{ + unsigned char new_state; + + new_state = hw_status_table.position2.motors.bits.mouth_on; + tux_sw_status_set_intvalue(SW_ID_MOUTH_MOTOR_ON, new_state, true); +} + +/** * */ LIBLOCAL void @@ -156,16 +168,7 @@ bool ret; tux_cmd_parser_clean_sys_command(MOUTH); - - if (mvmt_counter == 0) - { - ret = tux_movement_perform(MOVE_MOUTH, 0, 0, 5, FINAL_ST_STOP, false); - } - else - { - ret = tux_movement_cmd_on(MOVE_MOUTH, 1, FINAL_ST_UNDEFINED); - } - + ret = tux_movement_perform(MOVE_MOUTH, 0, 0, 5, FINAL_ST_STOP, false); mvmt_counter = 0; tux_sw_status_set_intvalue(SW_ID_MOUTH_REMAINING_MVM, mvmt_counter, true); Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_mouth.h =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_mouth.h 2008-07-01 14:49:24 UTC (rev 1290) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_mouth.h 2008-07-01 16:32:24 UTC (rev 1291) @@ -28,6 +28,7 @@ #define TUX_MOUTH_POSITION_CLOSE 2 extern void tux_mouth_update_position(void); +extern void tux_mouth_update_motor(void); extern void tux_mouth_update_movements_remaining(void); extern bool tux_mouth_cmd_on(unsigned char counter, unsigned char final_state); extern bool tux_mouth_cmd_on_during(float timeout, unsigned char final_state); Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_spinning.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_spinning.c 2008-07-01 14:49:24 UTC (rev 1290) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_spinning.c 2008-07-01 16:32:24 UTC (rev 1291) @@ -63,6 +63,30 @@ } /** + * Update the status of the motor state of the left spin. + */ +LIBLOCAL void +tux_spinning_update_left_motor(void) +{ + unsigned char new_state; + + new_state = hw_status_table.position2.motors.bits.spin_left_on; + tux_sw_status_set_intvalue(SW_ID_SPIN_LEFT_MOTOR_ON, new_state, true); +} + +/** + * Update the status of the motor state of the right spin. + */ +LIBLOCAL void +tux_spinning_update_right_motor(void) +{ + unsigned char new_state; + + new_state = hw_status_table.position2.motors.bits.spin_right_on; + tux_sw_status_set_intvalue(SW_ID_SPIN_RIGHT_MOTOR_ON, new_state, true); +} + +/** * */ LIBLOCAL void @@ -129,9 +153,6 @@ return tux_movement_perform(movement, 0, timeout, 5, FINAL_ST_UNDEFINED, false); } - - mvmt_counter = 255; - tux_sw_status_set_intvalue(SW_ID_SPINNING_REMAINING_MVM, mvmt_counter, true); /* Long movements */ ret = tux_usb_send_to_tux(frame); @@ -140,6 +161,9 @@ return false; } + mvmt_counter = 255; + tux_sw_status_set_intvalue(SW_ID_SPINNING_REMAINING_MVM, mvmt_counter, true); + ret = tux_cmd_parser_insert_sys_command(timeout, &cmd); return ret; @@ -172,16 +196,7 @@ bool ret; tux_cmd_parser_clean_sys_command(SPINNING); - - if (mvmt_counter == 0) - { - ret = tux_movement_perform(MOVE_SPIN_R, 0, 0, 5, FINAL_ST_STOP, false); - } - else - { - ret = tux_movement_cmd_on(MOVE_SPIN_R, 1, FINAL_ST_UNDEFINED); - } - + ret = tux_movement_perform(MOVE_SPIN_R, 0, 0, 5, FINAL_ST_STOP, false); mvmt_counter = 0; tux_sw_status_set_intvalue(SW_ID_SPINNING_REMAINING_MVM, mvmt_counter, true); Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_spinning.h =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_spinning.h 2008-07-01 14:49:24 UTC (rev 1290) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_spinning.h 2008-07-01 16:32:24 UTC (rev 1291) @@ -28,6 +28,8 @@ #define TUX_SPINNING_DIRECTION_RIGHT 2 extern void tux_spinning_update_direction(void); +extern void tux_spinning_update_left_motor(void); +extern void tux_spinning_update_right_motor(void); extern void tux_spinning_update_movements_remaining(void); extern bool tux_spinning_cmd_speed(unsigned char speed); Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_wings.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_wings.c 2008-07-01 14:49:24 UTC (rev 1290) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_wings.c 2008-07-01 16:32:24 UTC (rev 1291) @@ -52,6 +52,18 @@ } /** + * Update the status of the motor state of the flippers. + */ +LIBLOCAL void +tux_wings_update_motor(void) +{ + unsigned char new_state; + + new_state = hw_status_table.position2.motors.bits.flippers_on; + tux_sw_status_set_intvalue(SW_ID_FLIPPERS_MOTOR_ON, new_state, true); +} + +/** * */ LIBLOCAL void @@ -157,16 +169,7 @@ bool ret; tux_cmd_parser_clean_sys_command(WINGS); - - if (mvmt_counter == 0) - { - ret = tux_movement_perform(MOVE_FLIPPERS, 0, 0, 5, FINAL_ST_STOP, false); - } - else - { - ret = tux_movement_cmd_on(MOVE_FLIPPERS, 1, FINAL_ST_UNDEFINED); - } - + ret = tux_movement_perform(MOVE_FLIPPERS, 0, 0, 5, FINAL_ST_STOP, false); mvmt_counter = 0; tux_sw_status_set_intvalue(SW_ID_WINGS_REMAINING_MVM, mvmt_counter, true); Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_wings.h =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_wings.h 2008-07-01 14:49:24 UTC (rev 1290) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_wings.h 2008-07-01 16:32:24 UTC (rev 1291) @@ -27,6 +27,7 @@ #define TUX_WINGS_POSITION_UP 1 extern void tux_wings_update_position(void); +extern void tux_wings_update_motor(void); extern void tux_wings_update_movements_remaining(void); extern bool tux_wings_cmd_speed(unsigned char speed); extern bool tux_wings_cmd_on(unsigned char counter, unsigned char final_state); |
From: jaguarondi <c2m...@c2...> - 2008-07-01 14:49:21
|
Author: jaguarondi Date: 2008-07-01 16:49:24 +0200 (Tue, 01 Jul 2008) New Revision: 1290 Modified: firmware/rf/trunk/Makefile firmware/rf/trunk/device.c Log: * Fixed the jump for the bootloader. Modified: firmware/rf/trunk/Makefile =================================================================== --- firmware/rf/trunk/Makefile 2008-07-01 08:39:18 UTC (rev 1289) +++ firmware/rf/trunk/Makefile 2008-07-01 14:49:24 UTC (rev 1290) @@ -7,6 +7,15 @@ CC = avr-gcc AVRDUDE = avrdude +#Bootloader can be included with the program. If you keep the bootloader +#already in the RF board, set this to 0. +#CAUTION: don't set this to 1 if you want to reprogram the RF board with +#tuxup, you may use a wrong rjump to the bootloader and brick your board. You +#need an ISP programmer if you intend to play with the bootloader. +#As of now, only GCC 3.4.6 seems to compile the bootlodaer so that it fits in +#the 256 bytes section. 4.x generates code slightly too large to fit in. +BOOTLOADER=0 + ## Options common to compile, link and assembly rules COMMON = -mmcu=$(MCU) @@ -14,6 +23,7 @@ CFLAGS = $(COMMON) CFLAGS += -Wall -gstabs -DF_CPU=13824000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums CFLAGS += -MD -MP -MT $(*F).o -MF dep/$(@F).d +CFLAGS += -DBOOTLOADER=$(BOOTLOADER) ifneq (,$(findstring master, $(TYPE))) PROJECT = fuxrf CFLAGS += -D_MASTER @@ -32,7 +42,7 @@ ## Linker flags LDFLAGS = $(COMMON) -LDFLAGS += -Wl,--section-start=.bootloader=0x0F00 -Wl,--section-start=.version=0x0EF0 rf.ld +LDFLAGS += -Wl,--section-start=.bootloader=0x0F00 -Wl,--section-start=.version=0x0EF0 -Wl,--defsym=bootloader_start=0x0F0A rf.ld ## Intel Hex file production flags HEX_FLASH_FLAGS = -R .eeprom @@ -42,7 +52,11 @@ HEX_EEPROM_FLAGS += --change-section-lma .eeprom=0 ## Objects that must be built in order to link +ifeq ($(BOOTLOADER),1) OBJECTS = device.o init.o misc.o prot.o rf_ctrl.o varis.o interface.o bootloader.o +else +OBJECTS = device.o init.o misc.o prot.o rf_ctrl.o varis.o interface.o +endif ## Objects explicitly added by the user LINKONLYOBJECTS = Modified: firmware/rf/trunk/device.c =================================================================== --- firmware/rf/trunk/device.c 2008-07-01 08:39:18 UTC (rev 1289) +++ firmware/rf/trunk/device.c 2008-07-01 14:49:24 UTC (rev 1290) @@ -70,8 +70,6 @@ const version_t tag_version __attribute__ ((section("version.1"))) = {VERSION_CMD, CPU_VER_JOIN(CPU_NUMBER, VER_MAJOR), VER_MINOR, VER_UPDATE}; -/* Bootloader can be included with the program */ -#define BOOTLOADER 1 /* Set to 1 to enable stack debugging. */ #define DBG_STACK 0 @@ -114,18 +112,31 @@ // 14 - 30 -> Payload * // 31 -> Checksum * //***************************************************************************** +typedef void (*AppPtr_t)(void); +const AppPtr_t RunBoot = (AppPtr_t) 0x0785; + int main(void) { -#if (BOOTLOADER) #ifdef _SLAVE volatile uint16_t _count=0; + /* Wait for the head button signal to rise if it isn't pressed. */ for (;_count<0xFFFF; _count++); - if (!(PIND & 0x40)) /* if head is pushed at startup */ - /* TODO change to a rjump to 0x0F0A */ - asm volatile ("rjmp bootloader" ::); /* jump to bootloader */ + /* If head is pushed at startup */ + if (!(PIND & 0x40)) + /* jump to bootloader */ +#if (BOOTLOADER) + asm volatile ("rjmp bootloader" ::); +#else + asm volatile ("rjmp bootloader_start" ::); +#endif #elif defined(_MASTER) - if (!(PINB & 0x04)) /* if SPI_SS is cleared at startup */ - asm volatile ("rjmp bootloader" ::); /* jump to bootloader */ + /* If SPI_SS is cleared at startup */ + if (!(PINB & 0x04)) + /* jump to bootloader */ +#if (BOOTLOADER) + asm volatile ("rjmp bootloader" ::); +#else + asm volatile ("rjmp bootloader_start" ::); #endif #endif |
From: remi <c2m...@c2...> - 2008-07-01 08:39:14
|
Author: remi Date: 2008-07-01 10:39:18 +0200 (Tue, 01 Jul 2008) New Revision: 1289 Modified: software_suite_v2/middleware/tuxdriver/trunk/include/tux_driver.h software_suite_v2/middleware/tuxdriver/trunk/include/tux_driver.pas software_suite_v2/middleware/tuxdriver/trunk/include/tux_driver.py software_suite_v2/middleware/tuxdriver/trunk/src/tux_sw_status.c software_suite_v2/middleware/tuxdriver/trunk/src/tux_sw_status.h Log: * added the motor statuses in the high level structures. Modified: software_suite_v2/middleware/tuxdriver/trunk/include/tux_driver.h =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/include/tux_driver.h 2008-07-01 08:20:59 UTC (rev 1288) +++ software_suite_v2/middleware/tuxdriver/trunk/include/tux_driver.h 2008-07-01 08:39:18 UTC (rev 1289) @@ -62,6 +62,11 @@ SW_ID_SOUND_REFLASH_BEGIN, SW_ID_SOUND_REFLASH_END, SW_ID_SOUND_REFLASH_CURRENT_TRACK, + SW_ID_EYES_MOTOR_ON, + SW_ID_MOUTH_MOTOR_ON, + SW_ID_FLIPPERS_MOTOR_ON, + SW_ID_SPIN_LEFT_MOTOR_ON, + SW_ID_SPIN_RIGHT_MOTOR_ON, } SW_ID_DRIVER; #if defined(__cplusplus) Modified: software_suite_v2/middleware/tuxdriver/trunk/include/tux_driver.pas =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/include/tux_driver.pas 2008-07-01 08:20:59 UTC (rev 1288) +++ software_suite_v2/middleware/tuxdriver/trunk/include/tux_driver.pas 2008-07-01 08:39:18 UTC (rev 1289) @@ -83,6 +83,11 @@ SW_ID_SOUND_REFLASH_BEGIN = 32; SW_ID_SOUND_REFLASH_END = 33; SW_ID_SOUND_REFLASH_CURRENT_TRACK = 34; + SW_ID_EYES_MOTOR_ON = 35; + SW_ID_MOUTH_MOTOR_ON = 36; + SW_ID_FLIPPERS_MOTOR_ON = 37; + SW_ID_SPIN_LEFT_MOTOR_ON = 38; + SW_ID_SPIN_RIGHT_MOTOR_ON = 39; type Modified: software_suite_v2/middleware/tuxdriver/trunk/include/tux_driver.py =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/include/tux_driver.py 2008-07-01 08:20:59 UTC (rev 1288) +++ software_suite_v2/middleware/tuxdriver/trunk/include/tux_driver.py 2008-07-01 08:39:18 UTC (rev 1289) @@ -66,6 +66,12 @@ SW_ID_DRIVER_SYMBOLIC_VERSION = 31 SW_ID_SOUND_REFLASH_BEGIN = 32 SW_ID_SOUND_REFLASH_END = 33 +SW_ID_SOUND_REFLASH_CURRENT_TRACK = 34 +SW_ID_EYES_MOTOR_ON = 35 +SW_ID_MOUTH_MOTOR_ON = 36 +SW_ID_FLIPPERS_MOTOR_ON = 37 +SW_ID_SPIN_LEFT_MOTOR_ON = 38 +SW_ID_SPIN_RIGHT_MOTOR_ON = 39 SW_NAME_DRIVER = [ "wings_position", @@ -101,7 +107,13 @@ "tuxrf_symbolic_version", "driver_symbolic_version", "sound_reflash_begin", - "sound_reflash_end" + "sound_reflash_end", + "sound_reflash_current_track", + "eyes_motor_on", + "mouth_motor_on", + "flippers_motor_on", + "spin_left_motor_on", + "spin_right_motor_on" ] LOG_LEVEL_DEBUG = 0 Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_sw_status.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_sw_status.c 2008-07-01 08:20:59 UTC (rev 1288) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_sw_status.c 2008-07-01 08:39:18 UTC (rev 1289) @@ -189,6 +189,21 @@ INIT_INTID(SW_ID_SOUND_REFLASH_CURRENT_TRACK, ID_FMT_UINT8, "sound_reflash_current_track", "range[0..255]", 0, 1) + + INIT_INTID(SW_ID_EYES_MOTOR_ON, ID_FMT_BOOL, + "eyes_motor_on", "False|True", 0, 1) + + INIT_INTID(SW_ID_MOUTH_MOTOR_ON, ID_FMT_BOOL, + "mouth_motor_on", "False|True", 0, 1) + + INIT_INTID(SW_ID_FLIPPERS_MOTOR_ON, ID_FMT_BOOL, + "flippers_motor_on", "False|True", 0, 1) + + INIT_INTID(SW_ID_SPIN_LEFT_MOTOR_ON, ID_FMT_BOOL, + "spin_left_motor_on", "False|True", 0, 1) + + INIT_INTID(SW_ID_SPIN_RIGHT_MOTOR_ON, ID_FMT_BOOL, + "spin_right_motor_on", "False|True", 0, 1) }; /** Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_sw_status.h =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_sw_status.h 2008-07-01 08:20:59 UTC (rev 1288) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_sw_status.h 2008-07-01 08:39:18 UTC (rev 1289) @@ -89,6 +89,11 @@ SW_ID_SOUND_REFLASH_BEGIN, SW_ID_SOUND_REFLASH_END, SW_ID_SOUND_REFLASH_CURRENT_TRACK, + SW_ID_EYES_MOTOR_ON, + SW_ID_MOUTH_MOTOR_ON, + SW_ID_FLIPPERS_MOTOR_ON, + SW_ID_SPIN_LEFT_MOTOR_ON, + SW_ID_SPIN_RIGHT_MOTOR_ON, SW_STATUS_NUMBER // SW_STATUS_NUMBER must be last and may not be removed !! } SW_ID; |
From: remi <c2m...@c2...> - 2008-07-01 08:20:51
|
Author: remi Date: 2008-07-01 10:20:59 +0200 (Tue, 01 Jul 2008) New Revision: 1288 Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_hw_status.c software_suite_v2/middleware/tuxdriver/trunk/src/tux_hw_status.h Log: * added the motor statuses in the low level structures and in the low level statuses parsing. Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_hw_status.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_hw_status.c 2008-07-01 07:51:25 UTC (rev 1287) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_hw_status.c 2008-07-01 08:20:59 UTC (rev 1288) @@ -334,9 +334,14 @@ { ret = FRAME_HEADER_POSITION2; } + if (hw_status_table.position2.motors.Byte != frame[3]) + { + ret = FRAME_HEADER_POSITION2; + } hw_status_table.position2.spin_remaining_mvm = frame[1]; hw_status_table.position2.wings_down = frame[2]; + hw_status_table.position2.motors.Byte = frame[3]; return ret; } Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_hw_status.h =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_hw_status.h 2008-07-01 07:51:25 UTC (rev 1287) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_hw_status.h 2008-07-01 08:20:59 UTC (rev 1288) @@ -204,6 +204,22 @@ typedef struct { + _BIT_ spin_left_on:1; + _BIT_ spin_right_on:1; + _BIT_ eyes_on:1; + _BIT_ mouth_on:1; + _BIT_ flippers_on:1; + _BIT_ ndef:3; +} _MOTORS_STATUS_BITS_; + +typedef union +{ + unsigned char Byte; + _MOTORS_STATUS_BITS_ bits; +} _MOTORS_STATUS_BYTE_; + +typedef struct +{ _PORTB_BYTE_ portb; _PORTC_BYTE_ portc; _PORTD_BYTE_ portd; @@ -232,9 +248,9 @@ typedef struct { - unsigned char spin_remaining_mvm; - unsigned char wings_down; - /*unsigned char ??; NDEF */ + unsigned char spin_remaining_mvm; + unsigned char wings_down; + _MOTORS_STATUS_BYTE_ motors; } frame_body_position2_t; typedef struct |
From: remi <c2m...@c2...> - 2008-07-01 07:51:16
|
Author: remi Date: 2008-07-01 09:51:25 +0200 (Tue, 01 Jul 2008) New Revision: 1287 Removed: software_suite_v2/middleware/tuxdriver/trunk/win32/compile.bat Log: * Removed the compile.bat file Deleted: software_suite_v2/middleware/tuxdriver/trunk/win32/compile.bat =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/win32/compile.bat 2008-07-01 07:43:17 UTC (rev 1286) +++ software_suite_v2/middleware/tuxdriver/trunk/win32/compile.bat 2008-07-01 07:51:25 UTC (rev 1287) @@ -1,7 +0,0 @@ -set MAKEPATH=E:\MinGWStudio\MinGW\bin\mingw32-make.exe -set OSLPATH=F:\Shared\Developpement\Boulot\svn_tuxisalive_com\software_suite_v2\middleware\tuxdriver\trunk - -C: -%MAKEPATH% -C %OSLPATH%\win32 -f %OSLPATH%\win32\Makefile -del /Q %OSLPATH%\obj\*.o -cmd \ No newline at end of file |
From: remi <c2m...@c2...> - 2008-07-01 07:43:09
|
Author: remi Date: 2008-07-01 09:43:17 +0200 (Tue, 01 Jul 2008) New Revision: 1286 Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_hw_status.c Log: * Changed the condition to show the statuses headers report. Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_hw_status.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_hw_status.c 2008-07-01 07:38:51 UTC (rev 1285) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_hw_status.c 2008-07-01 07:43:17 UTC (rev 1286) @@ -174,33 +174,29 @@ /* as there is only debug code in this for loop it might make sense to have a guarding ifdef around the for loop to save a few cycles */ - for (i = 0; i < 16; i++) + if (p_count >= 15) { - if ((tux_hw_status_header_counter[i] > 1) && (p_count > 12)) - { - log_debug("Frames counter (%d) :\n\t%s:[%d]\n\t%s:[%d]\n\ - \r\t%s:[%d]\n\t%s:[%d]\n\t%s:[%d]\n\t%s:[%d]\n\t%s:[%d]\n\ - \r\t%s:[%d]\n\t%s:[%d]\n\t%s:[%d]\n\t%s:[%d]\n\t%s:[%d]\n\ - \r\t%s:[%d]\n\t%s:[%d]\n\t%s:[%d]\n\t%s:[%d]\n", - p_count, - tux_hw_status_id_to_str(0), tux_hw_status_header_counter[0], - tux_hw_status_id_to_str(1), tux_hw_status_header_counter[1], - tux_hw_status_id_to_str(2), tux_hw_status_header_counter[2], - tux_hw_status_id_to_str(3), tux_hw_status_header_counter[3], - tux_hw_status_id_to_str(4), tux_hw_status_header_counter[4], - tux_hw_status_id_to_str(5), tux_hw_status_header_counter[5], - tux_hw_status_id_to_str(6), tux_hw_status_header_counter[6], - tux_hw_status_id_to_str(7), tux_hw_status_header_counter[7], - tux_hw_status_id_to_str(8), tux_hw_status_header_counter[8], - tux_hw_status_id_to_str(9), tux_hw_status_header_counter[9], - tux_hw_status_id_to_str(10), tux_hw_status_header_counter[10], - tux_hw_status_id_to_str(11), tux_hw_status_header_counter[11], - tux_hw_status_id_to_str(12), tux_hw_status_header_counter[12], - tux_hw_status_id_to_str(13), tux_hw_status_header_counter[13], - tux_hw_status_id_to_str(14), tux_hw_status_header_counter[14], - tux_hw_status_id_to_str(15), tux_hw_status_header_counter[15]); - break; - } + log_debug("Frames counter (%d) :\n\t%s:[%d]\n\t%s:[%d]\n\ + \r\t%s:[%d]\n\t%s:[%d]\n\t%s:[%d]\n\t%s:[%d]\n\t%s:[%d]\n\ + \r\t%s:[%d]\n\t%s:[%d]\n\t%s:[%d]\n\t%s:[%d]\n\t%s:[%d]\n\ + \r\t%s:[%d]\n\t%s:[%d]\n\t%s:[%d]\n\t%s:[%d]\n", + p_count, + tux_hw_status_id_to_str(0), tux_hw_status_header_counter[0], + tux_hw_status_id_to_str(1), tux_hw_status_header_counter[1], + tux_hw_status_id_to_str(2), tux_hw_status_header_counter[2], + tux_hw_status_id_to_str(3), tux_hw_status_header_counter[3], + tux_hw_status_id_to_str(4), tux_hw_status_header_counter[4], + tux_hw_status_id_to_str(5), tux_hw_status_header_counter[5], + tux_hw_status_id_to_str(6), tux_hw_status_header_counter[6], + tux_hw_status_id_to_str(7), tux_hw_status_header_counter[7], + tux_hw_status_id_to_str(8), tux_hw_status_header_counter[8], + tux_hw_status_id_to_str(9), tux_hw_status_header_counter[9], + tux_hw_status_id_to_str(10), tux_hw_status_header_counter[10], + tux_hw_status_id_to_str(11), tux_hw_status_header_counter[11], + tux_hw_status_id_to_str(12), tux_hw_status_header_counter[12], + tux_hw_status_id_to_str(13), tux_hw_status_header_counter[13], + tux_hw_status_id_to_str(14), tux_hw_status_header_counter[14], + tux_hw_status_id_to_str(15), tux_hw_status_header_counter[15]); } // use memset instead ? |
From: remi <c2m...@c2...> - 2008-07-01 07:38:43
|
Author: remi Date: 2008-07-01 09:38:51 +0200 (Tue, 01 Jul 2008) New Revision: 1285 Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_usb.c software_suite_v2/middleware/tuxdriver/trunk/src/tux_usb.h Log: * Added a check of the id frame which must be incremented after each request. To activate it, you must to define -DUSB_IDFRAME in the makefile. This check only work with a dongle which implement this counter ! The automatic reset of the RF after too many errors on this counter is disabled with the define -DUSB_DEBUG. * The automatic reset of the RF after too many empty frames can be disabled with the define -DUSB_DEBUG. Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_usb.c =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_usb.c 2008-07-01 07:32:16 UTC (rev 1284) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_usb.c 2008-07-01 07:38:51 UTC (rev 1285) @@ -41,7 +41,6 @@ static simple_callback_t loop_cycle_complete_function; static rf_state_callback_t rf_state_callback_function; static unsigned char last_knowed_rf_state = 0; -static int read_error_counter = 0; static char frame_status_request[5] = {1, 1, 0, 0, 0}; static char frame_reset_dongle[5] = {1, 1, 0, 0, 0xFE}; static char frame_reset_rf[5] = {1, 1, 0, 0, 0xFD}; @@ -60,6 +59,12 @@ static bool get_read_loop_started(void); static void read_usb_loop(void); +#ifdef USB_IDFRAME +static int id_frame_last = 999; +static int freezed_frame_cnt = 0; +#endif +static int empty_frame_cnt = 0; + /** * */ @@ -215,7 +220,11 @@ LIBLOCAL TuxUSBError tux_usb_capture(void) { - read_error_counter = 0; + empty_frame_cnt = 0; +#ifdef USB_IDFRAME + id_frame_last = 999; + freezed_frame_cnt = 0; +#endif if (!tux_hid_capture(TUX_VID, TUX_PID)) { @@ -303,28 +312,67 @@ int i, j; int rf_state; int packet_count; + int id_frame; char *data_buf; char packet_data[4]; + id_frame = data[0]; rf_state = data[1]; packet_count = data[3]; data_buf = (char *)data; data_buf += 4; - + +#ifdef USB_IDFRAME + /* Check if the frame is newer than the last received one */ + if (id_frame == id_frame_last) + { + freezed_frame_cnt++; + log_warning("The id of USB frame is the same than the previous [%d]", + freezed_frame_cnt); +#ifndef USB_DEBUG + if (freezed_frame_cnt >= TUX_USB_FREEZED_FRAMES_LIMIT) + { + freezed_frame_cnt = 0; + id_frame_last = 999; + log_error("The USB frame retriving seems to be freezed [%d]", + TUX_USB_FREEZED_FRAMES_LIMIT); + log_info("The RF connection will be reinitialized"); + tux_usb_rf_reset(); + } +#endif + return; + } + else + { + freezed_frame_cnt = 0; + id_frame_last = id_frame; + } +#endif + /* Having RF state to ON and no status frame is not normal */ if ((packet_count == 0) && (rf_state == 1)) { - read_error_counter++; - log_warning("Read errors count : %d", read_error_counter); - if (read_error_counter >= TUX_USB_ERROR_LIMIT) + empty_frame_cnt++; +#ifndef USB_DEBUG + if (empty_frame_cnt > 2) { - /* Reset of the RF */ + log_warning("Consecutive frames without status : %d", empty_frame_cnt); + } + if (empty_frame_cnt >= TUX_USB_ERROR_LIMIT) + { + log_error("DONGLE ERROR : Too many consecutive frames without status [%d], but the RF is online", + TUX_USB_ERROR_LIMIT); + empty_frame_cnt = 0; + log_info("The RF connection will be reinitialized"); tux_usb_rf_reset(); } +#else + log_warning("Consecutive frames without status : %d", empty_frame_cnt); +#endif } else { - read_error_counter = 0; + empty_frame_cnt = 0; } if (last_knowed_rf_state != rf_state) @@ -342,6 +390,12 @@ #endif } + if (packet_count > 15) + { + log_error("DONGLE ERROR : Statuses packets count is wrong (>15)"); + return; + } + for (i = 0; i < packet_count; i++) { for (j = 0; j < 4; j++) @@ -488,6 +542,8 @@ { usleep(1000); } + + current_timeout = get_time(); } set_read_loop_started(false); Modified: software_suite_v2/middleware/tuxdriver/trunk/src/tux_usb.h =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/src/tux_usb.h 2008-07-01 07:32:16 UTC (rev 1284) +++ software_suite_v2/middleware/tuxdriver/trunk/src/tux_usb.h 2008-07-01 07:38:51 UTC (rev 1285) @@ -26,18 +26,13 @@ #include "tux_misc.h" -#define TUX_PID 0xFF07 -#define TUX_VID 0x03EB -#define TUX_INTERFACE 0x03 -#define TUX_SEND_LENGTH 0x05 -#define TUX_RECEIVE_LENGTH 64 -#define TUX_WRITE_EP 0x05 -#define TUX_READ_EP 0x84 -#define TUX_WRITE_TIMEOUT 1000 -#define TUX_READ_TIMEOUT 1000 -#define TUX_READ_LOOP_INTERVAL 0.1 -#define TUX_USB_ERROR_LIMIT 10 -#define MIN_FIRMWARE_VERSION 0x030 +#define TUX_PID 0xFF07 +#define TUX_VID 0x03EB +#define TUX_SEND_LENGTH 5 +#define TUX_RECEIVE_LENGTH 64 +#define TUX_READ_LOOP_INTERVAL 0.1 +#define TUX_USB_ERROR_LIMIT 20 +#define TUX_USB_FREEZED_FRAMES_LIMIT 10 #ifdef WIN32 # define usb_busses usb_get_busses() |
From: remi <c2m...@c2...> - 2008-07-01 07:32:12
|
Author: remi Date: 2008-07-01 09:32:16 +0200 (Tue, 01 Jul 2008) New Revision: 1284 Modified: software_suite_v2/middleware/tuxdriver/trunk/win32/Makefile Log: * changed makefile. Syntax work now in the MSYS env. Modified: software_suite_v2/middleware/tuxdriver/trunk/win32/Makefile =================================================================== --- software_suite_v2/middleware/tuxdriver/trunk/win32/Makefile 2008-06-30 14:26:38 UTC (rev 1283) +++ software_suite_v2/middleware/tuxdriver/trunk/win32/Makefile 2008-07-01 07:32:16 UTC (rev 1284) @@ -1,14 +1,14 @@ -################################################################# -## This Makefile Exported by MinGW Developer Studio -## Copyright (c) 2002-2004 by Parinya Thipchart -################################################################# - +# +# You can use this makefile in the MSYS environement with MinGW installed. +# This soft need the windows DDK. +# Please change the "C_INCLUDE_DIRS" variable with you DDK path. +# PROJECT = libtuxdriver.dll -CC = "E:\MinGWStudio\MinGW\bin\gcc.exe" -OBJ_DIR = ..\obj -OUTPUT_DIR = ..\win32 +CC = gcc +OBJ_DIR = ../obj +OUTPUT_DIR = ../win32 TARGET = libtuxdriver.dll -C_INCLUDE_DIRS = -I"E:\MinGWStudio\MinGW\include\ddk" +C_INCLUDE_DIRS = -I C:/MinGWStudio/MinGW/include/ddk C_PREPROC = CFLAGS = -pipe -DUSE_MUTEX -Wall -g2 -O0 RC_INCLUDE_DIRS = @@ -16,14 +16,8 @@ RCFLAGS = LIB_DIRS = LIBS = -lwinmm -lhid -lsetupapi -lhidparse -LDFLAGS = -pipe -shared -Wl,--output-def,"$(OUTPUT_DIR)\libtuxdriver.def",--out-implib,"$(OUTPUT_DIR)\libtuxdriver.a" +LDFLAGS = -pipe -shared -Wl,--output-def,$(OUTPUT_DIR)/libtuxdriver.def,--out-implib,$(OUTPUT_DIR)/libtuxdriver.a -ifeq ($(OS),Windows_NT) - NULL = -else - NULL = nul -endif - SRC_OBJS = \ $(OBJ_DIR)/tux_battery.o \ $(OBJ_DIR)/tux_cmd_parser.o \ @@ -65,26 +59,18 @@ $(TARGET): print_header directories $(SRC_OBJS) $(build_target) -.PHONY: clean cleanall +.PHONY: clean -cleanall: - @echo Deleting intermediate files for 'libtuxdriver.dll' - -@del $(OBJ_DIR)\*.o - -@del "$(OUTPUT_DIR)\$(TARGET)" - -@del "$(OBJ_DIR)\$(PROJECT).def" - -@del "$(OBJ_DIR)\lib$(PROJECT).dll.a" - -@rmdir "$(OUTPUT_DIR)" - clean: @echo Deleting intermediate files for 'libtuxdriver.dll' - -@del $(OBJ_DIR)\*.o + -@rm -fR $(OBJ_DIR)/* print_header: @echo ----------Configuration: tux_driver.dll---------- directories: - -@if not exist "$(OUTPUT_DIR)\$(NULL)" mkdir "$(OUTPUT_DIR)" - -@if not exist "$(OBJ_DIR)\$(NULL)" mkdir "$(OBJ_DIR)" + -@if [ ! -d "$(OUTPUT_DIR)" ]; then mkdir "$(OUTPUT_DIR)"; fi + -@if [ ! -d "$(OBJ_DIR)" ]; then mkdir "$(OBJ_DIR)"; fi $(OBJ_DIR)/tux_battery.o: ../src/tux_battery.c \ ../src/tux_hw_status.h \ @@ -326,4 +312,3 @@ $(OBJ_DIR)/log.o: ../src/log.c \ ../src/log.h $(compile_source) - |
From: jaguarondi <c2m...@c2...> - 2008-06-30 14:26:35
|
Author: jaguarondi Date: 2008-06-30 16:26:38 +0200 (Mon, 30 Jun 2008) New Revision: 1283 Modified: firmware/rf/trunk/device.c firmware/rf/trunk/init.c firmware/rf/trunk/rf_ctrl.c Log: * Added some comments for future work. Modified: firmware/rf/trunk/device.c =================================================================== --- firmware/rf/trunk/device.c 2008-06-30 09:47:23 UTC (rev 1282) +++ firmware/rf/trunk/device.c 2008-06-30 14:26:38 UTC (rev 1283) @@ -110,7 +110,7 @@ // 6 - 7 -> Sync * // 8 - 11 -> SOF * // 12 -> LEN * -// 13 -> Command * +// 13 -> Command * // 14 - 30 -> Payload * // 31 -> Checksum * //***************************************************************************** @@ -121,6 +121,7 @@ volatile uint16_t _count=0; for (;_count<0xFFFF; _count++); if (!(PIND & 0x40)) /* if head is pushed at startup */ + /* TODO change to a rjump to 0x0F0A */ asm volatile ("rjmp bootloader" ::); /* jump to bootloader */ #elif defined(_MASTER) if (!(PINB & 0x04)) /* if SPI_SS is cleared at startup */ Modified: firmware/rf/trunk/init.c =================================================================== --- firmware/rf/trunk/init.c 2008-06-30 09:47:23 UTC (rev 1282) +++ firmware/rf/trunk/init.c 2008-06-30 14:26:38 UTC (rev 1283) @@ -137,6 +137,7 @@ rf_buffer_tx[6] = rf_buffer_tx[7] = 0xFF ^ SCRAMBLE_BYTE; //Default setup of the rf_buffer_tx// /* XXX to be cleaned */ + /* TODO sof_ary can be a pointer to rf_buffer_tx[8] */ sof_ary[0] = TRX_CHANNEL; sof_ary[1] = 0x56; sof_ary[2] = 0xFF; @@ -146,7 +147,7 @@ rf_buffer_tx[10]=sof_ary[2]; rf_buffer_tx[11]=sof_ary[3]; - //generate dummy packet + /* TODO increase the frame size to add the previosu audio data */ rf_buffer_tx[12]=52; /* Number of bytes from here */ rf_buffer_tx[13]=0x55; rf_buffer_tx[14]=0x55; @@ -199,10 +200,6 @@ rf_buffer_tx[61]=0x55; rf_buffer_tx[62]=0x55; rf_buffer_tx[63]=0x34; /* Parity checksum manually calculated */ - - /*uint8_t i;*/ - /*for (i=13; i<63; i++)*/ - /*rf_buffer_tx[i] = 0x01;//1<<(i&7);*/ } Modified: firmware/rf/trunk/rf_ctrl.c =================================================================== --- firmware/rf/trunk/rf_ctrl.c 2008-06-30 09:47:23 UTC (rev 1282) +++ firmware/rf/trunk/rf_ctrl.c 2008-06-30 14:26:38 UTC (rev 1283) @@ -155,6 +155,7 @@ /* Request a SPI communication. */ /* XXX Should check here whether we're connected or not */ if (rf_status) + /* XXX I think we don't need this 'if' anymore */ { spi_request(); } @@ -428,6 +429,7 @@ /* Last data buffered. */ if(tmp == rf_buffer_tx[12] + 11) { + /* TODO this can be moved out of the if/else */ UDR0 = rf_buffer_tx[tmp] ^ SCRAMBLE_BYTE; //UDR0 = (0-checksum_tx) ^ SCRAMBLE_BYTE; /* Enable USART Transmit complete interrupt (SIG_USART_TRANS) and |