[tuxdroid-svn] r557 - in firmware: fuxrf/trunk tuxrf/trunk tuxrf/trunk/default
Status: Beta
Brought to you by:
ks156
From: jaguarondi <c2m...@c2...> - 2007-10-01 09:49:31
|
Author: jaguarondi Date: 2007-10-01 11:49:25 +0200 (Mon, 01 Oct 2007) New Revision: 557 Modified: firmware/fuxrf/trunk/device.c firmware/fuxrf/trunk/init.c firmware/fuxrf/trunk/misc.c firmware/fuxrf/trunk/prot.c firmware/fuxrf/trunk/rf_ctrl.c firmware/fuxrf/trunk/spi.c firmware/tuxrf/trunk/default/Makefile firmware/tuxrf/trunk/device.c firmware/tuxrf/trunk/init.c firmware/tuxrf/trunk/misc.c firmware/tuxrf/trunk/prot.c firmware/tuxrf/trunk/rf_ctrl.c firmware/tuxrf/trunk/sleep.c firmware/tuxrf/trunk/spi.c Log: * Slight changes on comments from the last modifications given by Pascal on 06/2007. Modified: firmware/fuxrf/trunk/device.c =================================================================== --- firmware/fuxrf/trunk/device.c 2007-10-01 09:27:39 UTC (rev 556) +++ firmware/fuxrf/trunk/device.c 2007-10-01 09:49:25 UTC (rev 557) @@ -40,9 +40,8 @@ //* 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 * +//* Date: 26.06.07 * +//* Description: Get connected to the tux, manage sleep mode and SPI * //***************************************************************************** //MASTER Modified: firmware/fuxrf/trunk/init.c =================================================================== --- firmware/fuxrf/trunk/init.c 2007-10-01 09:27:39 UTC (rev 556) +++ firmware/fuxrf/trunk/init.c 2007-10-01 09:49:25 UTC (rev 557) @@ -112,6 +112,17 @@ } +//***************************************************************************** +//* Project: RF-Firmware for ISM * +//* Function: init_frame_RF * +//* Parameters: NONE * +//* Returns: NONE * +//* Action: init of TX buffer and compute checksum * +//* Duration: tbd * +//* Size: tbd * +//* Date: 26.06.07 * +//* Description: Init the TX buffers with the starting values * +//***************************************************************************** void init_frame_RF (void) { unsigned char i, header_rf; Modified: firmware/fuxrf/trunk/misc.c =================================================================== --- firmware/fuxrf/trunk/misc.c 2007-10-01 09:27:39 UTC (rev 556) +++ firmware/fuxrf/trunk/misc.c 2007-10-01 09:49:25 UTC (rev 557) @@ -114,7 +114,7 @@ //***************************************************************************** //* Project: RF-Firmware for ISM * //* Function: calc_checksum * -//* Parameters: val * +//* Parameters: *pbuffer * //* Returns: NONE * //* Action: calc_checksum * //* Duration: tbd * Modified: firmware/fuxrf/trunk/prot.c =================================================================== --- firmware/fuxrf/trunk/prot.c 2007-10-01 09:27:39 UTC (rev 556) +++ firmware/fuxrf/trunk/prot.c 2007-10-01 09:49:25 UTC (rev 557) @@ -47,14 +47,14 @@ //***************************************************************************** //* Project: RF-Firmware for ISM * -//* Function: get_link * +//* Function: system_start_up * //* Parameters: NONE * //* Returns: NONE * -//* Action: connect to a base station, if possible * +//* Action: connect to tux if possible * //* Duration: tbd * //* Size: tbd * -//* Date: 10.07.06 * -//* Description: Synchronise to the Basestation and get logged into the system* +//* Date: 31.01.06 * +//* Description: Synchronise to the tux and get logged into the system * //***************************************************************************** void system_start_up(void) { @@ -109,14 +109,14 @@ //***************************************************************************** //* Project: RF-Firmware for ISM * -//* Function: get_link * +//* Function: setup_pac * //* Parameters: NONE * //* Returns: NONE * -//* Action: connect to a base station, if possible * +//* Action: Build correct RF frame * //* Duration: tbd * //* Size: tbd * -//* Date: XX.XX.XX * -//* Description: Synchronise to the Basestation and get logged into the system* +//* Date: 26.06.07 * +//* Description: Build RF packet and manage some protocol function * //***************************************************************************** void setup_pac (void) { Modified: firmware/fuxrf/trunk/rf_ctrl.c =================================================================== --- firmware/fuxrf/trunk/rf_ctrl.c 2007-10-01 09:27:39 UTC (rev 556) +++ firmware/fuxrf/trunk/rf_ctrl.c 2007-10-01 09:49:25 UTC (rev 557) @@ -14,14 +14,13 @@ //***************************************************************************** //* Project: RF-Firmware for ISM * //* Function: TIM1_COMPA_IRQ * -//* Parameters: None * -//* Global variable: None * +//* Parameters: NONE * //* Returns: None * //* Action: Generate Timing for ATR2406 * //* Duration:worsest case 31.25us * //* 3.8us to switch case!! * //* Size: tbd * -//* Date: XX.XX.XX * +//* Date: 26.06.07 * //* Description: State machine to generate all the needed timings for the * //* RF - Software flow. * //***************************************************************************** @@ -242,9 +241,8 @@ //***************************************************************************** //* Project: RF-Firmware for ISM * //* Function: start_rf_timer * -//* Parameters: None * -//* Global variable: None * -//* Returns: None * +//* Parameters: NONE * +//* Returns: NONE * //* Action: init Timer1 * //* Duration: tbd * //* Size: tbd * @@ -268,7 +266,7 @@ //* Function: init_atr2406 * //* Parameters: channel, mode * //* Global variable: gfilter * -//* Returns: None * +//* Returns: NONE * //* Action: Basic setup of ATR2406 * //* Duration: tbd * //* Size: tbd * @@ -330,9 +328,8 @@ //***************************************************************************** //* Project: RF-Firmware for ISM * //* Function: pwr_up_atr2406 * -//* Parameters: None * -//* Global variable: None * -//* Returns: None * +//* Parameters: NONE * +//* Returns: NONE * //* Action: power up RF chip * //* Duration: tbd * //* Size: tbd * @@ -356,9 +353,8 @@ //***************************************************************************** //* Project: RF-Firmware for ISM * //* Function: pwr_dwn_atr2406 * -//* Parameters: None * -//* Global variable : None * -//* Returns: None * +//* Parameters: NONE * +//* Returns: NONE * //* Action: power down RF chip * //* Duration: tbd * //* Size: tbd * Modified: firmware/fuxrf/trunk/spi.c =================================================================== --- firmware/fuxrf/trunk/spi.c 2007-10-01 09:27:39 UTC (rev 556) +++ firmware/fuxrf/trunk/spi.c 2007-10-01 09:49:25 UTC (rev 557) @@ -4,6 +4,17 @@ #include "varis.h" +//***************************************************************************** +//* Project: RF-Firmware for ISM * +//* Function: spiTransaction * +//* Parameters: NONE * +//* Returns: NONE * +//* Action: Manage the SPI transaction * +//* Duration: tbd * +//* Size: tbd * +//* Date: 26.06.07 * +//* Description: Send and receive sound / command via the SPI * +//***************************************************************************** void spiTransaction(void) { unsigned char headerb; // Header spi byte Modified: firmware/tuxrf/trunk/default/Makefile =================================================================== --- firmware/tuxrf/trunk/default/Makefile 2007-10-01 09:27:39 UTC (rev 556) +++ firmware/tuxrf/trunk/default/Makefile 2007-10-01 09:49:25 UTC (rev 557) @@ -22,7 +22,7 @@ ## Linker flags LDFLAGS = $(COMMON) -LDFLAGS += -Wl,--section-start=.bootloader=0x0F00 -Wl,--section-start=.version=0x0EF0 -Wl,-Map=device.map +LDFLAGS += -Wl,--section-start=.bootloader=0x0F00 -Wl,--section-start=.version=0x0EF0 -Wl,-Map=device.map LDFLAGS += -Wl,-section-start=.buffer_tx1=0x800100 LDFLAGS += -Wl,-section-start=.buffer_rx1=0x800140 LDFLAGS += -Wl,-section-start=.sof=0x8001e6 Modified: firmware/tuxrf/trunk/device.c =================================================================== --- firmware/tuxrf/trunk/device.c 2007-10-01 09:27:39 UTC (rev 556) +++ firmware/tuxrf/trunk/device.c 2007-10-01 09:49:25 UTC (rev 557) @@ -37,8 +37,7 @@ //* Duration: tbd * //* Size: tbd * //* Date: 31.01.06 * -//* Description: Get connected to the Basestation, get values from the sensors* -//* and digital I/O * +//* Description: Get connected to the dongle, manage sleep mode and SPI * //***************************************************************************** //SLAVE Modified: firmware/tuxrf/trunk/init.c =================================================================== --- firmware/tuxrf/trunk/init.c 2007-10-01 09:27:39 UTC (rev 556) +++ firmware/tuxrf/trunk/init.c 2007-10-01 09:49:25 UTC (rev 557) @@ -121,7 +121,7 @@ //* Function: init_toy_id * //* Parameters: NONE * //* Returns: NONE * -//* Action: init of the global variables * +//* Action: init or not the toy ID depending of context * //* Duration: tbd * //* Size: tbd * //* Date: 26.06.07 * @@ -149,11 +149,11 @@ //* Function: init_frame_RF * //* Parameters: NONE * //* Returns: NONE * -//* Action: init of the global variables * +//* Action: init of TX buffer and compute checksum * //* Duration: tbd * //* Size: tbd * //* Date: 26.06.07 * -//* Description: Init frame buffer * +//* Description: Init the TX buffers with the starting values * //***************************************************************************** void init_frame_RF (void) { Modified: firmware/tuxrf/trunk/misc.c =================================================================== --- firmware/tuxrf/trunk/misc.c 2007-10-01 09:27:39 UTC (rev 556) +++ firmware/tuxrf/trunk/misc.c 2007-10-01 09:49:25 UTC (rev 557) @@ -37,7 +37,7 @@ //***************************************************************************** //* Project: RF-Firmware for ISM * //* Function: calc_checksum * -//* Parameters: val * +//* Parameters: *pbuffer * //* Returns: NONE * //* Action: calc_checksum * //* Duration: tbd * Modified: firmware/tuxrf/trunk/prot.c =================================================================== --- firmware/tuxrf/trunk/prot.c 2007-10-01 09:27:39 UTC (rev 556) +++ firmware/tuxrf/trunk/prot.c 2007-10-01 09:49:25 UTC (rev 557) @@ -12,16 +12,16 @@ //* Function: system_start_up * //* Parameters: NONE * //* Returns: NONE * -//* Action: connect to a base station, if possible * +//* Action: connect to dongle if possible * //* Duration: tbd * //* Size: tbd * //* Date: 31.01.06 * -//* Description: Synchronise to the Basestation and get logged into the system* +//* Description: Synchronise to the dongle and get logged into the system * //***************************************************************************** void system_start_up(void) { unsigned char i, out, sleepCmpt; - unsigned char RFinitState = WAIT_LOG; // Init state machine variable + unsigned char RFinitState; // Init state machine variable ui_16 j; rf_status |= SLAVE; // Set rf status like slave @@ -158,10 +158,10 @@ //***************************************************************************** //* Project: RF-Firmware for ISM * -//* Function: get_link * +//* Function: setup_pac * //* Parameters: NONE * //* Returns: NONE * -//* Action: connect to a base station, if possible * +//* Action: Build correct RF frame * //* Duration: tbd * //* Size: tbd * //* Date: 26.06.07 * Modified: firmware/tuxrf/trunk/rf_ctrl.c =================================================================== --- firmware/tuxrf/trunk/rf_ctrl.c 2007-10-01 09:27:39 UTC (rev 556) +++ firmware/tuxrf/trunk/rf_ctrl.c 2007-10-01 09:49:25 UTC (rev 557) @@ -11,8 +11,8 @@ //***************************************************************************** //* Project: RF-Firmware for ISM * //* Function: TIM1_COMPA_IRQ * -//* Parameters: None * -//* Global variable : None * +//* Parameters: NONE * +//* Global variable : NONE * //* Returns: None * //* Action: Generate Timing for ATR2406 * //* Duration:worsest case 31.25us * @@ -202,9 +202,8 @@ //***************************************************************************** //* Project: RF-Firmware for ISM * //* Function: start_rf_timer * -//* Parameters: None * -//* Global variable: None * -//* Returns: None * +//* Parameters: NONE * +//* Returns: NONE * //* Action: init Timer1 * //* Duration: tbd * //* Size: tbd * @@ -226,9 +225,8 @@ //***************************************************************************** //* Project: RF-Firmware for ISM * //* Function: start_rf_timer_scanning * -//* Parameters: None * -//* Global variable: None * -//* Returns: None * +//* Parameters: NONE * +//* Returns: NONE * //* Action: init Timer1 for scanning * //* Duration: tbd * //* Size: tbd * @@ -252,7 +250,7 @@ //* Function: init_atr2406 * //* Parameters: channel, mode * //* Global variable: gfilter * -//* Returns: None * +//* Returns: NONE * //* Action: Basic setup of ATR2406 * //* Duration: tbd * //* Size: tbd * @@ -314,9 +312,8 @@ //***************************************************************************** //* Project: RF-Firmware for ISM * //* Function: pwr_up_atr2406 * -//* Parameters: None * -//* Global variable: None * -//* Returns: None * +//* Parameters: NONE * +//* Returns: NONE * //* Action: power up RF chip * //* Duration: tbd * //* Size: tbd * @@ -340,9 +337,8 @@ //***************************************************************************** //* Project: RF-Firmware for ISM * //* Function: pwr_dwn_atr2406 * -//* Parameters: None * -//* Global variable: None * -//* Returns: None * +//* Parameters: NONE * +//* Returns: NONE * //* Action: power down RF chip * //* Duration: tbd * //* Size: tbd * Modified: firmware/tuxrf/trunk/sleep.c =================================================================== --- firmware/tuxrf/trunk/sleep.c 2007-10-01 09:27:39 UTC (rev 556) +++ firmware/tuxrf/trunk/sleep.c 2007-10-01 09:49:25 UTC (rev 557) @@ -2,6 +2,18 @@ #include <util/delay.h> #include "varis.h" + +//***************************************************************************** +//* Project: RF-Firmware for ISM * +//* Function: resetCPU * +//* Parameters: NONE * +//* Returns: NONE * +//* Action: Reset the CPU * +//* Duration: tbd * +//* Size: tbd * +//* Date: 26.06.07 * +//* Description: Reset the CPU using the watchdog * +//***************************************************************************** void resetCPU (void) { wdt_reset (); // Reset the watchdog timer @@ -10,6 +22,17 @@ } +//***************************************************************************** +//* Project: RF-Firmware for ISM * +//* Function: goToSleep * +//* Parameters: NONE * +//* Returns: NONE * +//* Action: Go to sleep mode * +//* Duration: tbd * +//* Size: tbd * +//* Date: 26.06.07 * +//* Description: Configure type of sleep mode and execute it * +//***************************************************************************** void goToSleep (void) { if (((sleepMode == 0x01) || (sleepMode == 0x03)) && (commandStatus == 0))// Go to sleep @@ -35,6 +58,17 @@ } +//***************************************************************************** +//* Project: RF-Firmware for ISM * +//* Function: WATCHDOG_TIMEOUT * +//* Parameters: NONE * +//* Returns: NONE * +//* Action: Disable wathdog timer * +//* Duration: tbd * +//* Size: tbd * +//* Date: 26.06.07 * +//* Description: Interrupt to go out of sleep * +//***************************************************************************** SIGNAL (SIG_WATCHDOG_TIMEOUT) { WDTCSR &= ~0x40; // Desactivate watchdog interrupt Modified: firmware/tuxrf/trunk/spi.c =================================================================== --- firmware/tuxrf/trunk/spi.c 2007-10-01 09:27:39 UTC (rev 556) +++ firmware/tuxrf/trunk/spi.c 2007-10-01 09:49:25 UTC (rev 557) @@ -4,6 +4,17 @@ #include "varis.h" +//***************************************************************************** +//* Project: RF-Firmware for ISM * +//* Function: spiTransaction * +//* Parameters: NONE * +//* Returns: NONE * +//* Action: Manage the SPI transaction * +//* Duration: tbd * +//* Size: tbd * +//* Date: 26.06.07 * +//* Description: Send and receive sound / command via the SPI * +//***************************************************************************** void spiTransaction(void) { unsigned char headerb; // Header spi byte |