[tuxdroid-svn] r318 - in firmware: tuxaudio/trunk tuxcore/trunk tuxdefs tuxup/trunk
Status: Beta
Brought to you by:
ks156
From: jaguarondi <c2m...@c2...> - 2007-05-12 12:08:17
|
Author: jaguarondi Date: 2007-05-12 14:08:09 +0200 (Sat, 12 May 2007) New Revision: 318 Modified: firmware/tuxaudio/trunk/Makefile firmware/tuxaudio/trunk/communication.c firmware/tuxaudio/trunk/fifo.c firmware/tuxaudio/trunk/fifo.h firmware/tuxaudio/trunk/interrupt.c firmware/tuxaudio/trunk/spi.c firmware/tuxaudio/trunk/test.c firmware/tuxcore/trunk/Makefile firmware/tuxcore/trunk/communication.c firmware/tuxcore/trunk/fifo.c firmware/tuxcore/trunk/fifo.h firmware/tuxcore/trunk/ir.c firmware/tuxcore/trunk/ir.h firmware/tuxcore/trunk/motors.c firmware/tuxcore/trunk/motors.h firmware/tuxdefs/commands.h firmware/tuxup/trunk/bootloader.c firmware/tuxup/trunk/main.c firmware/tuxup/trunk/usb-connection.c firmware/tuxup/trunk/usb-connection.h Log: Removed trailing whitespaces in firmware. Modified: firmware/tuxaudio/trunk/Makefile =================================================================== --- firmware/tuxaudio/trunk/Makefile 2007-05-12 11:57:43 UTC (rev 317) +++ firmware/tuxaudio/trunk/Makefile 2007-05-12 12:08:09 UTC (rev 318) @@ -32,7 +32,7 @@ COMMON = -mmcu=$(MCU) # Place -D or -U options here -CDEFS = -DF_CPU=8000000UL -DMIC_GAIN=$(MIC_GAIN) +CDEFS = -DF_CPU=8000000UL -DMIC_GAIN=$(MIC_GAIN) # Place -I options here CINCS = @@ -46,7 +46,7 @@ CWARN = -Wall -Wstrict-prototypes CTUNING = -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums CFLAGS = $(COMMON) $(CDEBUG) $(CDEFS) $(CINCS) -O$(OPT) $(CWARN) $(CSTANDARD) $(CEXTRA) -CFLAGS += -MD -MP -MT $(*F).o -MF dep/$(@F).d +CFLAGS += -MD -MP -MT $(*F).o -MF dep/$(@F).d ## Assembly specific flags ASMFLAGS = $(COMMON) @@ -72,7 +72,7 @@ OBJECTS = init.o main.o varis.o fifo.o spi.o flash.o communication.o i2c.o config.o ## Objects explicitly added by the user -LINKONLYOBJECTS = +LINKONLYOBJECTS = ## Build all: svnrev.h $(TARGET) tuxaudio.hex tuxaudio.eep tuxaudio.lss size @@ -160,11 +160,11 @@ -include $(shell mkdir dep 2>/dev/null) $(wildcard dep/*) # Programming -prog: $(PROJECT).hex +prog: $(PROJECT).hex tuxup $(PROJECT).hex $(PROJECT).eep -progisp: $(PROJECT).hex +progisp: $(PROJECT).hex AVRDUDE -p $(MCU) -c jtag2isp -P usb -B 10 -e -U flash:w:$(PROJECT).hex -progstk: $(PROJECT).hex +progstk: $(PROJECT).hex AVRDUDE -p $(MCU) -c stk500v2 -e -U flash:w:$(PROJECT).hex Modified: firmware/tuxaudio/trunk/communication.c =================================================================== --- firmware/tuxaudio/trunk/communication.c 2007-05-12 11:57:43 UTC (rev 317) +++ firmware/tuxaudio/trunk/communication.c 2007-05-12 12:08:09 UTC (rev 318) @@ -98,7 +98,7 @@ * and send them by i2c. * * In order to protect this buffer of being corrupted by any modification in - * interrupts, a flag (i2cFlags.i2c_idx) is set during manipulations. + * interrupts, a flag (i2cFlags.i2c_idx) is set during manipulations. * * The i2c busy flag (i2cFlags.i2c_busy) is checked here to know if we can send * the next command. Modified: firmware/tuxaudio/trunk/fifo.c =================================================================== --- firmware/tuxaudio/trunk/fifo.c 2007-05-12 11:57:43 UTC (rev 317) +++ firmware/tuxaudio/trunk/fifo.c 2007-05-12 12:08:09 UTC (rev 318) @@ -36,25 +36,25 @@ All functions that use modulo usually use typecasts i.e. the following statement - + \code length = (p->inIdx - p->outIdx) % p->size; \endcode has a problem when (p->inIdx - p->outIdx) is <0. Then the modulus is not done, the return value is 0xF9 for example. This is due to the implicit promotion of the intermediate value to an int. - + "%" is a signed modulus, so -1 % 8 == -1. We need to trim down the intermediate result to a uint8_t result immediately so the modulus applies to a uint8_t otherwise the implicit promotion of a uint8_t argument to an int expression makes the expression signed and brake the code for the above reason. The correct expression is - + \code length = ((uint8_t)(p->inIdx - p->outIdx) % p->size); \endcode So forgetting the typecast not only makes the code much bigger, it also brake it when the intermediate result is negative. - + */ /** \name Accessors Modified: firmware/tuxaudio/trunk/fifo.h =================================================================== --- firmware/tuxaudio/trunk/fifo.h 2007-05-12 11:57:43 UTC (rev 317) +++ firmware/tuxaudio/trunk/fifo.h 2007-05-12 12:08:09 UTC (rev 318) @@ -93,7 +93,7 @@ /* * Adaptive parameters */ -/** \brief UD- Rate at which the adaptation is done. +/** \brief UD- Rate at which the adaptation is done. * * The adaptation function will only be run each 2^FIFO_ADAPT_RATE sample */ #define FIFO_ADAPT_RATE 1 /* adaptation is done each 2^FIFO_ADAPT_RATE sample */ Modified: firmware/tuxaudio/trunk/interrupt.c =================================================================== --- firmware/tuxaudio/trunk/interrupt.c 2007-05-12 11:57:43 UTC (rev 317) +++ firmware/tuxaudio/trunk/interrupt.c 2007-05-12 12:08:09 UTC (rev 318) @@ -23,7 +23,7 @@ #include <avr/interrupt.h> #include "varis.h" -// Timer 0 overflow interrupt service routine (PWM) +// Timer 0 overflow interrupt service routine (PWM) ISR(SIG_OVERFLOW0) { if (--sampling_pwm == 0) /* timer 0 is clocked at 32KHz so we divide it by 4 to get 8KHz */ @@ -32,7 +32,7 @@ //FIFOputMic (AudioRampCmpt); //AudioRampCmpt++; - sampling_pwm = 0x04; // Reinit + sampling_pwm = 0x04; // Reinit OCR0B = pullFifo(&PWMFifo); /* set the sample value to timer pulse width */ // adaptSpkFifo(); Modified: firmware/tuxaudio/trunk/spi.c =================================================================== --- firmware/tuxaudio/trunk/spi.c 2007-05-12 11:57:43 UTC (rev 317) +++ firmware/tuxaudio/trunk/spi.c 2007-05-12 12:08:09 UTC (rev 318) @@ -141,7 +141,7 @@ if (spi_master_config & 0x02) { cli(); - pushFifo(&PWMFifo, SPDR); // Put into the FIFO + pushFifo(&PWMFifo, SPDR); // Put into the FIFO sei(); } if (spi_count == (spi_lenght_data + 1)) @@ -154,7 +154,7 @@ if (spi_master_config & 0x80) spi_commandRX[spi_count - 36] = SPDR; // Put command into the buffer else - spi_commandRX[spi_count - 19] = SPDR; // Put command into the buffer + spi_commandRX[spi_count - 19] = SPDR; // Put command into the buffer } if (spi_count == spi_lenght_data + 6) { Modified: firmware/tuxaudio/trunk/test.c =================================================================== --- firmware/tuxaudio/trunk/test.c 2007-05-12 11:57:43 UTC (rev 317) +++ firmware/tuxaudio/trunk/test.c 2007-05-12 12:08:09 UTC (rev 318) @@ -42,31 +42,31 @@ write_enable (); PORTB &= ~0x02; // Chip Select SPDR = 0xAF; // Send Sequencial Program Command - while ((SPSR & 0x80) == 0); // Wait SPI response + while ((SPSR & 0x80) == 0); // Wait SPI response SPDR = ad2; // Send Address - while ((SPSR & 0x80) == 0); // Wait SPI response + while ((SPSR & 0x80) == 0); // Wait SPI response SPDR = ad1; - while ((SPSR & 0x80) == 0); // Wait SPI response + while ((SPSR & 0x80) == 0); // Wait SPI response SPDR = ad0; - while ((SPSR & 0x80) == 0); // Wait SPI response + while ((SPSR & 0x80) == 0); // Wait SPI response SPDR = 0x00; - while ((SPSR & 0x80) == 0); // Wait SPI response - PORTB |= 0x02; // Chip Deselect - while (read_status() != 0x10); // Wait Page Program Cycle + while ((SPSR & 0x80) == 0); // Wait SPI response + PORTB |= 0x02; // Chip Deselect + while (read_status() != 0x10); // Wait Page Program Cycle tmp = 1; for (i = 0; i < 15872; i++) { PORTB &= ~0x02; // Chip Select SPDR = 0xAF; // Send Sequencial Program Command while ((SPSR & 0x80) == 0); // Wait SPI response - SPDR = tmp; // Write data in flash + SPDR = tmp; // Write data in flash while ((SPSR & 0x80) == 0); // Wait SPI response - PORTB |= 0x02; // Chip DeselecT + PORTB |= 0x02; // Chip DeselecT tmp++; ad0++; // Increment address byte if (ad0 == 0x00) { - ad1++; + ad1++; if (ad1 == 0x00) ad2++; } Modified: firmware/tuxcore/trunk/Makefile =================================================================== --- firmware/tuxcore/trunk/Makefile 2007-05-12 11:57:43 UTC (rev 317) +++ firmware/tuxcore/trunk/Makefile 2007-05-12 12:08:09 UTC (rev 318) @@ -43,7 +43,7 @@ CWARN = -Wall -Wstrict-prototypes CTUNING = -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums CFLAGS = $(COMMON) $(CDEBUG) $(CDEFS) $(CINCS) -O$(OPT) $(CWARN) $(CSTANDARD) $(CEXTRA) -CFLAGS += -MD -MP -MT $(*F).o -MF dep/$(@F).d +CFLAGS += -MD -MP -MT $(*F).o -MF dep/$(@F).d ## Assembly specific flags ASMFLAGS = $(COMMON) @@ -66,10 +66,10 @@ ## Objects that must be built in order to link -OBJECTS = main.o sensors.o motors.o global.o led.o communication.o i2c.o fifo.o ir.o parser.o config.o standalone.o +OBJECTS = main.o sensors.o motors.o global.o led.o communication.o i2c.o fifo.o ir.o parser.o config.o standalone.o ## Objects explicitly added by the user -LINKONLYOBJECTS = +LINKONLYOBJECTS = ## Build all: svnrev.h $(TARGET) tuxcore.hex tuxcore.eep tuxcore.lss size @@ -166,11 +166,11 @@ -include $(shell mkdir dep 2>/dev/null) $(wildcard dep/*) # Programming -prog: $(PROJECT).hex +prog: $(PROJECT).hex tuxup $(PROJECT).hex $(PROJECT).eep -progisp: $(PROJECT).hex +progisp: $(PROJECT).hex AVRDUDE -p $(MCU) -c jtag2isp -P usb -B 10 -e -U flash:w:$(PROJECT).hex -progstk: $(PROJECT).hex +progstk: $(PROJECT).hex AVRDUDE -p $(MCU) -c stk500v2 -e -U flash:w:$(PROJECT).hex Modified: firmware/tuxcore/trunk/communication.c =================================================================== --- firmware/tuxcore/trunk/communication.c 2007-05-12 11:57:43 UTC (rev 317) +++ firmware/tuxcore/trunk/communication.c 2007-05-12 12:08:09 UTC (rev 318) @@ -43,7 +43,7 @@ /* * audioIntBuf is a single buffer for audio commands to be sent to the audio - * interface + * interface * * audioIntBufIdx should be set to the number of valid bytes in the buffer, * depending on the number of parameters associated with the command. It is Modified: firmware/tuxcore/trunk/fifo.c =================================================================== --- firmware/tuxcore/trunk/fifo.c 2007-05-12 11:57:43 UTC (rev 317) +++ firmware/tuxcore/trunk/fifo.c 2007-05-12 12:08:09 UTC (rev 318) @@ -35,25 +35,25 @@ All functions that use modulo usually use typecasts i.e. the following statement - + \code length = (p->inIdx - p->outIdx) % p->size; \endcode has a problem when (p->inIdx - p->outIdx) is <0. Then the modulus is not done, the return value is 0xF9 for example. This is due to the implicit promotion of the intermediate value to an int. - + "%" is a signed modulus, so -1 % 8 == -1. We need to trim down the intermediate result to a uint8_t result immediately so the modulus applies to a uint8_t otherwise the implicit promotion of a uint8_t argument to an int expression makes the expression signed and brake the code for the above reason. The correct expression is - + \code length = ((uint8_t)(p->inIdx - p->outIdx) % p->size); \endcode So forgetting the typecast not only makes the code much bigger, it also brake it when the intermediate result is negative. - + */ /** \name Accessors Modified: firmware/tuxcore/trunk/fifo.h =================================================================== --- firmware/tuxcore/trunk/fifo.h 2007-05-12 11:57:43 UTC (rev 317) +++ firmware/tuxcore/trunk/fifo.h 2007-05-12 12:08:09 UTC (rev 318) @@ -72,7 +72,7 @@ /* * Adaptive parameters */ -/** \brief UD- Rate at which the adaptation is done. +/** \brief UD- Rate at which the adaptation is done. * * The adaptation function will only be run each 2^FIFO_ADAPT_RATE sample */ #define FIFO_ADAPT_RATE 3 /* adaptation is done each 2^FIFO_ADAPT_RATE sample */ Modified: firmware/tuxcore/trunk/ir.c =================================================================== --- firmware/tuxcore/trunk/ir.c 2007-05-12 11:57:43 UTC (rev 317) +++ firmware/tuxcore/trunk/ir.c 2007-05-12 12:08:09 UTC (rev 318) @@ -268,7 +268,7 @@ irRC5SendData.bit = RC5_BIT_NUMBER; irPulses = 0; /* Start interrupt by loading a bit */ irStatus = 0; /* reset status to send mode */ - /* code: S1 S2 T Address(5b) Command(6b) + /* code: S1 S2 T Address(5b) Command(6b) * S1, S2: start bits (always 1) * T: toggle bit, given with address */ irRC5SendData.code = address | 0xC0; /* Set the 2 start bits */ Modified: firmware/tuxcore/trunk/ir.h =================================================================== --- firmware/tuxcore/trunk/ir.h 2007-05-12 11:57:43 UTC (rev 317) +++ firmware/tuxcore/trunk/ir.h 2007-05-12 12:08:09 UTC (rev 318) @@ -100,7 +100,7 @@ * \param command - xxCCCCCC (C: RC5 6 bits command) * \note Tux can't send and receive IR at the same time because the code sent is also detected by the receiver and also because they share the same timer. So irSendRC5 will disable irGetRC5 when sending data. * - * Send an ir code following the Philips RC-5 Protocol. The RC-5 code from Philips is possibly the most used protocol by hobbyists, probably because of the wide availability of cheap remote controls. + * Send an ir code following the Philips RC-5 Protocol. The RC-5 code from Philips is possibly the most used protocol by hobbyists, probably because of the wide availability of cheap remote controls. * For more information on a couple of protocols, visit http://www.sbprojects.com/knowledge/ir/rc5.htm or google for it :-) */ void irSendRC5(uint8_t address, uint8_t command); Modified: firmware/tuxcore/trunk/motors.c =================================================================== --- firmware/tuxcore/trunk/motors.c 2007-05-12 11:57:43 UTC (rev 317) +++ firmware/tuxcore/trunk/motors.c 2007-05-12 12:08:09 UTC (rev 318) @@ -36,7 +36,7 @@ uint8_t pwmMaskB; /** - \brief Wings position interrupt + \brief Wings position interrupt \ingroup wings This interrupt stops the wings when the desired number of movements have been @@ -91,7 +91,7 @@ } /** - \brief Eyes position interrupt + \brief Eyes position interrupt \ingroup eyes This interrupt stops the eyes when the desired number of movements have been @@ -128,7 +128,7 @@ } /** - \brief Mouth position interrupt + \brief Mouth position interrupt \ingroup moth This interrupt stops the mouth when the desired number of movements have been @@ -170,12 +170,12 @@ } /** - \brief Spin position interrupt + \brief Spin position interrupt \ingroup spin This interrupt stops the spinning motor when the desired number of movements have been executed. - + The switch is pushed each XXX degrees. We set the interrupt in falling edge mode so there's no interrupt generated when the switch is released. */ @@ -234,7 +234,7 @@ MOT_SPIN_DDR |= MOT_SPIN_MK; /* both pins on the same port so we can use this mask */ } -/** +/** \brief Start waving the wings up and down \ingroup wings \param cnt number of movements before the wings will stop @@ -261,7 +261,7 @@ waveWings(2, 5); /* the first movement is to be sure the timer doesn't start counting from any unknown poistion and that the motors are in regime */ } -/** +/** \brief Blink the eyes \ingroup eyes \param cnt number of movements before the wings will stop @@ -277,7 +277,7 @@ runEyes(); } -/** +/** \brief Open the eyes \ingroup eyes @@ -289,7 +289,7 @@ blinkEyes(1); } -/** +/** \brief Close the eyes \ingroup eyes @@ -301,7 +301,7 @@ blinkEyes(1); } -/** +/** \brief Move the mouth \ingroup mouth \note Any eye command is cancelled @@ -317,7 +317,7 @@ runMouth(); } -/** +/** \brief Open the mouth \ingroup mouth @@ -329,7 +329,7 @@ moveMouth(1); } -/** +/** \brief Close the mouth \ingroup mouth Modified: firmware/tuxcore/trunk/motors.h =================================================================== --- firmware/tuxcore/trunk/motors.h 2007-05-12 11:57:43 UTC (rev 317) +++ firmware/tuxcore/trunk/motors.h 2007-05-12 12:08:09 UTC (rev 318) @@ -56,14 +56,14 @@ * Basic movements */ -/** +/** \brief Spin left for the \c angle amount \param angle Angle to turn, in 90 unit \ingroup spin */ void spinLeft(uint8_t angle, uint8_t pwm); -/** +/** \brief Spin right for the \c angle amount \param angle Angle to turn, in 90 unit \ingroup spin Modified: firmware/tuxdefs/commands.h =================================================================== --- firmware/tuxdefs/commands.h 2007-05-12 11:57:43 UTC (rev 317) +++ firmware/tuxdefs/commands.h 2007-05-12 12:08:09 UTC (rev 318) @@ -56,7 +56,7 @@ * - 0b01xxxxxx (0x40-0x7F) for functions requesting 1 parameter * - 0b10xxxxxx (0x80-0xBF) for functions requesting 2 parameters * - 0b11xxxxxx (0xC0-0xFF) for functions requesting 3 parameters - * + * * The same definition of commands are used for all communications between the * computer and Tux. But depending on the communication way, the set of * commands will differ. There will be 3 sets based on Tux's architecture: Modified: firmware/tuxup/trunk/bootloader.c =================================================================== --- firmware/tuxup/trunk/bootloader.c 2007-05-12 11:57:43 UTC (rev 317) +++ firmware/tuxup/trunk/bootloader.c 2007-05-12 12:08:09 UTC (rev 318) @@ -316,8 +316,8 @@ } /** - * Called when a data line is parsed. This routine will, - * in turn, call startSegment(), fillSegment(), and finishSegment() as + * Called when a data line is parsed. This routine will, + * in turn, call startSegment(), fillSegment(), and finishSegment() as * appropriate. * * @return TRUE if parsing should continue, FALSE if it should stop. @@ -474,7 +474,7 @@ if ((unsigned char)(checksumCalc + checksumFound) != 0) { - // Error(parser, "found checksum 0x%02x, expecting 0x%02x", + // Error(parser, "found checksum 0x%02x, expecting 0x%02x", // checksumFound, 0 - checksumCalc); return FALSE; } @@ -493,7 +493,7 @@ case 1: // EOF { ParsedData(parser, TRUE); /* fill the last segment and send it */ - // Flush(parser); /* XXX what to do here? */ + // Flush(parser); /* XXX what to do here? */ break; } Modified: firmware/tuxup/trunk/main.c =================================================================== --- firmware/tuxup/trunk/main.c 2007-05-12 11:57:43 UTC (rev 317) +++ firmware/tuxup/trunk/main.c 2007-05-12 12:08:09 UTC (rev 318) @@ -172,7 +172,7 @@ return nr; } -/* +/* * Check if the hex file is valid and return the CPU number for which it has * been compiled. Fills the version structure with the information extracted * from the hex file and returns 0 if the hex file has a cpu and version Modified: firmware/tuxup/trunk/usb-connection.c =================================================================== --- firmware/tuxup/trunk/usb-connection.c 2007-05-12 11:57:43 UTC (rev 317) +++ firmware/tuxup/trunk/usb-connection.c 2007-05-12 12:08:09 UTC (rev 318) @@ -39,7 +39,7 @@ * @{ */ -/** +/** * \brief Scan all USB busses to find Tux device * \return USB device of Tux */ @@ -66,7 +66,7 @@ return NULL; } -/** +/** * \brief Open USB interface * \param dev USB device * \return dev_h USB device handle @@ -100,7 +100,7 @@ return dev_h; } -/** +/** * \brief Close Tux interface * \param dev_h USB device handle * @@ -112,7 +112,7 @@ usb_close(dev_h); } -/** +/** * \brief Send commands to Tux's dongle * \param dev_h USB device handle * \return USB communication status @@ -144,7 +144,7 @@ return status; } -/** +/** * \brief Get commands from Tux's dongle * \param dev_h USB device handle * \return USB communication status Modified: firmware/tuxup/trunk/usb-connection.h =================================================================== --- firmware/tuxup/trunk/usb-connection.h 2007-05-12 11:57:43 UTC (rev 317) +++ firmware/tuxup/trunk/usb-connection.h 2007-05-12 12:08:09 UTC (rev 318) @@ -57,7 +57,7 @@ // unsigned char URB_CMD[][URB_LENGTH]={ // INIT REGISTER // { 0x8e,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x68 }, -// GET STATUS +// GET STATUS // { 0x03,0x02,0x12,0x44,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF1 }, // }; |