tux-droid-svn Mailing List for Tux Droid CE (Page 221)
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: Paul_R <c2m...@c2...> - 2007-09-10 08:59:10
|
Author: Paul_R Date: 2007-09-10 10:59:09 +0200 (Mon, 10 Sep 2007) New Revision: 505 Modified: firmware/tuxaudio/branches/audio_cleanup/flash.c firmware/tuxaudio/branches/audio_cleanup/flash.h firmware/tuxaudio/branches/audio_cleanup/main.c Log: * Reorganized the flash memory's playing functions - Added three 'static' functions to init, play and stop the sound. - cleanup the main loop. Modified: firmware/tuxaudio/branches/audio_cleanup/flash.c =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/flash.c 2007-09-10 08:08:55 UTC (rev 504) +++ firmware/tuxaudio/branches/audio_cleanup/flash.c 2007-09-10 08:59:09 UTC (rev 505) @@ -20,6 +20,7 @@ /* $Id: $ */ #include <avr/io.h> +#include <avr/interrupt.h> #include "varis.h" #include "spi.h" #include "i2c.h" @@ -36,10 +37,16 @@ static void soundProgramming(void); static void endProgramming(void); +static void playInit(uint8_t nsound); +static void playingSound(void); +static void stopPlaying(void); uint8_t f_state; uint8_t flash_state; uint8_t ad0, ad1, ad2, i, j; + +uint8_t soundNum; + /* Public functions */ /** @@ -58,7 +65,6 @@ - END_STATE clear all variable used to control the programming task, and reswitch-on the I2C and the PWM timer. - Because I2C is disabled during this task, all command will be ignored. */ void flashProgramming(void) @@ -108,41 +114,22 @@ /** * \ingroup flash - * \brief Erase the flash memory. - * This funtion perform a full erase of the flash memory and initiate the sound - * flash programming. - * This functions is called by the command_Parser function when a programming - * flash command is received. - */ - -/* XXX This function is directly called by commandParser. It could be changed to - * be called by the flashProgramming function. - */ -static void erasingFlash(void) + \brief This function is used to play a sound from the flash memory. + */ +void playSound(void) { - /* Desactivate the PWM */ - TCCR0A = 0x00; - TCCR0B = 0x00; - OCR0A = 0x00; - TIMSK0 = 0x00; - - - resetFifo(&PWMFifo); /* Reinitialise the PWM fifo */ - erase_flash(); /* Erase the flash */ - flash_state = 0; + if (flash_state) + playInit(soundNum); + else + playingSound(); } -/** - * \ingroup flash - \param ad2 high address part - \param ad1 medium adress part - \param ad0 lower adress part - \return The byte read in the sound flash memory - \brief This function read a byte in the sound flash memory. - */ -void playingAudio(uint8_t nsound) + +/* Static functions */ + +void playInit(uint8_t nsound) { uint8_t count, i; uint8_t adp1, adp0, sounds_stored; // Address pointer varaible @@ -167,19 +154,19 @@ count++; } - PORTB &= ~0x02; // Chip Select + FLASH_CS_ON; // Chip Select - spiSend(0x03); // Send Read Page Command + spiSend(READ_ARRAY_LOW_F); // Send Read Page Command spiSend(0x00); // Send Address spiSend(adp1); spiSend(adp0); for (i = 0; i < 6; i++) { - ad[i] = spiSend(0x00); // Read start and stop sound address + ad[i] = spiSend(NOP); // Read start and stop sound address } - PORTB |= 0x02; // Chip Deselect + FLASH_CS_OFF; // Chip Deselect /* Check adresses */ if (ad[0] > TOP_A2) @@ -201,20 +188,50 @@ return; } - PORTB &= ~0x02; // Chip Select + FLASH_CS_ON; // Chip Select spiSend(0x03); // Send Read Page Command spiSend(ad[0]); // Send Address spiSend(ad[1]); spiSend(ad[2]); - PORTB &= ~0x01; // Reset the HOLD signal + HOLD_ON; // Reset the HOLD signal OCR0A = 250; // Normal operation for PWM if fifo adaptative is on - flashPlay = 1; // Read of sound + flash_state = 0; } +static void playingSound(void) +{ + uint8_t sound; + cli(); + if (!isFifoFull(&PWMFifo)) + { + HOLD_OFF; // Set the HOLD signal + sound = spiSend(0x00); // Wait response + HOLD_ON; // Reset the HOLD signal + sound = sound >> audioLevel; + pushFifo(&PWMFifo, sound); -void stopPlayingAudio(void) + ad[2]++; // Increment address for next play + if (ad[2] == 0) + { + ad[1]++; + if (ad[1] == 0) + { + ad[0]++; + if (ad[0] == 0x08) // Address overflow + stopPlaying(); + } + } + if (ad[0] == ad[3]) // Test end of sound + if (ad[1] == ad[4]) + if (ad[2] == ad[5]) + stopPlaying(); + } + sei(); +} + +static void stopPlaying(void) { flashPlay = 0; PORTB |= 0x01; // Set the HOLD signal @@ -222,18 +239,28 @@ } -/* Static functions - They can be accessed only by this module */ - /** * \ingroup flash + * \brief Erase the flash memory. + * This funtion perform a full erase of the flash memory and initiate the sound + * flash programming. + * This functions is called by the command_Parser function when a programming + * flash command is received. + */ +static void erasingFlash(void) +{ + /* Desactivate the PWM */ + TCCR0A = 0x00; + TCCR0B = 0x00; + OCR0A = 0x00; + TIMSK0 = 0x00; - \brief This function read the flash memory status. - */ + + resetFifo(&PWMFifo); /* Reinitialise the PWM fifo */ + erase_flash(); /* Erase the flash */ + flash_state = 0; +} - - - - /** * \ingroup flash * \brief Write the number of sound to be stored. Modified: firmware/tuxaudio/branches/audio_cleanup/flash.h =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/flash.h 2007-09-10 08:08:55 UTC (rev 504) +++ firmware/tuxaudio/branches/audio_cleanup/flash.h 2007-09-10 08:59:09 UTC (rev 505) @@ -42,12 +42,12 @@ #define SOUND_PROG_STATE 4 #define END_STATE 5 -extern void playingAudio(unsigned char nsound); -extern void stopPlayingAudio(void); extern void flashProgramming(void); +extern void playSound(void); extern uint8_t flash_state; extern uint8_t f_state; +extern uint8_t soundNum; #endif Modified: firmware/tuxaudio/branches/audio_cleanup/main.c =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/main.c 2007-09-10 08:08:55 UTC (rev 504) +++ firmware/tuxaudio/branches/audio_cleanup/main.c 2007-09-10 08:59:09 UTC (rev 505) @@ -159,8 +159,10 @@ if (flashPlay) return; audioLevel = audioBuf[2]; - //if (audioBuf[1] == 1) PORTC &= ~0x02; - playingAudio(audioBuf[1]); /* start playing the sound */ + //playingAudio(audioBuf[1]); /* start playing the sound */ + soundNum = audioBuf[1]; + flashPlay = 1; + flash_state = 1; } else if (audioBuf[0] == MUTE_CMD) { @@ -243,7 +245,7 @@ int main(void) { - unsigned char sound; + init_avr(); // Init AVR @@ -282,11 +284,11 @@ while (1) /* Inifinite main loop */ { - // asm volatile ("SPITRANSACTION: \n\t"); - sei(); // Reactivate global interrupt in case of flash programmation + if (!flashPlay) spiTransaction(); // Spi transaction from radio + if (commandRX) // commend RX from radio { commandRX = 0; // Reset flag @@ -298,86 +300,58 @@ flashProgramming(); } - // else - // { - if (flashPlay) - { - cli(); - if (!isFifoFull(&PWMFifo)) - { - PORTB |= 0x01; // Set the HOLD signal - sound = spiSend(0x00); // Wait response - PORTB &= ~0x01; // Reset the HOLD signal - sound = sound >> audioLevel; - pushFifo(&PWMFifo, sound); + if (flashPlay) + { + playSound(); + } - ad[2]++; // Increment address for next play - if (ad[2] == 0) - { - ad[1]++; - if (ad[1] == 0) - { - ad[0]++; - if (ad[0] == 0x08) // Address overflow - stopPlayingAudio(); - } - } - if (ad[0] == ad[3]) // Test end of sound - if (ad[1] == ad[4]) - if (ad[2] == ad[5]) - stopPlayingAudio(); - } - sei(); - } + if (sendSensorsFlag) + { + sendSensorsFlag = 0; + if (pre_sleep_delay > 1) + /* There's a delay before the sleep function is actually called + * otherwise other commands on the stack can't be executed */ + pre_sleep_delay--; + /* stop sending sensor status in sleep as the i2C should be + * stopped at this time */ + else + sendSensors(); + /* wait for all status to be sent before going to sleep */ + /* TODO fix these conditions for the sleep */ + //if (isFifoEmpty(statusFifo)) + /* wait for audio commands to be processed */ + //if (!audioBufIdx && !flashPlay) - if (sendSensorsFlag) + if (power_on_reset_delay) /* XXX to move to a proper loop or timer after or before main() */ { - sendSensorsFlag = 0; - if (pre_sleep_delay > 1) - /* There's a delay before the sleep function is actually called - * otherwise other commands on the stack can't be executed */ - pre_sleep_delay--; - /* stop sending sensor status in sleep as the i2C should be - * stopped at this time */ - else - sendSensors(); - /* wait for all status to be sent before going to sleep */ - /* TODO fix these conditions for the sleep */ - //if (isFifoEmpty(statusFifo)) - /* wait for audio commands to be processed */ - //if (!audioBufIdx && !flashPlay) + uint8_t volatile j; - if (power_on_reset_delay) /* XXX to move to a proper loop or timer after or before main() */ + DDRD |= 0x02; + for (j = 0; j < 0xFF; j++) ; + power_on_reset_delay--; + if (!power_on_reset_delay) { - uint8_t volatile j; - + /* Set the microphone power */ DDRD |= 0x02; - for (j = 0; j < 0xFF; j++) ; - power_on_reset_delay--; - if (!power_on_reset_delay) - { - /* Set the microphone power */ - DDRD |= 0x02; - } - else - DDRD &= ~0x02; } + else + DDRD &= ~0x02; } + } - sendCommands(); /* Send commands on I2C */ + sendCommands(); /* Send commands on I2C */ - if (audioBufIdx) - audioIntParser(); + if (audioBufIdx) + audioIntParser(); - /* Send information to the computer. */ - if (info_flg) - send_info(); + /* Send information to the computer. */ + if (info_flg) + send_info(); - /* Sleep mode */ - if (pre_sleep_delay == 1) - sleep(); - // } + /* Sleep mode */ + if (pre_sleep_delay == 1) + sleep(); } } |
From: Paul_R <c2m...@c2...> - 2007-09-10 08:09:24
|
Author: Paul_R Date: 2007-09-10 10:08:55 +0200 (Mon, 10 Sep 2007) New Revision: 504 Added: firmware/tuxaudio/branches/audio_cleanup/doc/ firmware/tuxaudio/branches/audio_cleanup/doc/Doxyfile firmware/tuxaudio/branches/audio_cleanup/doc/builddoc.sh Modified: firmware/tuxaudio/branches/audio_cleanup/Makefile Log: * Added doxygen files Modified: firmware/tuxaudio/branches/audio_cleanup/Makefile =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/Makefile 2007-09-10 08:04:14 UTC (rev 503) +++ firmware/tuxaudio/branches/audio_cleanup/Makefile 2007-09-10 08:08:55 UTC (rev 504) @@ -169,6 +169,16 @@ ## Other dependencies -include $(shell mkdir dep 2>/dev/null) $(wildcard dep/*) +## Generate doxygen documentation +.PHONY: doc +doc: svnrev.h +ifdef windir + # XXX add windows version +else + @./doc/builddoc.sh +endif + + # Programming prog: $(PROJECT).hex tuxup $(PROJECT).hex $(PROJECT).eep Added: firmware/tuxaudio/branches/audio_cleanup/doc/Doxyfile =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/doc/Doxyfile (rev 0) +++ firmware/tuxaudio/branches/audio_cleanup/doc/Doxyfile 2007-09-10 08:08:55 UTC (rev 504) @@ -0,0 +1,1277 @@ +# Doxyfile 1.5.2 - Doxygen configuration file for TUXCORE +# +# TUXCORE - Firmware for the 'core' CPU of tuxdroid +# Copyright (C) 2007 C2ME S.A. <tux...@c2...> +# +# 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: Doxyfile 494 2007-09-06 15:23:54Z jaguarondi $ + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project +# +# All text after a hash (#) is considered a comment and will be ignored +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" ") + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file that +# follow. The default is UTF-8 which is also the encoding used for all text before +# the first occurrence of this tag. Doxygen uses libiconv (or the iconv built into +# libc) for the transcoding. See http://www.gnu.org/software/libiconv for the list of +# possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. + +PROJECT_NAME = tuxaudio + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = $(VERSION) + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = doc + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hungarian, +# Italian, Japanese, Japanese-en (Japanese with English messages), Korean, +# Korean-en, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian, +# Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = YES + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful is your file systems +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like the Qt-style comments (thus requiring an +# explicit @brief command for a brief description. + +JAVADOC_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the DETAILS_AT_TOP tag is set to YES then Doxygen +# will output the detailed description near the top, like JavaDoc. +# If set to NO, the detailed description appears after the member +# documentation. + +DETAILS_AT_TOP = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for Java. +# For instance, namespaces will be presented as packages, qualified scopes +# will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to +# include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = NO + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or define consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and defines in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. The default is NO. + +SHOW_DIRECTORIES = NO + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from the +# version control system). Doxygen will invoke the program by executing (via +# popen()) the command <command> <input-file>, where <command> is the value of +# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be abled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = + +# This tag can be used to specify the character encoding of the source files that +# doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default +# input encoding. Doxygen uses libiconv (or the iconv built into libc) for the transcoding. +# See http://www.gnu.org/software/libiconv for the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx +# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py + +FILE_PATTERNS = + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# directories that are symbolic links (a Unix filesystem feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = */.svn/* */dep/* + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the output. +# The symbol name can be a fully qualified name, a word, or if the wildcard * is used, +# a substring. Examples: ANamespace, AClass, AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = doc + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command <filter> <input-file>, where <filter> +# is the value of the INPUT_FILTER tag, and <input-file> is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER +# is applied to all files. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = YES + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = NO + +# If the REFERENCED_BY_RELATION tag is set to YES (the default) +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES (the default) +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = YES + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. Otherwise they will link to the documentstion. + +REFERENCES_LINK_SOURCE = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = NO + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = NO + +# This tag can be used to set the number of enum values (range [1..20]) +# that doxygen will group on one line in the generated HTML documentation. + +ENUM_VALUES_PER_LINE = 4 + +# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be +# generated containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, +# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are +# probably better off using the HTML help feature. + +GENERATE_TREEVIEW = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, a4wide, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = NO + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = NO + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. This is useful +# if you want to understand what is going on. On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# in the INCLUDE_PATH (see below) will be search if a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = __DOXYGEN__ + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all function-like macros that are alone +# on a line, have an all uppercase name, and do not end with a semicolon. Such +# function macros are typically used for boiler-plate code, and will confuse +# the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option is superseded by the HAVE_DOT option below. This is only a +# fallback. It is recommended to install and use dot, since it yields more +# powerful graphs. + +CLASS_DIAGRAMS = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see http://www.mcternan.me.uk/mscgen/) to +# produce the chart and insert it in the documentation. The MSCGEN_PATH tag allows you to +# specify the directory where the mscgen tool resides. If left empty the tool is assumed to +# be found in the default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = NO + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will +# generate a call dependency graph for every global function or class method. +# Note that enabling this option will significantly increase the time of a run. +# So in most cases it will be better to enable call graphs for selected +# functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then doxygen will +# generate a caller dependency graph for every global function or class method. +# Note that enabling this option will significantly increase the time of a run. +# So in most cases it will be better to enable caller graphs for selected +# functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are png, jpg, or gif +# If left blank png will be used. + +DOT_IMAGE_FORMAT = png + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The MAX_DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen will always +# show the root nodes and its direct children regardless of this setting. + +DOT_GRAPH_MAX_NODES = 50 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, which results in a white background. +# Warning: Depending on the platform used, enabling this option may lead to +# badly anti-aliased labels on the edges of a graph (i.e. they become hard to +# read). + +DOT_TRANSPARENT = NO + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = NO + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- + +# The SEARCHENGINE tag specifies whether or not a search engine should be +# used. If set to NO the values of all tags below this one will be ignored. + +SEARCHENGINE = NO Added: firmware/tuxaudio/branches/audio_cleanup/doc/builddoc.sh =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/doc/builddoc.sh (rev 0) +++ firmware/tuxaudio/branches/audio_cleanup/doc/builddoc.sh 2007-09-10 08:08:55 UTC (rev 504) @@ -0,0 +1,45 @@ +#!/bin/bash +# +# This script builds the Doxygen documentation +# +# Written by David Bourgeois <da...@ja...> +# +# $Id: builddoc.sh 490 2007-09-06 12:07:50Z jaguarondi $ + +# This script should be started from the base folder, not the doc folder. +if [ $(basename $PWD) == "doc" ] +then + cd .. +fi + +# Get version number from version.h. +if [ -f svnrev.h ] +then + VERSION_MAJ=$(sed -n "s/\#define VER_MAJOR *//p" version.h) + VERSION_MIN=$(sed -n "s/\#define VER_MINOR *//p" version.h) + VERSION_UP=$(sed -n "s/\#define VER_UPDATE *//p" version.h) +else + echo "Error: version.h doesn't exist, aborting." + exit 1 +fi + +# Get revision number and whether we generate the documentation of a tag. +if [ -f svnrev.h ] +then + REVISION=$(sed -n "s/\#define SVN_REV\> *//p" svnrev.h) + URL=$(sed -n "s/\#define SVN_URL\> *//p" svnrev.h) + # if we're in a tag folder, we don't show 'UNRELEASED' + if [ !$(sed -n "s/\#define SVN_URL\> *//p" svnrev.h | grep tags) ] + then + UNRELEASED="UNRELEASED " + fi +else + echo "Warning: SVN information can't be found, is svnwcrev installed?" +fi + +export VERSION="Version $VERSION_MAJ.$VERSION_MIN.$VERSION_UP\ + ${UNRELEASED}(Revision $REVISION)" + +echo "Generating documentation for tuxcore" +echo $VERSION +doxygen doc/Doxyfile Property changes on: firmware/tuxaudio/branches/audio_cleanup/doc/builddoc.sh ___________________________________________________________________ Name: svn:executable + * |
From: Paul_R <c2m...@c2...> - 2007-09-10 08:04:48
|
Author: Paul_R Date: 2007-09-10 10:04:14 +0200 (Mon, 10 Sep 2007) New Revision: 503 Modified: firmware/tuxaudio/branches/audio_cleanup/AT26F004.c firmware/tuxaudio/branches/audio_cleanup/AT26F004.h firmware/tuxaudio/branches/audio_cleanup/PC_communication.c firmware/tuxaudio/branches/audio_cleanup/flash.c firmware/tuxaudio/branches/audio_cleanup/flash.h firmware/tuxaudio/branches/audio_cleanup/hardware.h firmware/tuxaudio/branches/audio_cleanup/main.c Log: * Reorganized the programming and flash modules - Some functions and defines have been moved from flash module to AT26F. - Some functions in the flash module have been declared with the 'static' attribute. - Moved the chip select and the hold defines from AT26F. module to hardware.h - Change the programmingFlash's init to not call the erasingFlash function directly from the main loop. Modified: firmware/tuxaudio/branches/audio_cleanup/AT26F004.c =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/AT26F004.c 2007-09-07 15:24:24 UTC (rev 502) +++ firmware/tuxaudio/branches/audio_cleanup/AT26F004.c 2007-09-10 08:04:14 UTC (rev 503) @@ -19,11 +19,9 @@ /* $Id: $ */ -/* $Id: $ */ - #include <avr/io.h> #include "AT26F004.h" -#include "flash.h" +#include "hardware.h" #include "spi.h" @@ -41,59 +39,58 @@ {0x07, 0xC0, 0x00} }; +/** + * \ingroup at26f004 + \brief This function set the write enable flag of the flash memory. + */ uint8_t read_status(void) { uint8_t status; - FLASH_CS_ON; /* Chip Select */ - spiSend(READ_STATUS_REG); /* Send Read Status Command */ - status = spiSend(NOP); /* Read status on spi */ - FLASH_CS_OFF; /* Chip Deselect */ + FLASH_CS_ON; + spiSend(READ_STATUS_REG); /* Send Read Status Command */ + status = spiSend(NOP); /* Read status on spi */ + FLASH_CS_OFF; return status; } /** - * \ingroup flash + * \ingroup at26f004 \brief This function set the write enable flag of the flash memory. */ - void write_enable(void) { - FLASH_CS_ON; /* Chip Select */ - spiSend(WRITE_EN); /* Send Write Enable Command */ - FLASH_CS_OFF; /* Chip Deselect */ - + FLASH_CS_ON; + spiSend(WRITE_EN); /* Send Write Enable Command */ + FLASH_CS_OFF; } /** - * \ingroup flash + * \ingroup at26f004 \brief This function clear the write enable flag of the flash memory. */ - void write_disable(void) { - FLASH_CS_ON; /* Chip Select */ - spiSend(WRITE_DIS); /* Send Write Disable Command */ - FLASH_CS_OFF; /* Chip Deselect */ + FLASH_CS_ON; + spiSend(WRITE_DIS); /* Send Write Disable Command */ + FLASH_CS_OFF; } /** - * \ingroup flash + * \ingroup at26f004 \brief This function write into the flash memory status register. */ - void write_status(uint8_t const status) { - FLASH_CS_ON; /* Chip Select */ - spiSend(WRITE_STATUS_REG); /* Send Write Status Command */ - spiSend(status); /* Send status */ - FLASH_CS_OFF; /* Chip Deselect */ - + FLASH_CS_ON; + spiSend(WRITE_STATUS_REG); /* Send Write Status Command */ + spiSend(status); /* Send status */ + FLASH_CS_OFF; } /** - * \ingroup flash + * \ingroup at26f004 \param ad2 high address part \param ad1 medium adress part \param ad0 lower adress part @@ -102,59 +99,75 @@ */ void unprotect_sector(uint8_t const ad2, uint8_t const ad1, uint8_t const ad0) { - FLASH_CS_ON; // Chip Select - spiSend(UNPROTECT_SECTOR); // Send unprotect sector command - spiSend(ad2); // Send Address + FLASH_CS_ON; + spiSend(UNPROTECT_SECTOR); /* Send unprotect sector command */ + /* Send Adress */ + spiSend(ad2); spiSend(ad1); spiSend(ad0); - FLASH_CS_OFF; // Chip Deselect - + FLASH_CS_OFF; } /** - * \ingroup flash + * \ingroup at26f004 \brief This function erase the entire memory. */ - void erase_flash(void) { uint8_t i; - write_status(0x00); // Disable sector protection register + write_status(0x00); /* Disable sector protection register */ for (i=0; i<=10; i++) { - write_enable(); // Enable the writing + write_enable(); /* Enable the writing */ unprotect_sector(sector_adress[i][0], sector_adress[i][1],sector_adress[i][2]); } - write_enable(); // Enable the writing + write_enable(); /* Enable the writing */ - FLASH_CS_ON; // Chip Select - spiSend(CHIP_ERASE); // Send Erase Bulk command - FLASH_CS_OFF; // Chip Deselect + FLASH_CS_ON; + spiSend(CHIP_ERASE); /* Send Erase Bulk command */ + FLASH_CS_OFF; } /** - * \ingroup flash + * \ingroup at26f004 \param ad2 high address part \param ad1 medium adress part \param ad0 lower adress part \brief This function write a byte in the flash memory. */ - void program_flash(uint8_t const ad2, uint8_t const ad1, uint8_t const ad0, uint8_t const data) { - while (read_status() & BUSY) ; // Wait Page Program Cycle + while (read_status() & BUSY) ; /* Wait Page Program Cycle */ write_enable(); - FLASH_CS_ON; // Chip Select - spiSend(BYTE_PROGRAM); // Send Page Byte Command - spiSend(ad2); // Send Address + FLASH_CS_ON; + spiSend(BYTE_PROGRAM); /* Send Page Byte Command */ + /* Send adress */ + spiSend(ad2); spiSend(ad1); spiSend(ad0); - spiSend(data); // Write data in flash - FLASH_CS_OFF; // Chip Deselect + spiSend(data); /* Write data in flash */ + FLASH_CS_OFF; } +uint8_t read_data(uint8_t const ad2, uint8_t const ad1, uint8_t const ad0) +{ + uint8_t data1; + FLASH_CS_ON; + spiSend(READ_ARRAY_LOW_F); /* Send Read Page Command */ + /* Send address */ + spiSend(ad2); + spiSend(ad1); + spiSend(ad0); + data1 = spiSend(NOP); /* Wait response */ + FLASH_CS_OFF; + + return data1; +} + + + Modified: firmware/tuxaudio/branches/audio_cleanup/AT26F004.h =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/AT26F004.h 2007-09-07 15:24:24 UTC (rev 502) +++ firmware/tuxaudio/branches/audio_cleanup/AT26F004.h 2007-09-10 08:04:14 UTC (rev 503) @@ -17,6 +17,23 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/** \defgroup at26f004 AT26F004 flash memory + \ingroup at26f004 + + This module contains all specific definitions and functions to access the flash memory. + */ +/** \file AT26F004.h + \ingroup at26f004 + \brief AT26F004 flash memory header + + */ + +/** \file AT26F004.c + \ingroup at26f004 + \brief AT26F004 functions + + */ + #ifndef AT26F004_H #define AT26F004_H @@ -63,22 +80,17 @@ extern uint8_t sector_adress[11][3]; /** * \name Flash TOP address - * + * \ingroup at26f004 * The flash memory address range is 0x000000 - [TOP_A2 TOP_A1 TOP_A0] * The AT26F004 has an address range of 0x000000 - 0x7FFFFF - * @{ */ + */ /** High byte of the TOP address. */ #define TOP_A2 0x07 /** Middle byte of the TOP address. */ #define TOP_A1 0xFF /** Low byte of the TOP address. */ #define TOP_A0 0xFF -/*! @} */ -#define FLASH_CS_ON FLASH_PORT &= ~FLASH_CS_PIN -#define FLASH_CS_OFF FLASH_PORT |= FLASH_CS_PIN -#define HOLD_ON FLASH_PORT &= ~FLASH_HOLD_PIN -#define HOLD_OFF FLASH_PORT |= FLASH_HOLD_PIN extern uint8_t read_status(void); extern void write_enable(void); @@ -89,5 +101,6 @@ uint8_t const ad0); extern void program_flash(uint8_t const ad2, uint8_t const ad1, uint8_t const ad0, uint8_t const data); +extern uint8_t read_data(uint8_t const ad2, uint8_t const ad1, uint8_t const ad0); #endif Modified: firmware/tuxaudio/branches/audio_cleanup/PC_communication.c =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/PC_communication.c 2007-09-07 15:24:24 UTC (rev 502) +++ firmware/tuxaudio/branches/audio_cleanup/PC_communication.c 2007-09-10 08:04:14 UTC (rev 503) @@ -27,7 +27,7 @@ #include "PC_communication.h" #include "communication.h" #include "spi.h" -#include "AT26F004.h" +#include "hardware.h" void spiTransaction(void) { Modified: firmware/tuxaudio/branches/audio_cleanup/flash.c =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/flash.c 2007-09-07 15:24:24 UTC (rev 502) +++ firmware/tuxaudio/branches/audio_cleanup/flash.c 2007-09-10 08:04:14 UTC (rev 503) @@ -29,6 +29,7 @@ /* Theses functions are declared with the static attribute, so they're * accessible only by this module */ +static void erasingFlash(void); static void programmingNumSound(void); static void programmingToc(void); static void initSoundProgramming(void); @@ -36,9 +37,9 @@ static void endProgramming(void); -uint8_t f_state = 0; +uint8_t f_state; uint8_t flash_state; - +uint8_t ad0, ad1, ad2, i, j; /* Public functions */ /** @@ -67,7 +68,10 @@ PORTB |= 0x01; if (f_state == ERASE_STATE) { - if (read_status() & BUSY) + if (flash_state) + erasingFlash(); + + else if (read_status() & BUSY) f_state ++; } else if (f_state == FIRST_PROG_STATE) @@ -111,22 +115,23 @@ * flash command is received. */ - -uint8_t ad0, ad1, ad2, i, j; -void erasingFlash(void) +/* XXX This function is directly called by commandParser. It could be changed to + * be called by the flashProgramming function. + */ +static void erasingFlash(void) { - TCCR0A = 0x00; // Desactivate PWM + /* Desactivate the PWM */ + TCCR0A = 0x00; TCCR0B = 0x00; OCR0A = 0x00; TIMSK0 = 0x00; - f_state = 0; - TWCR = (TWCR & TWCR_CMD_MASK) & ~_BV(TWIE); // Desactivate I2C - - resetFifo(&PWMFifo); /* Reinitialise the PWM fifo */ - programmingFlash = 1; // Set the flag to suspend the task - erase_flash(); // Erase the flash + + resetFifo(&PWMFifo); /* Reinitialise the PWM fifo */ + erase_flash(); /* Erase the flash */ + flash_state = 0; } + /** * \ingroup flash \param ad2 high address part @@ -136,21 +141,7 @@ \brief This function read a byte in the sound flash memory. */ -uint8_t read_data(uint8_t const ad2, uint8_t const ad1, uint8_t const ad0) -{ - uint8_t data1; - FLASH_CS_ON; // Chip Select - spiSend(READ_ARRAY_LOW_F); // Send Read Page Command - spiSend(ad2); // Send Address - spiSend(ad1); - spiSend(ad0); - data1 = spiSend(NOP); // Wait response - FLASH_CS_OFF; // Chip Deselect - - return data1; -} - void playingAudio(uint8_t nsound) { uint8_t count, i; Modified: firmware/tuxaudio/branches/audio_cleanup/flash.h =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/flash.h 2007-09-07 15:24:24 UTC (rev 502) +++ firmware/tuxaudio/branches/audio_cleanup/flash.h 2007-09-10 08:04:14 UTC (rev 503) @@ -47,9 +47,6 @@ extern void flashProgramming(void); -extern void erasingFlash(void); -extern uint8_t read_data(uint8_t const ad2, uint8_t const ad1, - uint8_t const ad0); extern uint8_t flash_state; extern uint8_t f_state; Modified: firmware/tuxaudio/branches/audio_cleanup/hardware.h =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/hardware.h 2007-09-07 15:24:24 UTC (rev 502) +++ firmware/tuxaudio/branches/audio_cleanup/hardware.h 2007-09-10 08:04:14 UTC (rev 503) @@ -22,10 +22,17 @@ #ifndef HARDWARE_H #define HARDWARE_H +/* Flash memory port */ #define FLASH_PORT PORTB #define FLASH_CS_PIN _BV(PB1) #define FLASH_HOLD_PIN _BV(PB0) +/* Flash memory commands */ +#define FLASH_CS_ON FLASH_PORT &= ~FLASH_CS_PIN +#define FLASH_CS_OFF FLASH_PORT |= FLASH_CS_PIN +#define HOLD_ON FLASH_PORT &= ~FLASH_HOLD_PIN +#define HOLD_OFF FLASH_PORT |= FLASH_HOLD_PIN + #endif Modified: firmware/tuxaudio/branches/audio_cleanup/main.c =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/main.c 2007-09-07 15:24:24 UTC (rev 502) +++ firmware/tuxaudio/branches/audio_cleanup/main.c 2007-09-10 08:04:14 UTC (rev 503) @@ -195,7 +195,9 @@ { /* param: command[1] : number of sounds */ numSound = command[1]; - erasingFlash(); + f_state =0; /* First programming state */ + flash_state = 1; /* Erasing flash flag */ + programmingFlash = 1; /* Set the flag to enter programming sequence */ } else if (command[0] == STORE_INDEX_CMD) { |
From: Paul_R <c2m...@c2...> - 2007-09-07 15:24:25
|
Author: Paul_R Date: 2007-09-07 17:24:24 +0200 (Fri, 07 Sep 2007) New Revision: 502 Added: firmware/tuxaudio/branches/audio_cleanup/hardware.h Modified: firmware/tuxaudio/branches/audio_cleanup/AT26F004.h firmware/tuxaudio/branches/audio_cleanup/Makefile firmware/tuxaudio/branches/audio_cleanup/PC_communication.c firmware/tuxaudio/branches/audio_cleanup/flash.h Log: * Added hardware.h to define tuxaudio hardware spec. * Corrected a bug in the Makefile ... Modified: firmware/tuxaudio/branches/audio_cleanup/AT26F004.h =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/AT26F004.h 2007-09-07 15:02:33 UTC (rev 501) +++ firmware/tuxaudio/branches/audio_cleanup/AT26F004.h 2007-09-07 15:24:24 UTC (rev 502) @@ -20,6 +20,8 @@ #ifndef AT26F004_H #define AT26F004_H +#include "hardware.h" + /* Flash (AT26F004) OP CODE */ #define READ_ARRAY 0x0B #define READ_ARRAY_LOW_F 0x03 @@ -73,6 +75,10 @@ #define TOP_A0 0xFF /*! @} */ +#define FLASH_CS_ON FLASH_PORT &= ~FLASH_CS_PIN +#define FLASH_CS_OFF FLASH_PORT |= FLASH_CS_PIN +#define HOLD_ON FLASH_PORT &= ~FLASH_HOLD_PIN +#define HOLD_OFF FLASH_PORT |= FLASH_HOLD_PIN extern uint8_t read_status(void); extern void write_enable(void); Modified: firmware/tuxaudio/branches/audio_cleanup/Makefile =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/Makefile 2007-09-07 15:02:33 UTC (rev 501) +++ firmware/tuxaudio/branches/audio_cleanup/Makefile 2007-09-07 15:24:24 UTC (rev 502) @@ -103,7 +103,7 @@ communication.o: communication.c $(CC) $(INCLUDES) $(CFLAGS) -c $< -communication.o: PC_communication.c +PC_communication.o: PC_communication.c $(CC) $(INCLUDES) $(CFLAGS) -c $< i2c.o: i2c.c @@ -151,8 +151,9 @@ endif ## Generate SVN info -.PHONY: svnrev.h -svnrev.h: +# We need to change the status each time a file changes, thus so many +# dependencies +svnrev.h: $(CSOURCE) $(HEADERS) ifdef windir SubWCRev . svnrev.tmpl.h svnrev.h else Modified: firmware/tuxaudio/branches/audio_cleanup/PC_communication.c =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/PC_communication.c 2007-09-07 15:02:33 UTC (rev 501) +++ firmware/tuxaudio/branches/audio_cleanup/PC_communication.c 2007-09-07 15:24:24 UTC (rev 502) @@ -24,8 +24,10 @@ #include "varis.h" #include "fifo.h" +#include "PC_communication.h" #include "communication.h" #include "spi.h" +#include "AT26F004.h" void spiTransaction(void) { @@ -37,7 +39,7 @@ spi_slave = HEADERS; // Set state machine spi_master = HEADERM; if (programmingFlash) - PORTB &= ~0x01; + HOLD_ON; // Reset SPI to fix strange bug on the spi SPCR = 0x50; SPSR = 0x00; Modified: firmware/tuxaudio/branches/audio_cleanup/flash.h =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/flash.h 2007-09-07 15:02:33 UTC (rev 501) +++ firmware/tuxaudio/branches/audio_cleanup/flash.h 2007-09-07 15:24:24 UTC (rev 502) @@ -34,13 +34,6 @@ #ifndef FLASH_H #define FLASH_H - - - -#define FLASH_CS_ON PORTB &= ~0x02 -#define FLASH_CS_OFF PORTB |= 0x02 - - /* Flash programming states */ #define ERASE_STATE 0 #define FIRST_PROG_STATE 1 Added: firmware/tuxaudio/branches/audio_cleanup/hardware.h =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/hardware.h (rev 0) +++ firmware/tuxaudio/branches/audio_cleanup/hardware.h 2007-09-07 15:24:24 UTC (rev 502) @@ -0,0 +1,32 @@ +/* + * TUXAUDIO - Firmware for the 'audio' CPU of tuxdroid + * Copyright (C) 2007 C2ME S.A. <tux...@c2...> + * + * 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 + */ + +#include <avr/io.h> + +#ifndef HARDWARE_H +#define HARDWARE_H + +#define FLASH_PORT PORTB +#define FLASH_CS_PIN _BV(PB1) +#define FLASH_HOLD_PIN _BV(PB0) + +#endif + + + |
From: jaguarondi <c2m...@c2...> - 2007-09-07 15:02:38
|
Author: jaguarondi Date: 2007-09-07 17:02:33 +0200 (Fri, 07 Sep 2007) New Revision: 501 Modified: firmware/tuxaudio/trunk/AUTHORS firmware/tuxaudio/trunk/CHANGES firmware/tuxaudio/trunk/README firmware/tuxaudio/trunk/TODO Log: * Updated the CHANGES. Modified: firmware/tuxaudio/trunk/AUTHORS =================================================================== --- firmware/tuxaudio/trunk/AUTHORS 2007-09-07 14:55:34 UTC (rev 500) +++ firmware/tuxaudio/trunk/AUTHORS 2007-09-07 15:02:33 UTC (rev 501) @@ -3,6 +3,7 @@ TUXAUDIO was written by: Pascal Hanon <pas...@c2...> + Paul Rathgeb <pau...@c2...> David Bourgeois <da...@ja...> Contributors: Modified: firmware/tuxaudio/trunk/CHANGES =================================================================== --- firmware/tuxaudio/trunk/CHANGES 2007-09-07 14:55:34 UTC (rev 500) +++ firmware/tuxaudio/trunk/CHANGES 2007-09-07 15:02:33 UTC (rev 501) @@ -7,8 +7,28 @@ ---------------------------------------------------------------------- Current: - * . + * Code cleanup. + * BUG: when the sounds stored in the audio flash are too long, we don't block + anymore in the programming function. The extra sound is simply not stored + in the flash. + + * BUG: there was an uncomplete 'if' before the powering of the microphone, + it's now fixed and the bursts have been limited to 20. + + * Added the basis for the sleep functions although they are unfinished and + untested. + + * Added programming directives in the Makefile for tuxup, stk500 and jtagice + mkii. + + * Fixed #1 with the patches given by Philippe Teuwen, this now + fixes the location of the version, revision and author structures with a + linker script in the .version section otherwise gcc is free to change the + order. This also fixes the position of the cpu_nbr and ver_major bits in + the byte as again gcc is free to change that order though this is much less + likely to happen. + Version 0.3.0: * Initial public release. This code is considered stable. Modified: firmware/tuxaudio/trunk/README =================================================================== --- firmware/tuxaudio/trunk/README 2007-09-07 14:55:34 UTC (rev 500) +++ firmware/tuxaudio/trunk/README 2007-09-07 15:02:33 UTC (rev 501) @@ -7,7 +7,7 @@ To install and compile this firmware, check this how-to: - http://www.tuxisalive.com/documentation/how-to/setup-the-avr-tool-chain-and-compile-the-firmwares + http://www.tuxisalive.com/documentation/how-to/setup-the-avr-tool-chain-and-compile-the-firmware For all information about tuxdroid, please visit: Modified: firmware/tuxaudio/trunk/TODO =================================================================== --- firmware/tuxaudio/trunk/TODO 2007-09-07 14:55:34 UTC (rev 500) +++ firmware/tuxaudio/trunk/TODO 2007-09-07 15:02:33 UTC (rev 501) @@ -5,6 +5,4 @@ - Add functions to change configuration registers from the computer and store them in the eeprom. -- Add dleep mode. - -- Remove production testing code which is not necessary anymore. +- Add sleep mode. |
From: Paul_R <c2m...@c2...> - 2007-09-07 14:55:40
|
Author: Paul_R Date: 2007-09-07 16:55:34 +0200 (Fri, 07 Sep 2007) New Revision: 500 Added: firmware/tuxaudio/branches/audio_cleanup/AT26F004.c firmware/tuxaudio/branches/audio_cleanup/AT26F004.h firmware/tuxaudio/branches/audio_cleanup/PC_communication.c firmware/tuxaudio/branches/audio_cleanup/PC_communication.h Modified: firmware/tuxaudio/branches/audio_cleanup/Makefile firmware/tuxaudio/branches/audio_cleanup/flash.c firmware/tuxaudio/branches/audio_cleanup/flash.h firmware/tuxaudio/branches/audio_cleanup/main.c firmware/tuxaudio/branches/audio_cleanup/spi.c firmware/tuxaudio/branches/audio_cleanup/spi.h Log: * Reorganized the flash memory files : - AT26F004 files contains the functions and definitions specific to the Atmel AT26F flash memory. - spi files contains the functions and definitions specific to access the SPI bus - flash files contains the functions and definitions to read / write in the flash memory for tux usage. * Added PC_communication module which contains the function(s) to manage received/to send frames by the RF module. * Some functions have been optimized in AT26F004.c module. Added: firmware/tuxaudio/branches/audio_cleanup/AT26F004.c =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/AT26F004.c (rev 0) +++ firmware/tuxaudio/branches/audio_cleanup/AT26F004.c 2007-09-07 14:55:34 UTC (rev 500) @@ -0,0 +1,160 @@ +/* + * TUXAUDIO - Firmware for the 'audio' CPU of tuxdroid + * Copyright (C) 2007 C2ME S.A. <tux...@c2...> + * + * 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: $ */ + +/* $Id: $ */ + +#include <avr/io.h> +#include "AT26F004.h" +#include "flash.h" +#include "spi.h" + + +uint8_t sector_adress[11][3] = { + {0x00, 0x00, 0x00}, + {0x01, 0x00, 0x00}, + {0x02, 0x00, 0x00}, + {0x03, 0x00, 0x00}, + {0x04, 0x00, 0x00}, + {0x05, 0x00, 0x00}, + {0x06, 0x00, 0x00}, + {0x07, 0x00, 0x00}, + {0x07, 0x80, 0x00}, + {0x07, 0xA0, 0x00}, + {0x07, 0xC0, 0x00} +}; + + +uint8_t read_status(void) +{ + uint8_t status; + + FLASH_CS_ON; /* Chip Select */ + spiSend(READ_STATUS_REG); /* Send Read Status Command */ + status = spiSend(NOP); /* Read status on spi */ + FLASH_CS_OFF; /* Chip Deselect */ + return status; +} +/** + * \ingroup flash + + \brief This function set the write enable flag of the flash memory. + */ + +void write_enable(void) +{ + FLASH_CS_ON; /* Chip Select */ + spiSend(WRITE_EN); /* Send Write Enable Command */ + FLASH_CS_OFF; /* Chip Deselect */ + +} +/** + * \ingroup flash + + \brief This function clear the write enable flag of the flash memory. + */ + +void write_disable(void) +{ + FLASH_CS_ON; /* Chip Select */ + spiSend(WRITE_DIS); /* Send Write Disable Command */ + FLASH_CS_OFF; /* Chip Deselect */ +} + +/** + * \ingroup flash + + \brief This function write into the flash memory status register. + */ + +void write_status(uint8_t const status) +{ + FLASH_CS_ON; /* Chip Select */ + spiSend(WRITE_STATUS_REG); /* Send Write Status Command */ + spiSend(status); /* Send status */ + FLASH_CS_OFF; /* Chip Deselect */ + +} +/** + * \ingroup flash + \param ad2 high address part + \param ad1 medium adress part + \param ad0 lower adress part + + \brief This function unprotect a sector. + */ +void unprotect_sector(uint8_t const ad2, uint8_t const ad1, uint8_t const ad0) +{ + FLASH_CS_ON; // Chip Select + spiSend(UNPROTECT_SECTOR); // Send unprotect sector command + spiSend(ad2); // Send Address + spiSend(ad1); + spiSend(ad0); + FLASH_CS_OFF; // Chip Deselect + +} +/** + * \ingroup flash + + \brief This function erase the entire memory. + */ + +void erase_flash(void) +{ + uint8_t i; + write_status(0x00); // Disable sector protection register + for (i=0; i<=10; i++) + { + write_enable(); // Enable the writing + unprotect_sector(sector_adress[i][0], sector_adress[i][1],sector_adress[i][2]); + } + + write_enable(); // Enable the writing + + FLASH_CS_ON; // Chip Select + spiSend(CHIP_ERASE); // Send Erase Bulk command + FLASH_CS_OFF; // Chip Deselect +} + +/** + * \ingroup flash + \param ad2 high address part + \param ad1 medium adress part + \param ad0 lower adress part + + \brief This function write a byte in the flash memory. + */ + +void program_flash(uint8_t const ad2, uint8_t const ad1, uint8_t const ad0, + uint8_t const data) +{ + while (read_status() & BUSY) ; // Wait Page Program Cycle + + write_enable(); + FLASH_CS_ON; // Chip Select + spiSend(BYTE_PROGRAM); // Send Page Byte Command + spiSend(ad2); // Send Address + spiSend(ad1); + spiSend(ad0); + spiSend(data); // Write data in flash + FLASH_CS_OFF; // Chip Deselect +} + + Added: firmware/tuxaudio/branches/audio_cleanup/AT26F004.h =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/AT26F004.h (rev 0) +++ firmware/tuxaudio/branches/audio_cleanup/AT26F004.h 2007-09-07 14:55:34 UTC (rev 500) @@ -0,0 +1,87 @@ +/* + * TUXAUDIO - Firmware for the 'audio' CPU of tuxdroid + * Copyright (C) 2007 C2ME S.A. <tux...@c2...> + * + * 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 + */ + +#ifndef AT26F004_H +#define AT26F004_H + +/* Flash (AT26F004) OP CODE */ +#define READ_ARRAY 0x0B +#define READ_ARRAY_LOW_F 0x03 + +#define BLOCK_ERASE_4K 0x20 +#define BLOCK_ERASE_32K 0x52 +#define BLOCK_ERASE_64K 0xD8 +#define CHIP_ERASE 0x60 + +#define BYTE_PROGRAM 0x02 +#define SEQU_PROGRAM 0xAF + +#define WRITE_EN 0x06 +#define WRITE_DIS 0x04 +#define PROTECT_SECTOR 0x36 +#define UNPROTECT_SECTOR 0x39 +#define READ_SECT_PROTECT 0x3C + +#define READ_STATUS_REG 0x05 +#define WRITE_STATUS_REG 0x01 + +#define READ_MANUFACT 0x9F +#define DEEP_POWER_MODE 0xB9 +#define RESUME_DEEP_MODE 0xAB + +#define NOP 0x00 + +/* Flash status register masks */ +#define BUSY 0x01 +#define WEL 0X02 +#define SWP 0x0C +#define WPP 0x10 +#define RES 0x20 +#define SPM 0x40 +#define SPRL 0x80 + +/* Flash sector adresses */ + +extern uint8_t sector_adress[11][3]; +/** + * \name Flash TOP address + * + * The flash memory address range is 0x000000 - [TOP_A2 TOP_A1 TOP_A0] + * The AT26F004 has an address range of 0x000000 - 0x7FFFFF + * @{ */ +/** High byte of the TOP address. */ +#define TOP_A2 0x07 +/** Middle byte of the TOP address. */ +#define TOP_A1 0xFF +/** Low byte of the TOP address. */ +#define TOP_A0 0xFF +/*! @} */ + + +extern uint8_t read_status(void); +extern void write_enable(void); +extern void write_disable(void); +extern void write_status(uint8_t const status); +extern void erase_flash(void); +extern void unprotect_sector(uint8_t const ad2, uint8_t const ad1, + uint8_t const ad0); +extern void program_flash(uint8_t const ad2, uint8_t const ad1, uint8_t const ad0, + uint8_t const data); + +#endif Modified: firmware/tuxaudio/branches/audio_cleanup/Makefile =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/Makefile 2007-09-07 13:55:42 UTC (rev 499) +++ firmware/tuxaudio/branches/audio_cleanup/Makefile 2007-09-07 14:55:34 UTC (rev 500) @@ -69,7 +69,7 @@ ## Objects that must be built in order to link -OBJECTS = init.o main.o varis.o fifo.o spi.o flash.o communication.o i2c.o config.o +OBJECTS = init.o main.o varis.o fifo.o spi.o AT26F004.o flash.o communication.o PC_communication.o i2c.o config.o ## Objects explicitly added by the user LINKONLYOBJECTS = @@ -94,12 +94,18 @@ spi.o: spi.c $(CC) $(INCLUDES) $(CFLAGS) -c $< +AT26F004.o: AT26F004.c + $(CC) $(INCLUDES) $(CFLAGS) -c $< + flash.o: flash.c $(CC) $(INCLUDES) $(CFLAGS) -c $< communication.o: communication.c $(CC) $(INCLUDES) $(CFLAGS) -c $< +communication.o: PC_communication.c + $(CC) $(INCLUDES) $(CFLAGS) -c $< + i2c.o: i2c.c $(CC) $(INCLUDES) $(CFLAGS) -c $< @@ -109,6 +115,9 @@ bootloader.o: bootloader.c $(CC) $(INCLUDES) $(CFLAGS) -c $< + + + ##Link $(TARGET): $(OBJECTS) $(CC) $(LDFLAGS) $(OBJECTS) $(LINKONLYOBJECTS) $(LIBDIRS) $(LIBS) -o $(TARGET) Added: firmware/tuxaudio/branches/audio_cleanup/PC_communication.c =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/PC_communication.c (rev 0) +++ firmware/tuxaudio/branches/audio_cleanup/PC_communication.c 2007-09-07 14:55:34 UTC (rev 500) @@ -0,0 +1,178 @@ +/* + * TUXAUDIO - Firmware for the 'audio' CPU of tuxdroid + * Copyright (C) 2007 C2ME S.A. <tux...@c2...> + * + * 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 <avr/io.h> +#include <avr/interrupt.h> + +#include "varis.h" +#include "fifo.h" +#include "communication.h" +#include "spi.h" + +void spiTransaction(void) +{ + if ((spi_start) && (spi_enable)) // Wait start + { + spi_start = 0; // Reset the spi start flag + spi_enable = 0; // Communication in progress + spi_count = 0; // Reset spi counter + spi_slave = HEADERS; // Set state machine + spi_master = HEADERM; + if (programmingFlash) + PORTB &= ~0x01; + // Reset SPI to fix strange bug on the spi + SPCR = 0x50; + SPSR = 0x00; + asm volatile /* Clear the SPI interrupt flag */ + ("in __tmp_reg__, %0" "\n\t" "in __tmp_reg__, %1" "\n\t":: + "I" (_SFR_IO_ADDR(SPSR)), "I"(_SFR_IO_ADDR(SPDR))); + + PORTB &= ~0x04; // Chip select + while (1) + { + if (spi_ready) + { + spi_ready = 0; + if (spi_slave == HEADERS) + { + /* Sound */ + if (fifoLength(&ADCFifo) >= 17) + spi_headerb = 0x02; /* frame will contain sound */ + else + spi_headerb = 0x00; /* no sound in frame */ + + /* Status */ + if ((rf_data_sent_ack == RF_DATA_SENT_NACKED) + || (rf_data_sent_ack == RF_DATA_SENT_DROPPED)) + { + spi_headerb |= 0x08; /* resend the previous status if nacked */ + cli(); + sei(); + } + else if (rf_data_sent_ack != RF_DATA_SENT_BUSY) /* wait the end of transmission */ + if (!popStatus(spi_commandTX)) /* fetch the next status */ + spi_headerb |= 0x08; /* indicate that the frame contains status */ + + SPDR = spi_headerb; // Header byte + spi_slave = GET_SOUND_FIFO; // Next state + } + else if (spi_slave == GET_SOUND_FIFO) + { + if (spi_count == 17) + spi_slave = PUT_COMMAND; // Next state + if (spi_headerb & 0x02) + { + cli(); + SPDR = pullFifo(&ADCFifo); // Get data from FIFO + sei(); + } + else + SPDR = 0x00; // No data to transmit + } + else if (spi_slave == PUT_COMMAND) + { + if (spi_count == 21) + spi_slave = DUMMY; // Next state + if (spi_headerb & 0x08) + { + SPDR = spi_commandTX[spi_count - 18]; // Get command from buffer + } + else + SPDR = 0x00; // No command to transmit + } + else if (spi_slave == DUMMY) + { + SPDR = 0x00; // Dummy byte in case of big frame + } + + while ((SPSR & 0x80) == 0) ; // Wait SPI response + + spi_count++; + if (spi_master == HEADERM) + { + spi_master_config = SPDR; // Save header config byte + if (spi_master_config & 0x08) // Command + commandRX = 1; // Flag to send command on I2C + if (spi_master_config & 0x80) // Double frame + spi_lenght_data = 34; + else + spi_lenght_data = 17; + spi_master = PUT_SOUND_FIFO; // Go to the next state + + if (!programmingFlash) // XXX code must be review it's very strange ..... + { + if (!(spi_master_config & 0x02)) + { + if (!lockAdaptFifo) + { + cli(); + adaptFifo(&PWMFifo); // Adaptative FIFO + sei(); + lockAdaptFifo = 1; + } + else + resetFifo(&PWMFifo); + } + else + { + lockAdaptFifo = 0; + } + } + + } + else if (spi_master == PUT_SOUND_FIFO) + { + if (spi_master_config & 0x02) + { + cli(); + pushFifo(&PWMFifo, SPDR); // Put into the FIFO + sei(); + } + if (spi_count == (spi_lenght_data + 1)) + spi_master = READ_COMMAND; // Go to the next state + } + else if (spi_master == READ_COMMAND) + { + if (spi_master_config & 0x08) + { + 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 + } + if (spi_count == spi_lenght_data + 6) + { + /* Check the acknowledge from the rf */ + if (spi_headerb & 0x08) /* if data was sent in the current SPI transaction, mark buffer as full and drop the received status */ + rf_data_sent_ack = RF_DATA_SENT_BUSY; /* status buffer of the rf filled */ + else + rf_data_sent_ack = spi_commandRX[4]; /* get the acknowledge of the previous sent data */ + + PORTB |= 0x04; // Chip deselect + spi_enable = 1; + break; + } + } + } + } + } +} + Added: firmware/tuxaudio/branches/audio_cleanup/PC_communication.h =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/PC_communication.h (rev 0) +++ firmware/tuxaudio/branches/audio_cleanup/PC_communication.h 2007-09-07 14:55:34 UTC (rev 500) @@ -0,0 +1,27 @@ +/* + * TUXAUDIO - Firmware for the 'audio' CPU of tuxdroid + * Copyright (C) 2007 C2ME S.A. <tux...@c2...> + * + * 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: $ */ + +#ifndef PC_COMMUNICATION_H +#define PC_COMMUNICATION_H + +extern void spiTransaction(void); + +#endif Modified: firmware/tuxaudio/branches/audio_cleanup/flash.c =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/flash.c 2007-09-07 13:55:42 UTC (rev 499) +++ firmware/tuxaudio/branches/audio_cleanup/flash.c 2007-09-07 14:55:34 UTC (rev 500) @@ -24,6 +24,7 @@ #include "spi.h" #include "i2c.h" #include "flash.h" +#include "AT26F004.h" /* Declarations */ /* Theses functions are declared with the static attribute, so they're * accessible only by this module */ @@ -33,15 +34,6 @@ static void initSoundProgramming(void); static void soundProgramming(void); static void endProgramming(void); -static uint8_t read_status(void); -static void write_enable(void); -static void write_disable(void); -static void write_status(uint8_t const status); -static void erase_flash(void); -static void unprotect_sector(uint8_t const ad2, uint8_t const ad1, - uint8_t const ad0); -static void program_flash(uint8_t const ad2, uint8_t const ad1, uint8_t const ad0, - uint8_t const data); uint8_t f_state = 0; @@ -75,7 +67,7 @@ PORTB |= 0x01; if (f_state == ERASE_STATE) { - if (read_status() == 0x10) + if (read_status() & BUSY) f_state ++; } else if (f_state == FIRST_PROG_STATE) @@ -199,9 +191,9 @@ PORTB |= 0x02; // Chip Deselect /* Check adresses */ - if (ad[0] > 0x07) + if (ad[0] > TOP_A2) return; /* don't read outside the flash */ - if (ad[3] > 0x07) + if (ad[3] > TOP_A2) return; /* don't read outside the flash */ if ((ad[0] == 0) && (ad[1] < 0x04)) return; /* minimum index not respected */ @@ -247,142 +239,12 @@ \brief This function read the flash memory status. */ -static uint8_t read_status(void) -{ - uint8_t status; - FLASH_CS_ON; /* Chip Select */ - spiSend(READ_STATUS_REG); /* Send Read Status Command */ - status = spiSend(NOP); /* Read status on spi */ - FLASH_CS_OFF; /* Chip Deselect */ - return status; -} -/** - * \ingroup flash - \brief This function set the write enable flag of the flash memory. - */ -static void write_enable(void) -{ - FLASH_CS_ON; /* Chip Select */ - spiSend(WRITE_EN); /* Send Write Enable Command */ - FLASH_CS_OFF; /* Chip Deselect */ -} /** * \ingroup flash - - \brief This function clear the write enable flag of the flash memory. - */ - -static void write_disable(void) -{ - FLASH_CS_ON; /* Chip Select */ - spiSend(WRITE_DIS); /* Send Write Disable Command */ - FLASH_CS_OFF; /* Chip Deselect */ -} - -/** - * \ingroup flash - - \brief This function write into the flash memory status register. - */ - -static void write_status(uint8_t const status) -{ - FLASH_CS_ON; /* Chip Select */ - spiSend(WRITE_STATUS_REG); /* Send Write Status Command */ - spiSend(status); /* Send status */ - FLASH_CS_OFF; /* Chip Deselect */ - -} -/** - * \ingroup flash - \param ad2 high address part - \param ad1 medium adress part - \param ad0 lower adress part - - \brief This function unprotect a sector. - */ -static void unprotect_sector(uint8_t const ad2, uint8_t const ad1, uint8_t const ad0) -{ - FLASH_CS_ON; // Chip Select - spiSend(UNPROTECT_SECTOR); // Send unprotect sector command - spiSend(ad2); // Send Address - spiSend(ad1); - spiSend(ad0); - FLASH_CS_OFF; // Chip Deselect - -} -/** - * \ingroup flash - - \brief This function erase the entire memory. - */ - -static void erase_flash(void) -{ - write_status(0x00); // Disable sector protection register - write_enable(); // Enable the writing - unprotect_sector(SECTOR0); - write_enable(); // Enable the writing - unprotect_sector(SECTOR1); - write_enable(); // Enable the writing - unprotect_sector(SECTOR2); - write_enable(); // Enable the writing - unprotect_sector(SECTOR3); - write_enable(); // Enable the writing - unprotect_sector(SECTOR4); - write_enable(); // Enable the writing - unprotect_sector(SECTOR5); - write_enable(); // Enable the writing - unprotect_sector(SECTOR6); - write_enable(); // Enable the writing - unprotect_sector(SECTOR7); - write_enable(); // Enable the writing - unprotect_sector(SECTOR8); - write_enable(); // Enable the writing - unprotect_sector(SECTOR9); - write_enable(); // Enable the writing - unprotect_sector(SECTOR10); - - write_enable(); // Enable the writing - - FLASH_CS_ON; // Chip Select - spiSend(CHIP_ERASE); // Send Erase Bulk command - FLASH_CS_OFF; // Chip Deselect -} - -/** - * \ingroup flash - \param ad2 high address part - \param ad1 medium adress part - \param ad0 lower adress part - - \brief This function write a byte in the flash memory. - */ - -static void program_flash(uint8_t const ad2, uint8_t const ad1, uint8_t const ad0, - uint8_t const data) -{ - write_enable(); - FLASH_CS_ON; // Chip Select - spiSend(BYTE_PROGRAM); // Send Page Byte Command - spiSend(ad2); // Send Address - spiSend(ad1); - spiSend(ad0); - spiSend(data); // Write data in flash - FLASH_CS_OFF; // Chip Deselect - - while (read_status() != 0x10) ; // Wait Page Program Cycle -} - - - - -/** - * \ingroup flash * \brief Write the number of sound to be stored. This function store the first TOC byte (numSound), received with the flash program command, at the first memory adress. @@ -485,7 +347,7 @@ if (ad1 == 0x00) ad2++; } - while (read_status() != 0x52) ; // Wait Page Program Cycle + while (read_status() & BUSY) ; // Wait Page Program Cycle } /* Check for the last sound byte */ Modified: firmware/tuxaudio/branches/audio_cleanup/flash.h =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/flash.h 2007-09-07 13:55:42 UTC (rev 499) +++ firmware/tuxaudio/branches/audio_cleanup/flash.h 2007-09-07 14:55:34 UTC (rev 500) @@ -34,47 +34,12 @@ #ifndef FLASH_H #define FLASH_H -/* Flash (AT26F004) OP CODE define */ -#define READ_ARRAY 0x0B -#define READ_ARRAY_LOW_F 0x03 -#define BLOCK_ERASE_4K 0x20 -#define BLOCK_ERASE_32K 0x52 -#define BLOCK_ERASE_64K 0xD8 -#define CHIP_ERASE 0x60 -#define BYTE_PROGRAM 0x02 -#define SEQU_PROGRAM 0xAF -#define WRITE_EN 0x06 -#define WRITE_DIS 0x04 -#define PROTECT_SECTOR 0x36 -#define UNPROTECT_SECTOR 0x39 -#define READ_SECT_PROTECT 0x3C - -#define READ_STATUS_REG 0x05 -#define WRITE_STATUS_REG 0x01 - -#define READ_MANUFACT 0x9F -#define DEEP_POWER_MODE 0xB9 -#define RESUME_DEEP_MODE 0xAB - -#define NOP 0x00 - #define FLASH_CS_ON PORTB &= ~0x02 #define FLASH_CS_OFF PORTB |= 0x02 -#define SECTOR0 0x00, 0x00, 0x00 -#define SECTOR1 0x01, 0x00, 0x00 -#define SECTOR2 0x02, 0x00, 0X00 -#define SECTOR3 0x03, 0x00, 0X00 -#define SECTOR4 0x04, 0x00, 0X00 -#define SECTOR5 0x05, 0x00, 0X00 -#define SECTOR6 0x06, 0x00, 0X00 -#define SECTOR7 0x07, 0x00, 0X00 -#define SECTOR8 0x07, 0x80, 0X00 -#define SECTOR9 0x07, 0xA0, 0X00 -#define SECTOR10 0x07, 0xC0, 0X00 /* Flash programming states */ #define ERASE_STATE 0 Modified: firmware/tuxaudio/branches/audio_cleanup/main.c =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/main.c 2007-09-07 13:55:42 UTC (rev 499) +++ firmware/tuxaudio/branches/audio_cleanup/main.c 2007-09-07 14:55:34 UTC (rev 500) @@ -34,6 +34,7 @@ #include "flash.h" #include "version.h" #include "config.h" +#include "PC_communication.h" /* * Version number Modified: firmware/tuxaudio/branches/audio_cleanup/spi.c =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/spi.c 2007-09-07 13:55:42 UTC (rev 499) +++ firmware/tuxaudio/branches/audio_cleanup/spi.c 2007-09-07 14:55:34 UTC (rev 500) @@ -17,164 +17,12 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: */ +/* $Id: $ */ #include <avr/io.h> -#include <avr/interrupt.h> +#include "spi.h" -#include "varis.h" -#include "fifo.h" -#include "communication.h" -void spiTransaction(void) -{ - if ((spi_start) && (spi_enable)) // Wait start - { - spi_start = 0; // Reset the spi start flag - spi_enable = 0; // Communication in progress - spi_count = 0; // Reset spi counter - spi_slave = HEADERS; // Set state machine - spi_master = HEADERM; - if (programmingFlash) - PORTB &= ~0x01; - // Reset SPI to fix strange bug on the spi - SPCR = 0x50; - SPSR = 0x00; - asm volatile /* Clear the SPI interrupt flag */ - ("in __tmp_reg__, %0" "\n\t" "in __tmp_reg__, %1" "\n\t":: - "I" (_SFR_IO_ADDR(SPSR)), "I"(_SFR_IO_ADDR(SPDR))); - - PORTB &= ~0x04; // Chip select - while (1) - { - if (spi_ready) - { - spi_ready = 0; - if (spi_slave == HEADERS) - { - /* Sound */ - if (fifoLength(&ADCFifo) >= 17) - spi_headerb = 0x02; /* frame will contain sound */ - else - spi_headerb = 0x00; /* no sound in frame */ - - /* Status */ - if ((rf_data_sent_ack == RF_DATA_SENT_NACKED) - || (rf_data_sent_ack == RF_DATA_SENT_DROPPED)) - { - spi_headerb |= 0x08; /* resend the previous status if nacked */ - cli(); - sei(); - } - else if (rf_data_sent_ack != RF_DATA_SENT_BUSY) /* wait the end of transmission */ - if (!popStatus(spi_commandTX)) /* fetch the next status */ - spi_headerb |= 0x08; /* indicate that the frame contains status */ - - SPDR = spi_headerb; // Header byte - spi_slave = GET_SOUND_FIFO; // Next state - } - else if (spi_slave == GET_SOUND_FIFO) - { - if (spi_count == 17) - spi_slave = PUT_COMMAND; // Next state - if (spi_headerb & 0x02) - { - cli(); - SPDR = pullFifo(&ADCFifo); // Get data from FIFO - sei(); - } - else - SPDR = 0x00; // No data to transmit - } - else if (spi_slave == PUT_COMMAND) - { - if (spi_count == 21) - spi_slave = DUMMY; // Next state - if (spi_headerb & 0x08) - { - SPDR = spi_commandTX[spi_count - 18]; // Get command from buffer - } - else - SPDR = 0x00; // No command to transmit - } - else if (spi_slave == DUMMY) - { - SPDR = 0x00; // Dummy byte in case of big frame - } - - while ((SPSR & 0x80) == 0) ; // Wait SPI response - - spi_count++; - if (spi_master == HEADERM) - { - spi_master_config = SPDR; // Save header config byte - if (spi_master_config & 0x08) // Command - commandRX = 1; // Flag to send command on I2C - if (spi_master_config & 0x80) // Double frame - spi_lenght_data = 34; - else - spi_lenght_data = 17; - spi_master = PUT_SOUND_FIFO; // Go to the next state - - if (!programmingFlash) // XXX code must be review it's very strange ..... - { - if (!(spi_master_config & 0x02)) - { - if (!lockAdaptFifo) - { - cli(); - adaptFifo(&PWMFifo); // Adaptative FIFO - sei(); - lockAdaptFifo = 1; - } - else - resetFifo(&PWMFifo); - } - else - { - lockAdaptFifo = 0; - } - } - - } - else if (spi_master == PUT_SOUND_FIFO) - { - if (spi_master_config & 0x02) - { - cli(); - pushFifo(&PWMFifo, SPDR); // Put into the FIFO - sei(); - } - if (spi_count == (spi_lenght_data + 1)) - spi_master = READ_COMMAND; // Go to the next state - } - else if (spi_master == READ_COMMAND) - { - if (spi_master_config & 0x08) - { - 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 - } - if (spi_count == spi_lenght_data + 6) - { - /* Check the acknowledge from the rf */ - if (spi_headerb & 0x08) /* if data was sent in the current SPI transaction, mark buffer as full and drop the received status */ - rf_data_sent_ack = RF_DATA_SENT_BUSY; /* status buffer of the rf filled */ - else - rf_data_sent_ack = spi_commandRX[4]; /* get the acknowledge of the previous sent data */ - - PORTB |= 0x04; // Chip deselect - spi_enable = 1; - break; - } - } - } - } - } -} - unsigned char spiSend(unsigned char data) { SPDR = data; // Send Read Page Command Modified: firmware/tuxaudio/branches/audio_cleanup/spi.h =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/spi.h 2007-09-07 13:55:42 UTC (rev 499) +++ firmware/tuxaudio/branches/audio_cleanup/spi.h 2007-09-07 14:55:34 UTC (rev 500) @@ -17,12 +17,11 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: */ +/* $Id: $ */ #ifndef SPI_H #define SPI_H -extern void spiTransaction(void); extern unsigned char spiSend(unsigned char data); #endif |
From: jaguarondi <c2m...@c2...> - 2007-09-07 13:55:42
|
Author: jaguarondi Date: 2007-09-07 15:55:42 +0200 (Fri, 07 Sep 2007) New Revision: 499 Modified: firmware/tuxaudio/trunk/spi.c firmware/tuxaudio/trunk/varis.c firmware/tuxaudio/trunk/varis.h Log: * Reverted changes of r455 as it's not fully compatible with the current RF firmware. We'll check this again when finishing implementing the sleep. Modified: firmware/tuxaudio/trunk/spi.c =================================================================== --- firmware/tuxaudio/trunk/spi.c 2007-09-07 13:54:12 UTC (rev 498) +++ firmware/tuxaudio/trunk/spi.c 2007-09-07 13:55:42 UTC (rev 499) @@ -57,26 +57,17 @@ else spi_headerb = 0x00; /* no sound in frame */ - /* Resend the previous command if nacked */ - if ((rf_data_sent_ack == RF_DATA_SENT_NACKED) && - (unlockCommand)) + /* Status */ + if ((rf_data_sent_ack == RF_DATA_SENT_NACKED) + || (rf_data_sent_ack == RF_DATA_SENT_DROPPED)) { - spi_headerb |= 0x08; - unlockCommand = 0x00; + spi_headerb |= 0x08; /* resend the previous status if nacked */ + cli(); + sei(); } - /* Wait the end of transmission */ - else if ((rf_data_sent_ack != RF_DATA_SENT_BUSY) && - (unlockCommand)) - { - /* fetch the next status */ - if (!popStatus(spi_commandTX)) - { - /* indicate that the frame contains status */ - spi_headerb |= 0x08; - rf_data_sent_ack = RF_DATA_SENT_BUSY; - unlockCommand = 0x00; - } - } + else if (rf_data_sent_ack != RF_DATA_SENT_BUSY) /* wait the end of transmission */ + if (!popStatus(spi_commandTX)) /* fetch the next status */ + spi_headerb |= 0x08; /* indicate that the frame contains status */ SPDR = spi_headerb; // Header byte spi_slave = GET_SOUND_FIFO; // Next state @@ -164,20 +155,15 @@ spi_commandRX[spi_count - 36] = SPDR; // Put command into the buffer else spi_commandRX[spi_count - 19] = SPDR; // Put command into the buffer - if (spi_count == spi_lenght_data + 6) - { - if ((spi_commandRX[4] == RF_DATA_SENT_ACKED) || - (spi_commandRX[4] == RF_DATA_SENT_NACKED)) - /* Get acknowledge of previous sent data */ - rf_data_sent_ack = spi_commandRX[4]; - } } - else if ((rf_data_sent_ack == RF_DATA_SENT_ACKED) || - (rf_data_sent_ack == RF_DATA_SENT_NACKED)) - /* Wait radio ready to send the next command */ - unlockCommand = 1; if (spi_count == spi_lenght_data + 6) { + /* Check the acknowledge from the rf */ + if (spi_headerb & 0x08) /* if data was sent in the current SPI transaction, mark buffer as full and drop the received status */ + rf_data_sent_ack = RF_DATA_SENT_BUSY; /* status buffer of the rf filled */ + else + rf_data_sent_ack = spi_commandRX[4]; /* get the acknowledge of the previous sent data */ + PORTB |= 0x04; // Chip deselect spi_enable = 1; break; Modified: firmware/tuxaudio/trunk/varis.c =================================================================== --- firmware/tuxaudio/trunk/varis.c 2007-09-07 13:54:12 UTC (rev 498) +++ firmware/tuxaudio/trunk/varis.c 2007-09-07 13:55:42 UTC (rev 499) @@ -43,7 +43,6 @@ volatile unsigned char spi_commandRX[5]; unsigned char commandRX = 0; uint8_t rf_data_sent_ack; -uint8_t unlockCommand = 1; // FIFO Variable volatile uint8_t PWMbuffer[128]; Modified: firmware/tuxaudio/trunk/varis.h =================================================================== --- firmware/tuxaudio/trunk/varis.h 2007-09-07 13:54:12 UTC (rev 498) +++ firmware/tuxaudio/trunk/varis.h 2007-09-07 13:55:42 UTC (rev 499) @@ -45,7 +45,6 @@ extern volatile unsigned char spi_commandRX[5]; extern unsigned char commandRX; extern uint8_t rf_data_sent_ack; -extern uint8_t unlockCommand; #define RF_DATA_SENT_FREE 0x00 #define RF_DATA_SENT_BUSY 0x01 |
From: jaguarondi <c2m...@c2...> - 2007-09-07 13:54:37
|
Author: jaguarondi Date: 2007-09-07 15:54:12 +0200 (Fri, 07 Sep 2007) New Revision: 498 Modified: firmware/tuxaudio/trunk/flash.c Log: * Forgot to add the include of flash.h. Modified: firmware/tuxaudio/trunk/flash.c =================================================================== --- firmware/tuxaudio/trunk/flash.c 2007-09-07 13:01:38 UTC (rev 497) +++ firmware/tuxaudio/trunk/flash.c 2007-09-07 13:54:12 UTC (rev 498) @@ -23,6 +23,7 @@ #include "varis.h" #include "spi.h" #include "i2c.h" +#include "flash.h" unsigned char read_status(void); void write_enable(void); |
From: Paul_R <c2m...@c2...> - 2007-09-07 13:01:38
|
Author: Paul_R Date: 2007-09-07 15:01:38 +0200 (Fri, 07 Sep 2007) New Revision: 497 Modified: firmware/tuxaudio/branches/audio_cleanup/spi.c firmware/tuxaudio/branches/audio_cleanup/varis.c firmware/tuxaudio/branches/audio_cleanup/varis.h Log: * Reverted the changes of the rev. 455 Modified: firmware/tuxaudio/branches/audio_cleanup/spi.c =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/spi.c 2007-09-07 12:33:20 UTC (rev 496) +++ firmware/tuxaudio/branches/audio_cleanup/spi.c 2007-09-07 13:01:38 UTC (rev 497) @@ -58,26 +58,17 @@ else spi_headerb = 0x00; /* no sound in frame */ - /* Resend the previous command if nacked */ - if ((rf_data_sent_ack == RF_DATA_SENT_NACKED) && - (unlockCommand)) + /* Status */ + if ((rf_data_sent_ack == RF_DATA_SENT_NACKED) + || (rf_data_sent_ack == RF_DATA_SENT_DROPPED)) { - spi_headerb |= 0x08; - unlockCommand = 0x00; + spi_headerb |= 0x08; /* resend the previous status if nacked */ + cli(); + sei(); } - /* Wait the end of transmission */ - else if ((rf_data_sent_ack != RF_DATA_SENT_BUSY) && - (unlockCommand)) - { - /* fetch the next status */ - if (!popStatus(spi_commandTX)) - { - /* indicate that the frame contains status */ - spi_headerb |= 0x08; - rf_data_sent_ack = RF_DATA_SENT_BUSY; - unlockCommand = 0x00; - } - } + else if (rf_data_sent_ack != RF_DATA_SENT_BUSY) /* wait the end of transmission */ + if (!popStatus(spi_commandTX)) /* fetch the next status */ + spi_headerb |= 0x08; /* indicate that the frame contains status */ SPDR = spi_headerb; // Header byte spi_slave = GET_SOUND_FIFO; // Next state @@ -165,20 +156,15 @@ spi_commandRX[spi_count - 36] = SPDR; // Put command into the buffer else spi_commandRX[spi_count - 19] = SPDR; // Put command into the buffer - if (spi_count == spi_lenght_data + 6) - { - if ((spi_commandRX[4] == RF_DATA_SENT_ACKED) || - (spi_commandRX[4] == RF_DATA_SENT_NACKED)) - /* Get acknowledge of previous sent data */ - rf_data_sent_ack = spi_commandRX[4]; - } } - else if ((rf_data_sent_ack == RF_DATA_SENT_ACKED) || - (rf_data_sent_ack == RF_DATA_SENT_NACKED)) - /* Wait radio ready to send the next command */ - unlockCommand = 1; if (spi_count == spi_lenght_data + 6) { + /* Check the acknowledge from the rf */ + if (spi_headerb & 0x08) /* if data was sent in the current SPI transaction, mark buffer as full and drop the received status */ + rf_data_sent_ack = RF_DATA_SENT_BUSY; /* status buffer of the rf filled */ + else + rf_data_sent_ack = spi_commandRX[4]; /* get the acknowledge of the previous sent data */ + PORTB |= 0x04; // Chip deselect spi_enable = 1; break; Modified: firmware/tuxaudio/branches/audio_cleanup/varis.c =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/varis.c 2007-09-07 12:33:20 UTC (rev 496) +++ firmware/tuxaudio/branches/audio_cleanup/varis.c 2007-09-07 13:01:38 UTC (rev 497) @@ -43,7 +43,6 @@ volatile unsigned char spi_commandRX[5]; unsigned char commandRX = 0; uint8_t rf_data_sent_ack; -uint8_t unlockCommand = 1; // FIFO Variable volatile uint8_t PWMbuffer[128]; Modified: firmware/tuxaudio/branches/audio_cleanup/varis.h =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/varis.h 2007-09-07 12:33:20 UTC (rev 496) +++ firmware/tuxaudio/branches/audio_cleanup/varis.h 2007-09-07 13:01:38 UTC (rev 497) @@ -45,7 +45,6 @@ extern volatile unsigned char spi_commandRX[5]; extern unsigned char commandRX; extern uint8_t rf_data_sent_ack; -extern uint8_t unlockCommand; #define RF_DATA_SENT_FREE 0x00 #define RF_DATA_SENT_BUSY 0x01 |
From: jaguarondi <c2m...@c2...> - 2007-09-07 12:33:34
|
Author: jaguarondi Date: 2007-09-07 14:33:20 +0200 (Fri, 07 Sep 2007) New Revision: 496 Modified: firmware/tuxaudio/trunk/flash.c firmware/tuxaudio/trunk/flash.h Log: * BUG: when the sounds stored in the audio flash are too long, we don't block anymore in the programming function. The extra sound is simply not stored in the flash. Modified: firmware/tuxaudio/trunk/flash.c =================================================================== --- firmware/tuxaudio/trunk/flash.c 2007-09-06 15:25:15 UTC (rev 495) +++ firmware/tuxaudio/trunk/flash.c 2007-09-07 12:33:20 UTC (rev 496) @@ -246,7 +246,7 @@ if (ad1 == 0x00) ad2++; } - while (read_status() != 0x52) ; // Wait Page Program Cycle + while (read_status() & 0x01); /* Wait RDY/BSY to be ready. */ } if (ad2 == ad[2]) { @@ -314,9 +314,9 @@ PORTB |= 0x02; // Chip Deselect /* Check adresses */ - if (ad[0] > 0x07) + if (ad[0] > TOP_A2) return; /* don't read outside the flash */ - if (ad[3] > 0x07) + if (ad[3] > TOP_A2) return; /* don't read outside the flash */ if ((ad[0] == 0) && (ad[1] < 0x04)) return; /* minimum index not respected */ Modified: firmware/tuxaudio/trunk/flash.h =================================================================== --- firmware/tuxaudio/trunk/flash.h 2007-09-06 15:25:15 UTC (rev 495) +++ firmware/tuxaudio/trunk/flash.h 2007-09-07 12:33:20 UTC (rev 496) @@ -35,4 +35,18 @@ extern void playingAudio(unsigned char nsound); extern void stopPlayingAudio(void); +/** + * \name Flash TOP address + * + * The flash memory address range is 0x000000 - [TOP_A2 TOP_A1 TOP_A0] + * The AT26F004 has an address range of 0x000000 - 0x7FFFFF + * @{ */ +/** High byte of the TOP address. */ +#define TOP_A2 0x07 +/** Middle byte of the TOP address. */ +#define TOP_A1 0xFF +/** Low byte of the TOP address. */ +#define TOP_A0 0xFF +/*! @} */ + #endif |
From: jaguarondi <c2m...@c2...> - 2007-09-06 16:33:58
|
Author: jaguarondi Date: 2007-09-06 17:23:54 +0200 (Thu, 06 Sep 2007) New Revision: 494 Modified: firmware/tuxcore/trunk/doc/Doxyfile Log: * Don't sort members alphabetically in the documentation pages, keep them in declaration order. Modified: firmware/tuxcore/trunk/doc/Doxyfile =================================================================== --- firmware/tuxcore/trunk/doc/Doxyfile 2007-09-06 14:45:08 UTC (rev 493) +++ firmware/tuxcore/trunk/doc/Doxyfile 2007-09-06 15:23:54 UTC (rev 494) @@ -18,7 +18,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# $Id:$ +# $Id$ # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project @@ -342,7 +342,7 @@ # alphabetically by member name. If set to NO the members will appear in # declaration order. -SORT_MEMBER_DOCS = YES +SORT_MEMBER_DOCS = NO # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the # brief documentation of file, namespace and class members alphabetically |
From: jaguarondi <c2m...@c2...> - 2007-09-06 16:32:24
|
Author: jaguarondi Date: 2007-09-06 17:25:15 +0200 (Thu, 06 Sep 2007) New Revision: 495 Added: firmware/tuxcore/trunk/hardware.h Modified: firmware/tuxcore/trunk/global.h firmware/tuxcore/trunk/ir.c firmware/tuxcore/trunk/led.c firmware/tuxcore/trunk/motors.h firmware/tuxcore/trunk/sensors.c Log: * Moved all defines related to I/O ports to hardware.h. Doxygen comments added. Modified: firmware/tuxcore/trunk/global.h =================================================================== --- firmware/tuxcore/trunk/global.h 2007-09-06 15:23:54 UTC (rev 494) +++ firmware/tuxcore/trunk/global.h 2007-09-06 15:25:15 UTC (rev 495) @@ -19,150 +19,16 @@ /* $Id$ */ -#ifndef GLOBAL_H -#define GLOBAL_H +/** \file global.h + \brief Global ressources +*/ +#ifndef _GLOBAL_H_ +#define _GLOBAL_H_ + #include <avr/io.h> #include "common/commands.h" -/* - * -------------------------------------------------------- - * SWITCHES - * -------------------------------------------------------- - */ - -/* Switches */ -// #define SW_PT PORTB [> switch port <] -// #define SW_PIN PINB [> switch input port <] -// #define SW_DDR DDRB [> switch DDR <] -// #define SW_MK (_BV(PB3) | _BV(PB4) | _BV(PB5)) -// #define SW_LW_MK _BV(PB3) [> left wing switch <] -// #define SW_RW_MK _BV(PB4) [> right wing switch <] -#define SW_HD_PIN PINB /* head switch input port */ -#define SW_HD_PT PORTB /* head switch port */ -#define SW_HD_DDR DDRB /* head switch DDR */ -#define SW_HD_MK _BV(PB5) /* head switch */ - -/* Position Switches */ -#define PSW_SPIN_MK _BV(PD3) /* spin switch */ -#define PSW_SPIN_PT PORTD -#define PSW_SPIN_PIN PIND -#define PSW_SPIN_DDR DDRD -#define PSW_WINGS_MK _BV(PC1) /* wings switch */ -#define PSW_WINGS_PT PORTC -#define PSW_WINGS_PIN PINC -#define PSW_WINGS_DDR DDRC -#define PSW_MOUTH_PT PORTB -#define PSW_MOUTH_PIN PINB -#define PSW_MOUTH_DDR DDRB -#define PSW_MOUTH_O_MK _BV(PB3) /* mouth switch when opened */ -#define PSW_MOUTH_C_MK _BV(PB4) /* mouth switch when closed */ -#define PSW_MOUTH_MK (PSW_MOUTH_O_MK | PSW_MOUTH_C_MK) -#define PSW_EYES_PT PORTD -#define PSW_EYES_PIN PIND -#define PSW_EYES_DDR DDRD -#define PSW_EYES_O_MK _BV(PD6) /* eyes switch when opened */ -#define PSW_EYES_C_MK _BV(PD7) /* eyes switch when closed */ -#define PSW_EYES_MK (PSW_EYES_O_MK | PSW_EYES_C_MK) - -/* - * -------------------------------------------------------- - * IR - * -------------------------------------------------------- - */ - -#define IR_LED_PT PORTD /* ir led */ -#define IR_LED_DDR DDRD -#define IR_LED_MK _BV(PD5) -#define IR_REC_PT PORTD /* ir receiver */ -#define IR_REC_PIN PIND -#define IR_REC_DDR DDRD -#define IR_REC_MK _BV(PD2) - -/* - * -------------------------------------------------------- - * PHOTOTRANSISTOR - * -------------------------------------------------------- - */ - -#define LIGHT_PU_PORT PORTC -#define LIGHT_PU_MK _BV(PC0) -#define LIGHT_PU_DDR DDRC - -/* - * -------------------------------------------------------- - * CHARGER - * -------------------------------------------------------- - */ - -#define CHARGER_INH_PT PORTB -#define CHARGER_INH_DDR DDRB -#define CHARGER_INH_MK _BV(PB6) - -/* - * -------------------------------------------------------- - * LEDs - * -------------------------------------------------------- - */ - -#define LED_PT PORTC /* blue eye leds */ -#define LED_PIN PINC /* blue eye leds */ -#define LED_DDR DDRC -#define LED_L_MK _BV(PC2) /* right blue led */ -#define LED_R_MK _BV(PC3) /* left blue led */ -#define LED_MK (LED_R_MK | LED_L_MK) - -/* - * -------------------------------------------------------- - * ETERNAL I/O - * -------------------------------------------------------- - */ - -#define EXIO_PT PORTB -#define EXIO_DDR DDRB -#define EXIO_PIN PINB -#define EXIO_MK _BV(PB7) - -/* - * -------------------------------------------------------- - * MOTORS - * -------------------------------------------------------- - */ - -/* I/O */ -// #define MOT_PT PORTD [> motors port <] -// #define MOT_DDR DDRD -// #define MOT_MK (MOT_WINGS_FW | MOT_WINGS_BW | MOT_MOUTH_MK | MOT_EYES_MK | MOT_SPIN_R_MK | MOT_SPIN_L_MK) -#define MOT_WINGS_BW_MK _BV(PD4) /* wing motor forward */ -#define MOT_WINGS_BW_PT PORTD -#define MOT_WINGS_BW_DDR DDRD -#define MOT_WINGS_FW_MK _BV(PB0) /* wing motor backward */ -#define MOT_WINGS_FW_PT PORTB -#define MOT_WINGS_FW_DDR DDRB -#define wingsPwmMask pwmMaskB -#define MOT_MOUTH_MK _BV(PD1) /* mouth motor (forward) */ -#define MOT_MOUTH_PT PORTD -#define MOT_MOUTH_DDR DDRD -#define MOT_IMOUTH_MK _BV(PD0) /* inverted mouth motor (backward) */ -#define MOT_IMOUTH_PT PORTD -#define MOT_IMOUTH_DDR DDRD -#define MOT_IEYES_MK _BV(PD1) /* inverted eyes motor (backward) */ -#define MOT_IEYES_PT PORTD -#define MOT_IEYES_DDR DDRD -#define MOT_EYES_MK _BV(PD0) /* eyes motor (forward) */ -#define MOT_EYES_PT PORTD -#define MOT_EYES_DDR DDRD -#define MOT_SPIN_R_MK _BV(PB2) /* spin motor, turn on the right */ -#define MOT_SPIN_R_PT PORTB -#define MOT_SPIN_R_DDR DDRB -#define MOT_SPIN_L_MK _BV(PB1) /* spin motor, turn on the left */ -#define MOT_SPIN_L_PT PORTB -#define MOT_SPIN_L_DDR DDRB -#define MOT_SPIN_MK (MOT_SPIN_L_MK | MOT_SPIN_R_MK) -#define MOT_SPIN_DDR DDRB -#define MOT_SPIN_PT PORTB -#define spinPwmMask pwmMaskB - /* Control */ #define EYES_OPEN_DLY 4 /* 4ms unit */ #define EYES_ICLOSE_DLY 4 /* 4ms unit */ @@ -172,6 +38,8 @@ #define SPIN_STOP_DLY 10 /* 4ms unit */ #define WINGS_STOP_DLY 4 /* 4ms unit */ +#define wingsPwmMask pwmMaskB +#define spinPwmMask pwmMaskB /* * -------------------------------------------------------- * STATUS @@ -379,4 +247,5 @@ #define sigout_unset turnLeftLedOff #define sigin_ini() {LED_PT &= ~LED_R_MK; LED_DDR &= ~LED_R_MK;} /* used as signal input */ #define sigin (LED_PIN & LED_R_MK) /* wait for tester to be as pull up */ -#endif + +#endif /* _GLOBAL_H_ */ Added: firmware/tuxcore/trunk/hardware.h =================================================================== --- firmware/tuxcore/trunk/hardware.h (rev 0) +++ firmware/tuxcore/trunk/hardware.h 2007-09-06 15:25:15 UTC (rev 495) @@ -0,0 +1,262 @@ +/* + * TUXCORE - Firmware for the 'core' CPU of tuxdroid + * Copyright (C) 2007 C2ME S.A. <tux...@c2...> + * + * 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$ */ + +/** \file hardware.h + \brief Hardware configuration of the I/O pins +*/ + +#ifndef _HARDWARE_H_ +#define _HARDWARE_H_ + +#include <avr/io.h> + +/** \defgroup hardware Hardware configuration + * + * Description of all the hardware connected to the I/O of the CPU. + */ + +/** \ingroup hardware */ +/*! @{ */ + +/** + * \name Head button + * The head button switch shortcuts to ground when pressed. + * @{ */ +/** Head button PIN (input port). */ +#define SW_HD_PIN PINB +/** Head button PORT. */ +#define SW_HD_PT PORTB +/** Head button DDR. */ +#define SW_HD_DDR DDRB +/** Head button mask.*/ +#define SW_HD_MK _BV(PB5) +/*! @} */ + +/** + * \name Position switches + * All position switches shortcuts to ground when pressed. + * + * - The spin switch is presed approximately each quarter of turn. + * - The flipper switch is pressed when the flippers are up or down. There's + * only one switch for both positions so it's tricky to know the absolute + * position of the flippers. + * - The eyes and mouth both have 2 switches to detect when they are open or + * closed. The corresponding switch is pressed when a plain position is + * reached. In between, both switches are released. + * @{ */ +/** Spin switch mask. */ +#define PSW_SPIN_MK _BV(PD3) +/** Spin switch PIN. */ +#define PSW_SPIN_PIN PIND +/** Spin switch PORT. */ +#define PSW_SPIN_PT PORTD +/** Spin switch DDR. */ +#define PSW_SPIN_DDR DDRD +/** Flippers position switch PIN. */ +#define PSW_WINGS_PIN PINC +/** Flippers position switch PORT. */ +#define PSW_WINGS_PT PORTC +/** Flippers position switch DDR. */ +#define PSW_WINGS_DDR DDRC +/** Flippers position switch mask. */ +#define PSW_WINGS_MK _BV(PC1) +/** Mouth position switches PIN. */ +#define PSW_MOUTH_PIN PINB +/** Mouth position switches PORT. */ +#define PSW_MOUTH_PT PORTB +/** Mouth position switches DDR. */ +#define PSW_MOUTH_DDR DDRB +/** Mouth open position switch mask. */ +#define PSW_MOUTH_O_MK _BV(PB3) +/** Mouth closed position switch mask. */ +#define PSW_MOUTH_C_MK _BV(PB4) +/** Mouth position switches mask. */ +#define PSW_MOUTH_MK (PSW_MOUTH_O_MK | PSW_MOUTH_C_MK) +/** Eyes position switches PIN. */ +#define PSW_EYES_PIN PIND +/** Eyes position switches PORT. */ +#define PSW_EYES_PT PORTD +/** Eyes position switches DDR. */ +#define PSW_EYES_DDR DDRD +/** Eyes open position switch mask. */ +#define PSW_EYES_O_MK _BV(PD6) +/** Eyes closed position switch mask. */ +#define PSW_EYES_C_MK _BV(PD7) +/** Eyes position switches mask. */ +#define PSW_EYES_MK (PSW_EYES_O_MK | PSW_EYES_C_MK) +/*! @} */ + +/** + * \name IR + * - The IR led is controlled through a power driver. Setting the output pin + * will turn the led on. + * - The IR receiver is directly connected to the input pin. The signal is + * normally high and goes low when an IR signal is received. + * @{ */ +/** IR led PORT. */ +#define IR_LED_PT PORTD +/** IR led DDR. */ +#define IR_LED_DDR DDRD +/** IR led mask. */ +#define IR_LED_MK _BV(PD5) +/** IR receiver PIN. */ +#define IR_REC_PIN PIND +/** IR receiver PORT. */ +#define IR_REC_PT PORTD +/** IR receiver DDR. */ +#define IR_REC_DDR DDRD +/** IR receiver mask. */ +#define IR_REC_MK _BV(PD2) +/*! @} */ + +/** + * \name Phototransistor + * The Phototransistor is connected as an LDR to a 1MOhms resistor. A second + * pull-up of 10kOhms can be added in parallel to change the load. The extra + * pull-up is disconnected when the pin is left in high-Z mode, and is added + * when the pin is set as strong high. + * @{ */ +/** Phototransistor extra pull-up PORT. */ +#define LIGHT_PU_PORT PORTC +/** Phototransistor extra pull-up DDR. */ +#define LIGHT_PU_DDR DDRC +/** Phototransistor extra pull-up mask. */ +#define LIGHT_PU_MK _BV(PC0) +/*! @} */ + +/** + * \name Charger inhibit + * This pin inhibits the charge when set high. It shouldn't be left in high-z + * otherwise the charge won't be stable. Keep it low. + * @{ */ +/* + * Charger + */ +/** Charger inhibit PORT. */ +#define CHARGER_INH_PT PORTB +/** Charger inhibit DDR. */ +#define CHARGER_INH_DDR DDRB +/** Charger inhibit mask. */ +#define CHARGER_INH_MK _BV(PB6) +/*! @} */ + +/** + * \name LED + * The leds are directly connected to the output pins through a 100 Ohms + * resistor. + * @{ */ +/** Blue eyes leds PIN. */ +#define LED_PIN PINC +/** Blue eyes leds PORT. */ +#define LED_PT PORTC +/** Blue eyes leds DDR. */ +#define LED_DDR DDRC +/** Blue eyes right led mask. */ +#define LED_L_MK _BV(PC2) +/** Blue eyes left led mask. */ +#define LED_R_MK _BV(PC3) +/** Blue eyes both leds mask. */ +#define LED_MK (LED_R_MK | LED_L_MK) +/*! @} */ + +/** + * \name External I/O + * The external I/O is routed to the external connector which is accessible in + * the battery compartment of tux. There's a 330 Ohms resistor in series to + * protect the IC. + * @{ */ +/** External I/O PIN. */ +#define EXIO_PIN PINB +/** External I/O PORT. */ +#define EXIO_PT PORTB +/** External I/O DDR. */ +#define EXIO_DDR DDRB +/** External I/O mask. */ +#define EXIO_MK _BV(PB7) +/*! @} */ + +/** + * \name Motors + * The motor drivers use 2 pins to move forward or backward. Setting the first + * pin to high will move forward, setting the other will turn backward. You + * can't set both simultaneously as that doesn't make sense and is dangerous + * for the motor driver. Here we added a protection so that even in this case, + * the motor driver won't burn and the motor will simply turn in one direction. + * @{ */ +/** Flippers backward motor PORT. */ +#define MOT_WINGS_BW_PT PORTD +/** Flippers backward motor DDR. */ +#define MOT_WINGS_BW_DDR DDRD +/** Flippers backward motor mask. */ +#define MOT_WINGS_BW_MK _BV(PD4) +/** Flippers forward motor PORT. */ +#define MOT_WINGS_FW_PT PORTB +/** Flippers forward motor DDR. */ +#define MOT_WINGS_FW_DDR DDRB +/** Flippers forward motor mask. */ +#define MOT_WINGS_FW_MK _BV(PB0) +/** Mouth motor PORT. */ +#define MOT_MOUTH_PT PORTD +/** Mouth motor DDR. */ +#define MOT_MOUTH_DDR DDRD +/** Mouth motor mask. */ +#define MOT_MOUTH_MK _BV(PD1) +/** Mouth inverted motor PORT. */ +#define MOT_IMOUTH_PT PORTD +/** Mouth inverted motor DDR. */ +#define MOT_IMOUTH_DDR DDRD +/** Mouth inverted motor mask. */ +#define MOT_IMOUTH_MK _BV(PD0) +/** Eyes motor PORT. */ +#define MOT_IEYES_PT PORTD +/** Eyes motor DDR. */ +#define MOT_IEYES_DDR DDRD +/** Eyes motor mask. */ +#define MOT_IEYES_MK _BV(PD1) /* inverted eyes motor (backward) */ +/** Eyes inverted motor PORT. */ +#define MOT_EYES_PT PORTD +/** Eyes inverted motor DDR. */ +#define MOT_EYES_DDR DDRD +/** Eyes inverted motor mask. */ +#define MOT_EYES_MK _BV(PD0) /* eyes motor (forward) */ +/** Spinning right motor PORT. */ +#define MOT_SPIN_R_PT PORTB +/** Spinning right motor DDR. */ +#define MOT_SPIN_R_DDR DDRB +/** Spinning right motor mask. */ +#define MOT_SPIN_R_MK _BV(PB2) /* spin motor, turn on the right */ +/** Spinning left motor PORT. */ +#define MOT_SPIN_L_PT PORTB +/** Spinning left motor DDR. */ +#define MOT_SPIN_L_DDR DDRB +/** Spinning left motor mask. */ +#define MOT_SPIN_L_MK _BV(PB1) /* spin motor, turn on the left */ +/** Spinning motor PORT. */ +#define MOT_SPIN_PT PORTB +/** Spinning motor DDR. */ +#define MOT_SPIN_DDR DDRB +/** Spinning motor mask. */ +#define MOT_SPIN_MK (MOT_SPIN_L_MK | MOT_SPIN_R_MK) +/*! @} */ + +/*! @} */ + +#endif /* _HARDWARE_H_ */ Property changes on: firmware/tuxcore/trunk/hardware.h ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Name: svn:eol-style + native Modified: firmware/tuxcore/trunk/ir.c =================================================================== --- firmware/tuxcore/trunk/ir.c 2007-09-06 15:23:54 UTC (rev 494) +++ firmware/tuxcore/trunk/ir.c 2007-09-06 15:25:15 UTC (rev 495) @@ -23,6 +23,7 @@ #include <avr/io.h> #include "global.h" +#include "hardware.h" #include "ir.h" // #define __debug__ Modified: firmware/tuxcore/trunk/led.c =================================================================== --- firmware/tuxcore/trunk/led.c 2007-09-06 15:23:54 UTC (rev 494) +++ firmware/tuxcore/trunk/led.c 2007-09-06 15:25:15 UTC (rev 495) @@ -20,6 +20,7 @@ /* $Id$ */ #include "global.h" +#include "hardware.h" #include "led.h" uint8_t led_delay, led_blinking_pw, led_blinking_cnt; /* led blinking registers */ Modified: firmware/tuxcore/trunk/motors.h =================================================================== --- firmware/tuxcore/trunk/motors.h 2007-09-06 15:23:54 UTC (rev 494) +++ firmware/tuxcore/trunk/motors.h 2007-09-06 15:25:15 UTC (rev 495) @@ -55,9 +55,11 @@ /** \file motors.c \ingroup movements */ -#ifndef MOTORS_H -#define MOTORS_H +#ifndef _MOTORS_H_ +#define _MOTORS_H_ +#include "hardware.h" + #define WINGS_TIM_RESET 0Xff #define WINGS_TIM_DIFF 0x10 enum mouth_pos_s @@ -72,9 +74,6 @@ extern uint8_t mouthStpCnt, mouthPosCnt, mouth_pos; extern uint8_t spinPosCnt, spinStpCnt, spinPwm; -/* switches interrupts vector for timer debounce */ -extern volatile uint8_t int_sw_flags; - /* pwm mask registers */ extern uint8_t pwmMaskB; @@ -222,7 +221,6 @@ #define PWM_PERIOD 5 uint8_t static pwm_tim; - static inline void motor_control(void) __attribute__ ((always_inline)); void motor_control(void) { @@ -296,4 +294,4 @@ } } } -#endif +#endif /* _MOTORS_H_ */ Modified: firmware/tuxcore/trunk/sensors.c =================================================================== --- firmware/tuxcore/trunk/sensors.c 2007-09-06 15:23:54 UTC (rev 494) +++ firmware/tuxcore/trunk/sensors.c 2007-09-06 15:25:15 UTC (rev 495) @@ -23,6 +23,7 @@ #include <avr/io.h> #include "global.h" +#include "hardware.h" /* * ADC conversion complete. |
From: Paul_R <c2m...@c2...> - 2007-09-06 14:45:11
|
Author: Paul_R Date: 2007-09-06 16:45:08 +0200 (Thu, 06 Sep 2007) New Revision: 493 Modified: firmware/tuxaudio/branches/audio_cleanup/flash.c firmware/tuxaudio/branches/audio_cleanup/flash.h firmware/tuxaudio/branches/audio_cleanup/main.c Log: * Reorganize the functions of flash.c. Some have been declared 'static' to hide them of other modules. * Added doxygen comments * Moved the programmingSound state machine in flash.c Modified: firmware/tuxaudio/branches/audio_cleanup/flash.c =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/flash.c 2007-09-06 12:54:06 UTC (rev 492) +++ firmware/tuxaudio/branches/audio_cleanup/flash.c 2007-09-06 14:45:08 UTC (rev 493) @@ -17,191 +17,381 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: */ +/* $Id: $ */ #include <avr/io.h> #include "varis.h" #include "spi.h" #include "i2c.h" #include "flash.h" +/* Declarations */ +/* Theses functions are declared with the static attribute, so they're + * accessible only by this module */ -unsigned char read_status(void); -void write_enable(void); -void write_disable(void); -void write_status(unsigned char status); -void erase_flash(void); -unsigned char read_data(unsigned char ad2, unsigned char ad1, - unsigned char ad0); -//void programmingAudio(void); -void unprotect_sector(unsigned char ad2, unsigned char ad1, unsigned char ad0); -void playingAudio(unsigned char nsound); -void stopPlayingAudio(void); +static void programmingNumSound(void); +static void programmingToc(void); +static void initSoundProgramming(void); +static void soundProgramming(void); +static void endProgramming(void); +static uint8_t read_status(void); +static void write_enable(void); +static void write_disable(void); +static void write_status(uint8_t const status); +static void erase_flash(void); +static void unprotect_sector(uint8_t const ad2, uint8_t const ad1, + uint8_t const ad0); +static void program_flash(uint8_t const ad2, uint8_t const ad1, uint8_t const ad0, + uint8_t const data); + +uint8_t f_state = 0; uint8_t flash_state; -unsigned char read_status(void) +/* Public functions */ + +/** + * \ingroup flash + \brief This function is used to reprogram sound flash memory.. + + This function is structured like a state machine. The six states are : + - ERASE_STATE which perform a full chip erase. This state turn off the PWM + and disable I2C interrupt. + - FIRST_PROG_STATE write the number of sounds to be stored. + - PROG_TOC_STATE write the sound's indexes each time a INDEX COMMAND is + received. The last indexes are stored. + - INIT_SOUND_PROG_STATE initiate the memory to a sequential programming. The + first sound byte is writed in the flash. + - SOUND_PROG_STATE store all the sound data received. + - END_STATE clear all variable used to control the programming task, and + reswitch-on the I2C and the PWM timer. + + Because I2C is disabled during this task, all command will be ignored. + */ + +void flashProgramming(void) +{ + SPCR = 0x00; + SPCR = 0X50; + PORTB |= 0x01; + if (f_state == ERASE_STATE) + { + if (read_status() == 0x10) + f_state ++; + } + else if (f_state == FIRST_PROG_STATE) + { + programmingNumSound(); + f_state ++; + } + else if (f_state == PROG_TOC_STATE) + { + if (TOCRX) + programmingToc(); + if (flash_state) + f_state ++; + } + else if (f_state == INIT_SOUND_PROG_STATE) + { + initSoundProgramming(); + if (flash_state) + f_state ++; + } + if (f_state == SOUND_PROG_STATE) + { + soundProgramming(); + + if (flash_state) + f_state ++; + } + else if (f_state == END_STATE) + { + endProgramming(); + f_state = 0; + } +} + +/** + * \ingroup flash + * \brief Erase the flash memory. + * This funtion perform a full erase of the flash memory and initiate the sound + * flash programming. + * This functions is called by the command_Parser function when a programming + * flash command is received. + */ + + +uint8_t ad0, ad1, ad2, i, j; +void erasingFlash(void) { - unsigned char status; + TCCR0A = 0x00; // Desactivate PWM + TCCR0B = 0x00; + OCR0A = 0x00; + TIMSK0 = 0x00; - FLASH_CS_ON; /* Chip Select */ + f_state = 0; + TWCR = (TWCR & TWCR_CMD_MASK) & ~_BV(TWIE); // Desactivate I2C - spiSend(READ_STATUS_REG); /* Send Read Status Command */ + resetFifo(&PWMFifo); /* Reinitialise the PWM fifo */ + programmingFlash = 1; // Set the flag to suspend the task + erase_flash(); // Erase the flash +} +/** + * \ingroup flash + \param ad2 high address part + \param ad1 medium adress part + \param ad0 lower adress part + \return The byte read in the sound flash memory - status = spiSend(NOP); /* Read status on spi */ + \brief This function read a byte in the sound flash memory. + */ +uint8_t read_data(uint8_t const ad2, uint8_t const ad1, uint8_t const ad0) +{ + uint8_t data1; - FLASH_CS_OFF; /* Chip Deselect */ + FLASH_CS_ON; // Chip Select + spiSend(READ_ARRAY_LOW_F); // Send Read Page Command + spiSend(ad2); // Send Address + spiSend(ad1); + spiSend(ad0); + data1 = spiSend(NOP); // Wait response + FLASH_CS_OFF; // Chip Deselect - return status; + return data1; } -void write_enable(void) +void playingAudio(uint8_t nsound) { - FLASH_CS_ON; /* Chip Select */ + uint8_t count, i; + uint8_t adp1, adp0, sounds_stored; // Address pointer varaible - spiSend(WRITE_EN); /* Send Write Enable Command */ + sounds_stored = read_data(0x00, 0x00, 0x00); + if (sounds_stored == 0xFF) /* if unprogrammed we have 0xFF stored in flash */ + return; + if (!nsound || (nsound > sounds_stored)) /* check the limits */ + return; - FLASH_CS_OFF; /* Chip Deselect */ + count = 1; + adp1 = 0x00; + adp0 = 0x01; + while (count != nsound) // Compute address + { + for (i = 0; i < 3; i++) + { + adp0++; + if (adp0 == 0) + adp1++; + } + count++; + } + PORTB &= ~0x02; // Chip Select + + spiSend(0x03); // Send Read Page Command + spiSend(0x00); // Send Address + spiSend(adp1); + spiSend(adp0); + + for (i = 0; i < 6; i++) + { + ad[i] = spiSend(0x00); // Read start and stop sound address + } + + PORTB |= 0x02; // Chip Deselect + + /* Check adresses */ + if (ad[0] > 0x07) + return; /* don't read outside the flash */ + if (ad[3] > 0x07) + return; /* don't read outside the flash */ + if ((ad[0] == 0) && (ad[1] < 0x04)) + return; /* minimum index not respected */ + if ((ad[4] == 0) && (ad[5] < 0x04)) + return; /* minimum index not respected */ + if (ad[3] < ad[0]) + return; /* check that the stop index is greater than the start index */ + else if (ad[3] == ad[0]) + { + if (ad[4] < ad[1]) + return; + else if (ad[4] == ad[1]) + if (ad[5] <= ad[2]) + return; + } + + PORTB &= ~0x02; // Chip Select + + spiSend(0x03); // Send Read Page Command + spiSend(ad[0]); // Send Address + spiSend(ad[1]); + spiSend(ad[2]); + PORTB &= ~0x01; // Reset the HOLD signal + + OCR0A = 250; // Normal operation for PWM if fifo adaptative is on + flashPlay = 1; // Read of sound } -void write_disable(void) + +void stopPlayingAudio(void) { - FLASH_CS_ON; /* Chip Select */ + flashPlay = 0; + PORTB |= 0x01; // Set the HOLD signal + PORTB |= 0x02; // Chip Deselect +} - spiSend(WRITE_DIS); /* Send Write Disable Command */ - FLASH_CS_OFF; /* Chip Deselect */ +/* Static functions - They can be accessed only by this module */ + +/** + * \ingroup flash + + \brief This function read the flash memory status. + */ + +static uint8_t read_status(void) +{ + uint8_t status; + + FLASH_CS_ON; /* Chip Select */ + spiSend(READ_STATUS_REG); /* Send Read Status Command */ + status = spiSend(NOP); /* Read status on spi */ + FLASH_CS_OFF; /* Chip Deselect */ + return status; } +/** + * \ingroup flash -void write_status(unsigned char status) + \brief This function set the write enable flag of the flash memory. + */ + +static void write_enable(void) { - FLASH_CS_ON; /* Chip Select */ + FLASH_CS_ON; /* Chip Select */ + spiSend(WRITE_EN); /* Send Write Enable Command */ + FLASH_CS_OFF; /* Chip Deselect */ +} +/** + * \ingroup flash + + \brief This function clear the write enable flag of the flash memory. + */ + +static void write_disable(void) +{ + FLASH_CS_ON; /* Chip Select */ + spiSend(WRITE_DIS); /* Send Write Disable Command */ + FLASH_CS_OFF; /* Chip Deselect */ +} + +/** + * \ingroup flash + + \brief This function write into the flash memory status register. + */ + +static void write_status(uint8_t const status) +{ + FLASH_CS_ON; /* Chip Select */ spiSend(WRITE_STATUS_REG); /* Send Write Status Command */ spiSend(status); /* Send status */ + FLASH_CS_OFF; /* Chip Deselect */ - FLASH_CS_OFF; /* Chip Deselect */ - } +/** + * \ingroup flash + \param ad2 high address part + \param ad1 medium adress part + \param ad0 lower adress part -void unprotect_sector(unsigned char ad2, unsigned char ad1, unsigned char ad0) + \brief This function unprotect a sector. + */ +static void unprotect_sector(uint8_t const ad2, uint8_t const ad1, uint8_t const ad0) { - FLASH_CS_ON; // Chip Select - + FLASH_CS_ON; // Chip Select spiSend(UNPROTECT_SECTOR); // Send unprotect sector command spiSend(ad2); // Send Address spiSend(ad1); spiSend(ad0); + FLASH_CS_OFF; // Chip Deselect - FLASH_CS_OFF; // Chip Deselect - } +/** + * \ingroup flash -void erase_flash(void) + \brief This function erase the entire memory. + */ + +static void erase_flash(void) { write_status(0x00); // Disable sector protection register write_enable(); // Enable the writing - unprotect_sector(SECTOR0); // Unprotected sector 0 + unprotect_sector(SECTOR0); write_enable(); // Enable the writing - unprotect_sector(SECTOR1); // Unprotected sector 1 + unprotect_sector(SECTOR1); write_enable(); // Enable the writing - unprotect_sector(SECTOR2); // Unprotected sector 2 + unprotect_sector(SECTOR2); write_enable(); // Enable the writing - unprotect_sector(SECTOR3); // Unprotected sector 3 + unprotect_sector(SECTOR3); write_enable(); // Enable the writing - unprotect_sector(SECTOR4); // Unprotected sector 4 + unprotect_sector(SECTOR4); write_enable(); // Enable the writing - unprotect_sector(SECTOR5); // Unprotected sector 5 + unprotect_sector(SECTOR5); write_enable(); // Enable the writing - unprotect_sector(SECTOR6); // Unprotected sector 6 + unprotect_sector(SECTOR6); write_enable(); // Enable the writing - unprotect_sector(SECTOR7); // Unprotected sector 7 + unprotect_sector(SECTOR7); write_enable(); // Enable the writing - unprotect_sector(SECTOR8); // Unprotected sector 8 + unprotect_sector(SECTOR8); write_enable(); // Enable the writing - unprotect_sector(SECTOR9); // Unprotected sector 9 + unprotect_sector(SECTOR9); write_enable(); // Enable the writing - unprotect_sector(SECTOR10); // Unprotected sector 10 + unprotect_sector(SECTOR10); write_enable(); // Enable the writing - FLASH_CS_ON; // Chip Select + FLASH_CS_ON; // Chip Select + spiSend(CHIP_ERASE); // Send Erase Bulk command + FLASH_CS_OFF; // Chip Deselect +} - spiSend(CHIP_ERASE); // Send Erase Bulk command +/** + * \ingroup flash + \param ad2 high address part + \param ad1 medium adress part + \param ad0 lower adress part - FLASH_CS_OFF; // Chip Deselect -} + \brief This function write a byte in the flash memory. + */ -void program_flash(unsigned char ad2, unsigned char ad1, unsigned char ad0, - unsigned char data) +static void program_flash(uint8_t const ad2, uint8_t const ad1, uint8_t const ad0, + uint8_t const data) { write_enable(); - FLASH_CS_ON; // Chip Select - - spiSend(BYTE_PROGRAM); // Send Page Byte Command - spiSend(ad2); // Send Address + spiSend(BYTE_PROGRAM); // Send Page Byte Command + spiSend(ad2); // Send Address spiSend(ad1); spiSend(ad0); - spiSend(data); // Write data in flash + spiSend(data); // Write data in flash + FLASH_CS_OFF; // Chip Deselect - FLASH_CS_OFF; // Chip Deselect - while (read_status() != 0x10) ; // Wait Page Program Cycle } -unsigned char read_data(unsigned char ad2, unsigned char ad1, unsigned char ad0) -{ - unsigned char data1; - FLASH_CS_ON; // Chip Select - spiSend(READ_ARRAY_LOW_F); // Send Read Page Command - spiSend(ad2); // Send Address - spiSend(ad1); - spiSend(ad0); - data1 = spiSend(NOP); // Wait response - FLASH_CS_OFF; // Chip Deselect - - return data1; -} - /** * \ingroup flash - * \brief Erase the flash memory. - * This funtion perform a full erase of the flash memory. - */ - - -unsigned char ad0, ad1, ad2, i, j; -void erasingFlash(void) -{ - TCCR0A = 0x00; // Desactivate PWM - TCCR0B = 0x00; - OCR0A = 0x00; - TIMSK0 = 0x00; - - TWCR = (TWCR & TWCR_CMD_MASK) & ~_BV(TWIE); // Desactivate I2C - - resetFifo(&PWMFifo); /* Reinitialise the PWM fifo */ - - programmingFlash = 1; // Set the flag to suspend the task - - erase_flash(); // Erase the flash -} -/** - * \ingroup flash * \brief Write the number of sound to be stored. - * This function store the first TOC byte (numSound), received with the flash - * program command, at the first memory adress. + This function store the first TOC byte (numSound), received with the flash + program command, at the first memory adress. */ -void programmingNumSound(void) +static void programmingNumSound(void) { program_flash(0x00, 0x00, 0x00, numSound); // Write first byte of the TOC - ad0 = 0x01; // Init TOC address ad1 = 0x00; ad2 = 0x00; @@ -213,7 +403,7 @@ * This function store the the indexes into the memory. */ -void programmingToc(void) +static void programmingToc(void) { TOCRX = 0; flash_state = 0; @@ -226,27 +416,34 @@ } i++; + /* Store the final adress */ if (i == numSound + 1) { - ad[0] = TOCadress[2]; // Save final addres + ad[0] = TOCadress[2]; ad[1] = TOCadress[1]; ad[2] = TOCadress[0]; - ad2 = 0x00; // Init sound address + /* Init the first sound byte adress */ + ad2 = 0x00; ad1 = 0x04; ad0 = 0x00; flash_state = 1; } } +/** + * \ingroup flash + * \brief Initiate the sound programming. + * This function initiate the sound flash memory for a sequential programming. + */ -void initSoundProgramming (void) +static void initSoundProgramming (void) { flash_state = 0; write_enable(); - FLASH_CS_ON; // Chip Select - spiSend(SEQU_PROGRAM); // Send Sequencial Program Command - spiSend(ad2); // Send Address + FLASH_CS_ON; + spiSend(SEQU_PROGRAM); + spiSend(ad2); spiSend(ad1); spiSend(ad0); @@ -262,21 +459,25 @@ else flash_state = 0; } - FLASH_CS_OFF; // Chip Deselect + FLASH_CS_OFF; // Chip Deselect } -void soundProgramming(void) +/** + * \ingroup flash + * \brief Program the sound in the flash memory. + * This function store the sound in the flash memory. + */ +static void soundProgramming(void) { flash_state = 0; - // Fourth step WRITE SOUND while (!spi_start) { if (!isFifoEmpty(&PWMFifo)) // Fifo not empty { - FLASH_CS_ON;// PORTB &= ~0x02; // Chip Select + FLASH_CS_ON; // Chip Select spiSend(SEQU_PROGRAM); // Send Sequencial Program Command spiSend(pullFifo(&PWMFifo)); // Write data in flash - FLASH_CS_OFF;// PORTB |= 0x02; // Chip DeselecT + FLASH_CS_OFF; // Chip DeselecT ad0++; // Increment address byte if (ad0 == 0x00) { @@ -302,7 +503,12 @@ } } -void endProgramming (void) +/** + * \ingroup flash + * \brief This function end the flash programming task. + */ + +static void endProgramming (void) { write_disable(); // Disable wrtie flash flash_state = 0; @@ -316,80 +522,4 @@ programmingFlash = 0; // Reset the flag to suspend the task } -void playingAudio(unsigned char nsound) -{ - unsigned char count, i; - unsigned char adp1, adp0, sounds_stored; // Address pointer varaible - sounds_stored = read_data(0x00, 0x00, 0x00); - if (sounds_stored == 0xFF) /* if unprogrammed we have 0xFF stored in flash */ - return; - if (!nsound || (nsound > sounds_stored)) /* check the limits */ - return; - - count = 1; - adp1 = 0x00; - adp0 = 0x01; - while (count != nsound) // Compute address - { - for (i = 0; i < 3; i++) - { - adp0++; - if (adp0 == 0) - adp1++; - } - count++; - } - - PORTB &= ~0x02; // Chip Select - - spiSend(0x03); // Send Read Page Command - spiSend(0x00); // Send Address - spiSend(adp1); - spiSend(adp0); - - for (i = 0; i < 6; i++) - { - ad[i] = spiSend(0x00); // Read start and stop sound address - } - - PORTB |= 0x02; // Chip Deselect - - /* Check adresses */ - if (ad[0] > 0x07) - return; /* don't read outside the flash */ - if (ad[3] > 0x07) - return; /* don't read outside the flash */ - if ((ad[0] == 0) && (ad[1] < 0x04)) - return; /* minimum index not respected */ - if ((ad[4] == 0) && (ad[5] < 0x04)) - return; /* minimum index not respected */ - if (ad[3] < ad[0]) - return; /* check that the stop index is greater than the start index */ - else if (ad[3] == ad[0]) - { - if (ad[4] < ad[1]) - return; - else if (ad[4] == ad[1]) - if (ad[5] <= ad[2]) - return; - } - - PORTB &= ~0x02; // Chip Select - - spiSend(0x03); // Send Read Page Command - spiSend(ad[0]); // Send Address - spiSend(ad[1]); - spiSend(ad[2]); - PORTB &= ~0x01; // Reset the HOLD signal - - OCR0A = 250; // Normal operation for PWM if fifo adaptative is on - flashPlay = 1; // Read of sound -} - -void stopPlayingAudio(void) -{ - flashPlay = 0; - PORTB |= 0x01; // Set the HOLD signal - PORTB |= 0x02; // Chip Deselect -} Modified: firmware/tuxaudio/branches/audio_cleanup/flash.h =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/flash.h 2007-09-06 12:54:06 UTC (rev 492) +++ firmware/tuxaudio/branches/audio_cleanup/flash.h 2007-09-06 14:45:08 UTC (rev 493) @@ -76,24 +76,23 @@ #define SECTOR9 0x07, 0xA0, 0X00 #define SECTOR10 0x07, 0xC0, 0X00 -extern unsigned char read_status(void); -extern void write_enable(void); -extern void write_disable(void); -extern void write_status(unsigned char status); -extern void erase_flash(void); -extern unsigned char read_data(unsigned char ad2, unsigned char ad1, - unsigned char ad0); -extern void unprotect_sector(unsigned char ad2, unsigned char ad1, - unsigned char ad0); +/* Flash programming states */ +#define ERASE_STATE 0 +#define FIRST_PROG_STATE 1 +#define PROG_TOC_STATE 2 +#define INIT_SOUND_PROG_STATE 3 +#define SOUND_PROG_STATE 4 +#define END_STATE 5 + extern void playingAudio(unsigned char nsound); extern void stopPlayingAudio(void); + +extern void flashProgramming(void); extern void erasingFlash(void); -extern void programmingNumSound(void); -extern void programmingToc(void); -extern void initSoundProgramming(void); -extern void soundProgramming(void); -extern void endProgramming(void); +extern uint8_t read_data(uint8_t const ad2, uint8_t const ad1, + uint8_t const ad0); extern uint8_t flash_state; +extern uint8_t f_state; #endif Modified: firmware/tuxaudio/branches/audio_cleanup/main.c =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/main.c 2007-09-06 12:54:06 UTC (rev 492) +++ firmware/tuxaudio/branches/audio_cleanup/main.c 2007-09-06 14:45:08 UTC (rev 493) @@ -39,7 +39,6 @@ * Version number */ -uint8_t f_state = 0; #define CPU_NUMBER TUXAUDIO_CPU_NUM /* audio CPU */ const author_t author __attribute__ ((section("version.3"))) = { @@ -123,7 +122,6 @@ */ #define DBG_STACK 1 -//void SIG_INTERRUPT0(void) __attribute__ ((signal, naked)); #if (DBG_STACK) /* @@ -196,7 +194,6 @@ { /* param: command[1] : number of sounds */ numSound = command[1]; - f_state = 0; erasingFlash(); } else if (command[0] == STORE_INDEX_CMD) @@ -240,12 +237,6 @@ command[3] = battery_level; pushCommands(command); /* push the command set on the filo stack */ } -#define ERASE_STATE 0 -#define FIRST_PROG_STATE 1 -#define PROG_TOC_STATE 2 -#define INIT_SOUND_PROG_STATE 3 -#define SOUND_PROG_STATE 4 -#define END_STATE 5 int main(void) { @@ -301,47 +292,11 @@ if (programmingFlash) // Restora all the context for flash programming { - SPCR = 0x00; - SPCR = 0X50; - PORTB |= 0x01; - if (f_state == ERASE_STATE) - { - if (read_status() == 0x10) - f_state ++; - } - else if (f_state == FIRST_PROG_STATE) - { - programmingNumSound(); - f_state ++; - } - else if (f_state == PROG_TOC_STATE) - { - if (TOCRX) - programmingToc(); - if (flash_state) - f_state ++; - } - else if (f_state == INIT_SOUND_PROG_STATE) - { - initSoundProgramming(); - if (flash_state) - f_state ++; - } - if (f_state == SOUND_PROG_STATE) - { - soundProgramming(); + flashProgramming(); - if (flash_state) - f_state ++; - } - else if (f_state == END_STATE) - { - endProgramming(); - f_state = 0; - } } - else - { + // else + // { if (flashPlay) { cli(); @@ -419,7 +374,7 @@ /* Sleep mode */ if (pre_sleep_delay == 1) sleep(); - } + // } } } |
From: jaguarondi <c2m...@c2...> - 2007-09-06 12:54:11
|
Author: jaguarondi Date: 2007-09-06 14:54:06 +0200 (Thu, 06 Sep 2007) New Revision: 492 Modified: firmware/tuxcore/trunk/AUTHORS firmware/tuxcore/trunk/CHANGES firmware/tuxcore/trunk/README firmware/tuxcore/trunk/TODO Log: * Updated AUTHORS, CHANGES, README, TODO. Modified: firmware/tuxcore/trunk/AUTHORS =================================================================== --- firmware/tuxcore/trunk/AUTHORS 2007-09-06 12:48:22 UTC (rev 491) +++ firmware/tuxcore/trunk/AUTHORS 2007-09-06 12:54:06 UTC (rev 492) @@ -5,3 +5,6 @@ David Bourgeois <da...@ja...> Contributors: + + Philippe Teuwen <ph...@te...> + Paul Rathgeb <pau...@c2...> Modified: firmware/tuxcore/trunk/CHANGES =================================================================== --- firmware/tuxcore/trunk/CHANGES 2007-09-06 12:48:22 UTC (rev 491) +++ firmware/tuxcore/trunk/CHANGES 2007-09-06 12:54:06 UTC (rev 492) @@ -7,8 +7,36 @@ ---------------------------------------------------------------------- Current: - * . + * Added doxygen configuration file. + * Cleanup and commenting. + + * Fixed #6 nd #9 about the leds that were not updated when the eyes were + closed. + + * Fixed #7 about the eyes commands. + + * Fixed #8 about the flipper movements. + + * Added the missing commands for the motors: CLOSE_EYES_CMD, RAISE_WINGS_CMD, + LOWER_WINGS_CMD, etc. + + * Added the basis for the sleep functions although they are unfinished and + untested. + + * BUG: when 2 events are happening at the same time, they are conflicting in + the event manager. + + * Added programming directives in the Makefile for tuxup, stk500 and jtagice + mkii. + + * Fixed #1 with the patches given by Philippe Teuwen, this now + fixes the location of the version, revision and author structures with a + linker script in the .version section otherwise gcc is free to change the + order. This also fixes the position of the cpu_nbr and ver_major bits in + the byte as again gcc is free to change that order though this is much less + likely to happen. + Version 0.3.0: * Initial public release. This code is considered stable. Most Modified: firmware/tuxcore/trunk/README =================================================================== --- firmware/tuxcore/trunk/README 2007-09-06 12:48:22 UTC (rev 491) +++ firmware/tuxcore/trunk/README 2007-09-06 12:54:06 UTC (rev 492) @@ -5,7 +5,7 @@ To install and compile this firmware, check this how-to: - http://www.tuxisalive.com/documentation/how-to/setup-the-avr-tool-chain-and-compile-the-firmwares + http://www.tuxisalive.com/documentation/how-to/setup-the-avr-tool-chain-and-compile-the-firmware For all information about tuxdroid, please visit: Modified: firmware/tuxcore/trunk/TODO =================================================================== --- firmware/tuxcore/trunk/TODO 2007-09-06 12:48:22 UTC (rev 491) +++ firmware/tuxcore/trunk/TODO 2007-09-06 12:54:06 UTC (rev 492) @@ -1,7 +1,5 @@ $Id$ -- Add documentation with Doxygen. - - Add functions to change configuration registers from the computer and store them in the eeprom. @@ -9,6 +7,4 @@ - Fix the greeting events when 2 tux see each other. -- Add dleep mode. - -- Remove production testing code not necessary anymore. +- Add sleep mode. |
From: Paul_R <c2m...@c2...> - 2007-09-06 12:48:23
|
Author: Paul_R Date: 2007-09-06 14:48:22 +0200 (Thu, 06 Sep 2007) New Revision: 491 Modified: firmware/tuxaudio/branches/audio_cleanup/flash.c firmware/tuxaudio/branches/audio_cleanup/flash.h Log: * Added flash memory defines. Modified: firmware/tuxaudio/branches/audio_cleanup/flash.c =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/flash.c 2007-09-06 12:07:50 UTC (rev 490) +++ firmware/tuxaudio/branches/audio_cleanup/flash.c 2007-09-06 12:48:22 UTC (rev 491) @@ -23,6 +23,7 @@ #include "varis.h" #include "spi.h" #include "i2c.h" +#include "flash.h" unsigned char read_status(void); void write_enable(void); @@ -42,57 +43,57 @@ { unsigned char status; - PORTB &= ~0x02; /* Chip Select */ + FLASH_CS_ON; /* Chip Select */ - spiSend(0x05); /* Send Read Status Command */ + spiSend(READ_STATUS_REG); /* Send Read Status Command */ - status = spiSend(0x00); /* Read status on spi */ + status = spiSend(NOP); /* Read status on spi */ - PORTB |= 0x02; /* Chip Deselect */ + FLASH_CS_OFF; /* Chip Deselect */ return status; } void write_enable(void) { - PORTB &= ~0x02; /* Chip Select */ + FLASH_CS_ON; /* Chip Select */ - spiSend(0x06); /* Send Write Enable Command */ + spiSend(WRITE_EN); /* Send Write Enable Command */ - PORTB |= 0x02; /* Chip Deselect */ + FLASH_CS_OFF; /* Chip Deselect */ } void write_disable(void) { - PORTB &= ~0x02; /* Chip Select */ + FLASH_CS_ON; /* Chip Select */ - spiSend(0x04); /* Send Write Disable Command */ + spiSend(WRITE_DIS); /* Send Write Disable Command */ - PORTB |= 0x02; /* Chip Deselect */ + FLASH_CS_OFF; /* Chip Deselect */ } void write_status(unsigned char status) { - PORTB &= ~0x02; /* Chip Select */ + FLASH_CS_ON; /* Chip Select */ - spiSend(0x01); /* Send Write Status Command */ + spiSend(WRITE_STATUS_REG); /* Send Write Status Command */ spiSend(status); /* Send status */ - PORTB |= 0x02; /* Chip Deselect */ + FLASH_CS_OFF; /* Chip Deselect */ } void unprotect_sector(unsigned char ad2, unsigned char ad1, unsigned char ad0) { - PORTB &= ~0x02; // Chip Select + FLASH_CS_ON; // Chip Select - spiSend(0x39); // Send unprotect sector command + spiSend(UNPROTECT_SECTOR); // Send unprotect sector command spiSend(ad2); // Send Address spiSend(ad1); spiSend(ad0); - PORTB |= 0x02; // Chip Deselect + FLASH_CS_OFF; // Chip Deselect } @@ -100,35 +101,35 @@ { write_status(0x00); // Disable sector protection register write_enable(); // Enable the writing - unprotect_sector(0x00, 0x00, 0x00); // Unprotected sector 0 + unprotect_sector(SECTOR0); // Unprotected sector 0 write_enable(); // Enable the writing - unprotect_sector(0x01, 0x00, 0x00); // Unprotected sector 1 + unprotect_sector(SECTOR1); // Unprotected sector 1 write_enable(); // Enable the writing - unprotect_sector(0x02, 0x00, 0x00); // Unprotected sector 2 + unprotect_sector(SECTOR2); // Unprotected sector 2 write_enable(); // Enable the writing - unprotect_sector(0x03, 0x00, 0x00); // Unprotected sector 3 + unprotect_sector(SECTOR3); // Unprotected sector 3 write_enable(); // Enable the writing - unprotect_sector(0x04, 0x00, 0x00); // Unprotected sector 4 + unprotect_sector(SECTOR4); // Unprotected sector 4 write_enable(); // Enable the writing - unprotect_sector(0x05, 0x00, 0x00); // Unprotected sector 5 + unprotect_sector(SECTOR5); // Unprotected sector 5 write_enable(); // Enable the writing - unprotect_sector(0x06, 0x00, 0x00); // Unprotected sector 6 + unprotect_sector(SECTOR6); // Unprotected sector 6 write_enable(); // Enable the writing - unprotect_sector(0x07, 0x00, 0x00); // Unprotected sector 7 + unprotect_sector(SECTOR7); // Unprotected sector 7 write_enable(); // Enable the writing - unprotect_sector(0x07, 0x80, 0x00); // Unprotected sector 8 + unprotect_sector(SECTOR8); // Unprotected sector 8 write_enable(); // Enable the writing - unprotect_sector(0x07, 0xA0, 0x00); // Unprotected sector 9 + unprotect_sector(SECTOR9); // Unprotected sector 9 write_enable(); // Enable the writing - unprotect_sector(0x07, 0xC0, 0x00); // Unprotected sector 10 + unprotect_sector(SECTOR10); // Unprotected sector 10 write_enable(); // Enable the writing - PORTB &= ~0x02; // Chip Select + FLASH_CS_ON; // Chip Select - spiSend(0xC7); // Send Erase Bulk command + spiSend(CHIP_ERASE); // Send Erase Bulk command - PORTB |= 0x02; // Chip Deselect + FLASH_CS_OFF; // Chip Deselect } void program_flash(unsigned char ad2, unsigned char ad1, unsigned char ad0, @@ -136,15 +137,15 @@ { write_enable(); - PORTB &= ~0x02; // Chip Select + FLASH_CS_ON; // Chip Select - spiSend(0x02); // Send Page Byte Command + spiSend(BYTE_PROGRAM); // Send Page Byte Command spiSend(ad2); // Send Address spiSend(ad1); spiSend(ad0); spiSend(data); // Write data in flash - PORTB |= 0x02; // Chip Deselect + FLASH_CS_OFF; // Chip Deselect while (read_status() != 0x10) ; // Wait Page Program Cycle } @@ -153,15 +154,15 @@ { unsigned char data1; - PORTB &= ~0x02; // Chip Select + FLASH_CS_ON; // Chip Select - spiSend(0x03); // Send Read Page Command + spiSend(READ_ARRAY_LOW_F); // Send Read Page Command spiSend(ad2); // Send Address spiSend(ad1); spiSend(ad0); - data1 = spiSend(0x00); // Wait response + data1 = spiSend(NOP); // Wait response - PORTB |= 0x02; // Chip Deselect + FLASH_CS_OFF; // Chip Deselect return data1; } @@ -243,8 +244,8 @@ { flash_state = 0; write_enable(); - PORTB &= ~0x02; // Chip Select - spiSend(0xAF); // Send Sequencial Program Command + FLASH_CS_ON; // Chip Select + spiSend(SEQU_PROGRAM); // Send Sequencial Program Command spiSend(ad2); // Send Address spiSend(ad1); spiSend(ad0); @@ -261,7 +262,7 @@ else flash_state = 0; } - PORTB |= 0x02; // Chip Deselect + FLASH_CS_OFF; // Chip Deselect } void soundProgramming(void) @@ -272,10 +273,10 @@ { if (!isFifoEmpty(&PWMFifo)) // Fifo not empty { - PORTB &= ~0x02; // Chip Select - spiSend(0xAF); // Send Sequencial Program Command + FLASH_CS_ON;// PORTB &= ~0x02; // Chip Select + spiSend(SEQU_PROGRAM); // Send Sequencial Program Command spiSend(pullFifo(&PWMFifo)); // Write data in flash - PORTB |= 0x02; // Chip DeselecT + FLASH_CS_OFF;// PORTB |= 0x02; // Chip DeselecT ad0++; // Increment address byte if (ad0 == 0x00) { Modified: firmware/tuxaudio/branches/audio_cleanup/flash.h =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/flash.h 2007-09-06 12:07:50 UTC (rev 490) +++ firmware/tuxaudio/branches/audio_cleanup/flash.h 2007-09-06 12:48:22 UTC (rev 491) @@ -31,13 +31,51 @@ /** \file flash.c \ingroup flash */ +#ifndef FLASH_H +#define FLASH_H +/* Flash (AT26F004) OP CODE define */ +#define READ_ARRAY 0x0B +#define READ_ARRAY_LOW_F 0x03 +#define BLOCK_ERASE_4K 0x20 +#define BLOCK_ERASE_32K 0x52 +#define BLOCK_ERASE_64K 0xD8 +#define CHIP_ERASE 0x60 +#define BYTE_PROGRAM 0x02 +#define SEQU_PROGRAM 0xAF -#ifndef FLASH_H -#define FLASH_H +#define WRITE_EN 0x06 +#define WRITE_DIS 0x04 +#define PROTECT_SECTOR 0x36 +#define UNPROTECT_SECTOR 0x39 +#define READ_SECT_PROTECT 0x3C +#define READ_STATUS_REG 0x05 +#define WRITE_STATUS_REG 0x01 + +#define READ_MANUFACT 0x9F +#define DEEP_POWER_MODE 0xB9 +#define RESUME_DEEP_MODE 0xAB + +#define NOP 0x00 + +#define FLASH_CS_ON PORTB &= ~0x02 +#define FLASH_CS_OFF PORTB |= 0x02 + +#define SECTOR0 0x00, 0x00, 0x00 +#define SECTOR1 0x01, 0x00, 0x00 +#define SECTOR2 0x02, 0x00, 0X00 +#define SECTOR3 0x03, 0x00, 0X00 +#define SECTOR4 0x04, 0x00, 0X00 +#define SECTOR5 0x05, 0x00, 0X00 +#define SECTOR6 0x06, 0x00, 0X00 +#define SECTOR7 0x07, 0x00, 0X00 +#define SECTOR8 0x07, 0x80, 0X00 +#define SECTOR9 0x07, 0xA0, 0X00 +#define SECTOR10 0x07, 0xC0, 0X00 + extern unsigned char read_status(void); extern void write_enable(void); extern void write_disable(void); @@ -45,7 +83,6 @@ extern void erase_flash(void); extern unsigned char read_data(unsigned char ad2, unsigned char ad1, unsigned char ad0); -//extern void programmingAudio(void); extern void unprotect_sector(unsigned char ad2, unsigned char ad1, unsigned char ad0); extern void playingAudio(unsigned char nsound); |
From: jaguarondi <c2m...@c2...> - 2007-09-06 12:07:49
|
Author: jaguarondi Date: 2007-09-06 14:07:50 +0200 (Thu, 06 Sep 2007) New Revision: 490 Modified: firmware/tuxcore/trunk/doc/builddoc.sh Log: * Now builddoc.sh can be run from within the doc folder too. Some comments added. Modified: firmware/tuxcore/trunk/doc/builddoc.sh =================================================================== --- firmware/tuxcore/trunk/doc/builddoc.sh 2007-09-06 11:58:06 UTC (rev 489) +++ firmware/tuxcore/trunk/doc/builddoc.sh 2007-09-06 12:07:50 UTC (rev 490) @@ -4,8 +4,15 @@ # # Written by David Bourgeois <da...@ja...> # -# $Id:$ +# $Id$ +# This script should be started from the base folder, not the doc folder. +if [ $(basename $PWD) == "doc" ] +then + cd .. +fi + +# Get version number from version.h. if [ -f svnrev.h ] then VERSION_MAJ=$(sed -n "s/\#define VER_MAJOR *//p" version.h) @@ -15,6 +22,8 @@ echo "Error: version.h doesn't exist, aborting." exit 1 fi + +# Get revision number and whether we generate the documentation of a tag. if [ -f svnrev.h ] then REVISION=$(sed -n "s/\#define SVN_REV\> *//p" svnrev.h) |
From: Paul_R <c2m...@c2...> - 2007-09-06 11:58:07
|
Author: Paul_R Date: 2007-09-06 13:58:06 +0200 (Thu, 06 Sep 2007) New Revision: 489 Modified: firmware/tuxaudio/branches/audio_cleanup/flash.c firmware/tuxaudio/branches/audio_cleanup/flash.h firmware/tuxaudio/branches/audio_cleanup/main.c firmware/tuxaudio/branches/audio_cleanup/spi.c Log: The functions to write in the flash memory has been changed. The programming sequence has been splitted. A state machine control the all the process. ASM code has been removed. INT0 routine is now correctly executed... Modified: firmware/tuxaudio/branches/audio_cleanup/flash.c =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/flash.c 2007-09-06 11:35:14 UTC (rev 488) +++ firmware/tuxaudio/branches/audio_cleanup/flash.c 2007-09-06 11:58:06 UTC (rev 489) @@ -31,52 +31,55 @@ void erase_flash(void); unsigned char read_data(unsigned char ad2, unsigned char ad1, unsigned char ad0); -void programmingAudio(void); +//void programmingAudio(void); void unprotect_sector(unsigned char ad2, unsigned char ad1, unsigned char ad0); void playingAudio(unsigned char nsound); void stopPlayingAudio(void); +uint8_t flash_state; + unsigned char read_status(void) { unsigned char status; - PORTB &= ~0x02; // Chip Select + PORTB &= ~0x02; /* Chip Select */ - spiSend(0x05); // Send Read Status Command - status = spiSend(0x00); // Read status on spi + spiSend(0x05); /* Send Read Status Command */ - PORTB |= 0x02; // Chip Deselect + status = spiSend(0x00); /* Read status on spi */ + PORTB |= 0x02; /* Chip Deselect */ + return status; } void write_enable(void) { - PORTB &= ~0x02; // Chip Select + PORTB &= ~0x02; /* Chip Select */ - spiSend(0x06); // Send Write Enable Command + spiSend(0x06); /* Send Write Enable Command */ - PORTB |= 0x02; // Chip Deselect + PORTB |= 0x02; /* Chip Deselect */ } void write_disable(void) { - PORTB &= ~0x02; // Chip Select + PORTB &= ~0x02; /* Chip Select */ - spiSend(0x04); // Send Write Disable Command + spiSend(0x04); /* Send Write Disable Command */ - PORTB |= 0x02; // Chip Deselect + PORTB |= 0x02; /* Chip Deselect */ } void write_status(unsigned char status) { - PORTB &= ~0x02; // Chip Select + PORTB &= ~0x02; /* Chip Select */ - spiSend(0x01); // Send Write Status Command - spiSend(status); // Send status + spiSend(0x01); /* Send Write Status Command */ + spiSend(status); /* Send status */ - PORTB |= 0x02; // Chip Deselect + PORTB |= 0x02; /* Chip Deselect */ } @@ -126,8 +129,6 @@ spiSend(0xC7); // Send Erase Bulk command PORTB |= 0x02; // Chip Deselect - - while (read_status() != 0x10) ; // Wait Bulk Erase Cycle } void program_flash(unsigned char ad2, unsigned char ad1, unsigned char ad0, @@ -165,10 +166,16 @@ return data1; } -void programmingAudio(void) +/** + * \ingroup flash + * \brief Erase the flash memory. + * This funtion perform a full erase of the flash memory. + */ + + +unsigned char ad0, ad1, ad2, i, j; +void erasingFlash(void) { - unsigned char ad0, ad1, ad2, i, j; - TCCR0A = 0x00; // Desactivate PWM TCCR0B = 0x00; OCR0A = 0x00; @@ -176,62 +183,92 @@ TWCR = (TWCR & TWCR_CMD_MASK) & ~_BV(TWIE); // Desactivate I2C - // Deactivate all interrupt - resetFifo(&PWMFifo); /* Reinitialise the PWM fifo */ programmingFlash = 1; // Set the flag to suspend the task - // First step ERASE FLASH erase_flash(); // Erase the flash +} +/** + * \ingroup flash + * \brief Write the number of sound to be stored. + * This function store the first TOC byte (numSound), received with the flash + * program command, at the first memory adress. + */ - // Second step WRITE FIRST BYTE OF TOC +void programmingNumSound(void) +{ program_flash(0x00, 0x00, 0x00, numSound); // Write first byte of the TOC - // Third step WRITE TOC + ad0 = 0x01; // Init TOC address ad1 = 0x00; ad2 = 0x00; - for (i = 0; i <= numSound; i++) // Writing TOC + i = 0; +} +/** + * \ingroup flash + * \brief Write the TOC in the memory. + * This function store the the indexes into the memory. + */ + +void programmingToc(void) +{ + TOCRX = 0; + flash_state = 0; + for (j = 0; j < 3; j++) { - while (!TOCRX) ; // Wait TOC address incomming - TOCRX = 0; // Reset TOC incomming flag + program_flash(ad2, ad1, ad0, TOCadress[j]); + ad0++; // Increment new adress + if (ad0 == 0x00) + ad1++; + } + i++; - for (j = 0; j < 3; j++) - { - program_flash(ad2, ad1, ad0, TOCadress[j]); - ad0++; // Increment new adress - if (ad0 == 0x00) - ad1++; - } + if (i == numSound + 1) + { + ad[0] = TOCadress[2]; // Save final addres + ad[1] = TOCadress[1]; + ad[2] = TOCadress[0]; + + ad2 = 0x00; // Init sound address + ad1 = 0x04; + ad0 = 0x00; + + flash_state = 1; } +} - ad[0] = TOCadress[2]; // Save final addres - ad[1] = TOCadress[1]; - ad[2] = TOCadress[0]; - - // Fourth step WRITE SOUND - ad2 = 0x00; // Init sound address - ad1 = 0x04; - ad0 = 0x00; +void initSoundProgramming (void) +{ + flash_state = 0; write_enable(); PORTB &= ~0x02; // Chip Select spiSend(0xAF); // Send Sequencial Program Command spiSend(ad2); // Send Address spiSend(ad1); spiSend(ad0); - while (1) // Send first byte into the page flash + + while (!spi_start) // Send first byte into the page flash { if (!isFifoEmpty(&PWMFifo)) // Fifo not empty { spiSend(pullFifo(&PWMFifo)); // Write data in flash ad0++; - break; // End of firt command + flash_state = 1; // End of firt command + break; } + else + flash_state = 0; } PORTB |= 0x02; // Chip Deselect - while (read_status() != 0x52) ; // Wait Page Program Cycle - while (1) +} + +void soundProgramming(void) +{ + flash_state = 0; + // Fourth step WRITE SOUND + while (!spi_start) { if (!isFifoEmpty(&PWMFifo)) // Fifo not empty { @@ -248,20 +285,26 @@ } while (read_status() != 0x52) ; // Wait Page Program Cycle } + + /* Check for the last sound byte */ if (ad2 == ad[2]) { if (ad1 == ad[1]) { if (ad0 == ad[0]) { + flash_state = 1; break; // Stop programming flash } } } } +} +void endProgramming (void) +{ write_disable(); // Disable wrtie flash - + flash_state = 0; TCCR0A = 0x23; // Reactivate PWM TCCR0B = 0x09; OCR0A = 249; /* we need TOP=250 to get a 8kHz sampling frequency */ @@ -269,8 +312,6 @@ TWCR = (TWCR & TWCR_CMD_MASK) | _BV(TWIE); // Reactivate I2C - // Reactivate all interrupt - programmingFlash = 0; // Reset the flag to suspend the task } Modified: firmware/tuxaudio/branches/audio_cleanup/flash.h =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/flash.h 2007-09-06 11:35:14 UTC (rev 488) +++ firmware/tuxaudio/branches/audio_cleanup/flash.h 2007-09-06 11:58:06 UTC (rev 489) @@ -19,6 +19,22 @@ /* $Id: */ +/** \defgroup flash Flash memory + \ingroup flash + + This module control all the functions to read / write the flash memory. +*/ + +/** \file flash.h + \ingroup flash +*/ +/** \file flash.c + \ingroup flash +*/ + + + + #ifndef FLASH_H #define FLASH_H @@ -29,10 +45,18 @@ extern void erase_flash(void); extern unsigned char read_data(unsigned char ad2, unsigned char ad1, unsigned char ad0); -extern void programmingAudio(void); +//extern void programmingAudio(void); extern void unprotect_sector(unsigned char ad2, unsigned char ad1, unsigned char ad0); extern void playingAudio(unsigned char nsound); extern void stopPlayingAudio(void); +extern void erasingFlash(void); +extern void programmingNumSound(void); +extern void programmingToc(void); +extern void initSoundProgramming(void); +extern void soundProgramming(void); +extern void endProgramming(void); + +extern uint8_t flash_state; #endif Modified: firmware/tuxaudio/branches/audio_cleanup/main.c =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/main.c 2007-09-06 11:35:14 UTC (rev 488) +++ firmware/tuxaudio/branches/audio_cleanup/main.c 2007-09-06 11:58:06 UTC (rev 489) @@ -39,6 +39,7 @@ * Version number */ +uint8_t f_state = 0; #define CPU_NUMBER TUXAUDIO_CPU_NUM /* audio CPU */ const author_t author __attribute__ ((section("version.3"))) = { @@ -122,7 +123,7 @@ */ #define DBG_STACK 1 -void SIG_INTERRUPT0(void) __attribute__ ((signal, naked)); +//void SIG_INTERRUPT0(void) __attribute__ ((signal, naked)); #if (DBG_STACK) /* @@ -169,6 +170,7 @@ else unmute_amp(); } + else if (audioBuf[0] == SLEEP_CMD) { pre_sleep_delay = 30; /* handle sleep in its own function */ @@ -194,10 +196,12 @@ { /* param: command[1] : number of sounds */ numSound = command[1]; - programmingAudio(); + f_state = 0; + erasingFlash(); } else if (command[0] == STORE_INDEX_CMD) { + /* param: command[1] : lower address byte */ /* command[2] : middle address byte */ /* command[3] : higher address byte */ @@ -205,6 +209,7 @@ TOCadress[1] = command[2]; // Medium address TOCadress[0] = command[1]; // Lower address TOCRX = 1; // Set TOC incoming flag + command[0] = 0; } /* Version */ @@ -235,6 +240,12 @@ command[3] = battery_level; pushCommands(command); /* push the command set on the filo stack */ } +#define ERASE_STATE 0 +#define FIRST_PROG_STATE 1 +#define PROG_TOC_STATE 2 +#define INIT_SOUND_PROG_STATE 3 +#define SOUND_PROG_STATE 4 +#define END_STATE 5 int main(void) { @@ -277,7 +288,7 @@ while (1) /* Inifinite main loop */ { - asm volatile ("SPITRANSACTION: \n\t"); + // asm volatile ("SPITRANSACTION: \n\t"); sei(); // Reactivate global interrupt in case of flash programmation if (!flashPlay) @@ -290,90 +301,125 @@ if (programmingFlash) // Restora all the context for flash programming { - asm volatile ("cli \n\t" "ldi r24, 0x00 \n\t" // SPCR=0x00; // Reset SPI to avoy any trace of previous transactions - "out 0x2c, r24 \n\t" "ldi r24, 0x50 \n\t" // SPCR=0x50; - "out 0x2c, r24 \n\t" "pop r31 \n\t" // Restore all the context - "pop r30 \n\t" "pop r29 \n\t" "pop r28 \n\t" "pop r27 \n\t" "pop r26 \n\t" "pop r25 \n\t" "pop r23 \n\t" "pop r22 \n\t" "pop r21 \n\t" "pop r20 \n\t" "pop r19 \n\t" "pop r18 \n\t" "pop r17 \n\t" "pop r16 \n\t" "pop r15 \n\t" "pop r14 \n\t" "pop r13 \n\t" "pop r12 \n\t" "pop r11 \n\t" "pop r10 \n\t" "pop r9 \n\t" "pop r8 \n\t" "pop r7 \n\t" "pop r6 \n\t" "pop r5 \n\t" "pop r4 \n\t" "pop r3 \n\t" "pop r2 \n\t" "pop r24 \n\t" "pop r0 \n\t" "out 0x3f, r0 \n\t" // Restore SREG - "pop r0 \n\t" "pop r1 \n\t" "sbi 0x05, 0 \n\t" // PORTB |= 0x01; // Set the HOLD signal - "sei \n\t" "reti \n\t"); + SPCR = 0x00; + SPCR = 0X50; + PORTB |= 0x01; + if (f_state == ERASE_STATE) + { + if (read_status() == 0x10) + f_state ++; + } + else if (f_state == FIRST_PROG_STATE) + { + programmingNumSound(); + f_state ++; + } + else if (f_state == PROG_TOC_STATE) + { + if (TOCRX) + programmingToc(); + if (flash_state) + f_state ++; + } + else if (f_state == INIT_SOUND_PROG_STATE) + { + initSoundProgramming(); + if (flash_state) + f_state ++; + } + if (f_state == SOUND_PROG_STATE) + { + soundProgramming(); + + if (flash_state) + f_state ++; + } + else if (f_state == END_STATE) + { + endProgramming(); + f_state = 0; + } } - - if (flashPlay) + else { - cli(); - if (!isFifoFull(&PWMFifo)) + if (flashPlay) { - PORTB |= 0x01; // Set the HOLD signal - sound = spiSend(0x00); // Wait response - PORTB &= ~0x01; // Reset the HOLD signal - sound = sound >> audioLevel; - pushFifo(&PWMFifo, sound); + cli(); + if (!isFifoFull(&PWMFifo)) + { + PORTB |= 0x01; // Set the HOLD signal + sound = spiSend(0x00); // Wait response + PORTB &= ~0x01; // Reset the HOLD signal + sound = sound >> audioLevel; + pushFifo(&PWMFifo, sound); - ad[2]++; // Increment address for next play - if (ad[2] == 0) - { - ad[1]++; - if (ad[1] == 0) + ad[2]++; // Increment address for next play + if (ad[2] == 0) { - ad[0]++; - if (ad[0] == 0x08) // Address overflow - stopPlayingAudio(); + ad[1]++; + if (ad[1] == 0) + { + ad[0]++; + if (ad[0] == 0x08) // Address overflow + stopPlayingAudio(); + } } + if (ad[0] == ad[3]) // Test end of sound + if (ad[1] == ad[4]) + if (ad[2] == ad[5]) + stopPlayingAudio(); } - if (ad[0] == ad[3]) // Test end of sound - if (ad[1] == ad[4]) - if (ad[2] == ad[5]) - stopPlayingAudio(); + sei(); } - sei(); - } - if (sendSensorsFlag) - { - sendSensorsFlag = 0; - if (pre_sleep_delay > 1) - /* There's a delay before the sleep function is actually called - * otherwise other commands on the stack can't be executed */ - pre_sleep_delay--; - /* stop sending sensor status in sleep as the i2C should be - * stopped at this time */ - else - sendSensors(); - /* wait for all status to be sent before going to sleep */ - /* TODO fix these conditions for the sleep */ - //if (isFifoEmpty(statusFifo)) + if (sendSensorsFlag) + { + sendSensorsFlag = 0; + if (pre_sleep_delay > 1) + /* There's a delay before the sleep function is actually called + * otherwise other commands on the stack can't be executed */ + pre_sleep_delay--; + /* stop sending sensor status in sleep as the i2C should be + * stopped at this time */ + else + sendSensors(); + /* wait for all status to be sent before going to sleep */ + /* TODO fix these conditions for the sleep */ + //if (isFifoEmpty(statusFifo)) /* wait for audio commands to be processed */ //if (!audioBufIdx && !flashPlay) - if (power_on_reset_delay) /* XXX to move to a proper loop or timer after or before main() */ - { - uint8_t volatile j; + if (power_on_reset_delay) /* XXX to move to a proper loop or timer after or before main() */ + { + uint8_t volatile j; - DDRD |= 0x02; - for (j = 0; j < 0xFF; j++) ; - power_on_reset_delay--; - if (!power_on_reset_delay) - { - /* Set the microphone power */ DDRD |= 0x02; + for (j = 0; j < 0xFF; j++) ; + power_on_reset_delay--; + if (!power_on_reset_delay) + { + /* Set the microphone power */ + DDRD |= 0x02; + } + else + DDRD &= ~0x02; } - else - DDRD &= ~0x02; } - } - sendCommands(); /* Send commands on I2C */ - if (audioBufIdx) - audioIntParser(); + sendCommands(); /* Send commands on I2C */ - /* Send information to the computer. */ - if (info_flg) - send_info(); + if (audioBufIdx) + audioIntParser(); - /* Sleep mode */ - if (pre_sleep_delay == 1) - sleep(); + /* Send information to the computer. */ + if (info_flg) + send_info(); + + /* Sleep mode */ + if (pre_sleep_delay == 1) + sleep(); + } } } @@ -441,24 +487,13 @@ //OCR0A = 250; // Normal operation for ADC sampling if FIFO Adaptative is on } } - if (--sendSensorsCmpt == 0) + if (--sendSensorsCmpt == 0) sendSensorsFlag = 1; /* send status to the behavioural CPU, 8KHz divided by 256 lead to a status sent each 32ms */ } } // External Interrupt 0 service routine PD2 -void SIG_INTERRUPT0(void) +ISR(SIG_INTERRUPT0) { - asm volatile ("push r1 \n\t" "push r0 \n\t" "in r0, 0x3f \n\t" // Save SREG - "push r0 \n\t" "eor r1, r1 \n\t" "push r24 \n\t" "lds r24, programmingFlash \n\t" // if (programmingFlash) - "and r24, r24 \n\t" // { - "breq SETFLAGINT \n\t" "push r2 \n\t" // Save all the context - "push r3 \n\t" // Executing time of all push guarantee that spi transaction is correctly finish - "push r4 \n\t" "push r5 \n\t" "push r6 \n\t" "push r7 \n\t" "push r8 \n\t" "push r9 \n\t" "push r10 \n\t" "push r11 \n\t" "push r12 \n\t" "push r13 \n\t" "push r14 \n\t" "push r15 \n\t" "push r16 \n\t" "push r17 \n\t" "push r18 \n\t" "push r19 \n\t" "push r20 \n\t" "push r21 \n\t" "push r22 \n\t" "push r23 \n\t" "push r25 \n\t" "push r26 \n\t" "push r27 \n\t" "push r28 \n\t" "push r29 \n\t" "push r30 \n\t" "push r31 \n\t" "ldi r24, 0x01 \n\t" // spi_start = 1; // Set the flag SPI ready from RF - "sts spi_start, r24 \n\t" "cbi 0x05, 0 \n\t" // PORTB &= ~0x01; // Reset the HOLD signal - "rjmp SPITRANSACTION \n\t" // } - "SETFLAGINT: \n\t" // else - "ldi r24, 0x01 \n\t" // spi_start = 1; // Set the flag SPI ready from RF - "sts spi_start, r24 \n\t" "pop r24 \n\t" "pop r0 \n\t" - "out 0x3f, r0 \n\t" "pop r0 \n\t" "pop r1 \n\t" "reti \n\t"); + spi_start = 1; } Modified: firmware/tuxaudio/branches/audio_cleanup/spi.c =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/spi.c 2007-09-06 11:35:14 UTC (rev 488) +++ firmware/tuxaudio/branches/audio_cleanup/spi.c 2007-09-06 11:58:06 UTC (rev 489) @@ -35,7 +35,8 @@ spi_count = 0; // Reset spi counter spi_slave = HEADERS; // Set state machine spi_master = HEADERM; - + if (programmingFlash) + PORTB &= ~0x01; // Reset SPI to fix strange bug on the spi SPCR = 0x50; SPSR = 0x00; |
From: jaguarondi <c2m...@c2...> - 2007-09-06 11:36:17
|
Author: jaguarondi Date: 2007-09-06 13:35:14 +0200 (Thu, 06 Sep 2007) New Revision: 488 Removed: firmware/tuxaudio/branches/audio_cleanup/test.c firmware/tuxaudio/branches/audio_cleanup/test.h Modified: firmware/tuxaudio/branches/audio_cleanup/Makefile firmware/tuxaudio/branches/audio_cleanup/init.c firmware/tuxaudio/branches/audio_cleanup/main.c firmware/tuxaudio/branches/audio_cleanup/varis.c firmware/tuxaudio/branches/audio_cleanup/varis.h firmware/tuxaudio/branches/audio_cleanup/version.h Log: * Ported r482 from trunk. Modified: firmware/tuxaudio/branches/audio_cleanup/Makefile =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/Makefile 2007-09-06 07:27:54 UTC (rev 487) +++ firmware/tuxaudio/branches/audio_cleanup/Makefile 2007-09-06 11:35:14 UTC (rev 488) @@ -167,10 +167,10 @@ $(AVRDUDE) -p $(MCU) -c jtag2isp -P usb -B 10 -e -U flash:w:$(PROJECT).hex -U eeprom:w:$(PROJECT).eep progisp_bl: $(PROJECT).hex $(PROJECT).eep $(PROJECT)_bl.hex - $(AVRDUDE) -p $(MCU) -c jtag2isp -P usb -B 10 -e -U flash:w:$(PROJECT).hex -U eeprom:w:$(PROJECT).eep -D -U flash:w:$(PROJECT)_bl.hex + $(AVRDUDE) -p $(MCU) -c jtag2isp -P usb -B 10 -e -U flash:w:$(PROJECT)_bl.hex -U eeprom:w:$(PROJECT).eep -D -U flash:w:$(PROJECT).hex progstk: $(PROJECT).hex $(PROJECT).eep $(AVRDUDE) -p $(MCU) -c stk500v2 -e -U flash:w:$(PROJECT).hex -U eeprom:w:$(PROJECT).eep progstk_bl: $(PROJECT).hex $(PROJECT).eep $(PROJECT)_bl.hex - $(AVRDUDE) -p $(MCU) -c stk500v2 -e -U flash:w:$(PROJECT).hex -U eeprom:w:$(PROJECT).eep -D -U flash:w:$(PROJECT)_bl.hex + $(AVRDUDE) -p $(MCU) -c stk500v2 -e -U flash:w:$(PROJECT)_bl.hex -U eeprom:w:$(PROJECT).eep -D -U flash:w:$(PROJECT).hex Modified: firmware/tuxaudio/branches/audio_cleanup/init.c =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/init.c 2007-09-06 07:27:54 UTC (rev 487) +++ firmware/tuxaudio/branches/audio_cleanup/init.c 2007-09-06 11:35:14 UTC (rev 488) @@ -59,7 +59,8 @@ // Port D initialization //PORTD.0 -> OUT IR receiver power - //PORTD.1 -> OUT microphone preamplifier power (PU at beginning the switched to strong 1) + //PORTD.1 -> OUT microphone preamplifier power (PU at beginning then + // switched to strong 1) //PORTD.2 -> IN RF SPI READY //PORTD.3 -> IN RF SPI START //PORTD.4 -> PU CHARGER STATUS Modified: firmware/tuxaudio/branches/audio_cleanup/main.c =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/main.c 2007-09-06 07:27:54 UTC (rev 487) +++ firmware/tuxaudio/branches/audio_cleanup/main.c 2007-09-06 11:35:14 UTC (rev 488) @@ -169,10 +169,6 @@ else unmute_amp(); } - else if (audioBuf[0] == TEST_MODE_CMD) - { - test_mode = audioBuf[2]; /* audio test mode is the second parameter */ - } else if (audioBuf[0] == SLEEP_CMD) { pre_sleep_delay = 30; /* handle sleep in its own function */ @@ -400,57 +396,50 @@ { sampling_pwm = 0x04; /* reinit counter */ - if (test_mode == AT_AUDIOLINK) - { - OCR0B = ADCH; - } - else - { #ifndef MIC_GAIN #define MIC_GAIN 0 /* default value if not declared in the makefile */ #endif #if (MIC_GAIN == 6) - /* MEDIUM GAIN MODE */ - uint8_t tmp; + /* MEDIUM GAIN MODE */ + uint8_t tmp; - tmp = ADCL; - tmp = tmp >> 1; - if (!(ADCH & 0x01)) /* AND the 9th bit then add 0x80 is equivalent to AND the complement of the 9th bit */ - tmp |= 0x80; - pushFifo(&ADCFifo, tmp); - /* HIGH GAIN MODE */ + tmp = ADCL; + tmp = tmp >> 1; + if (!(ADCH & 0x01)) /* AND the 9th bit then add 0x80 is equivalent to AND the complement of the 9th bit */ + tmp |= 0x80; + pushFifo(&ADCFifo, tmp); + /* HIGH GAIN MODE */ #elif (MIC_GAIN == 12) - uint8_t tmp; + uint8_t tmp; - tmp = ADCL + 0x80; - pushFifo(&ADCFifo, tmp); - asm volatile ("lds __tmp_reg__, %0"::"M" (_SFR_MEM_ADDR(ADCH))); /* ADCH needs to be read for the next acquisition */ + tmp = ADCL + 0x80; + pushFifo(&ADCFifo, tmp); + asm volatile ("lds __tmp_reg__, %0"::"M" (_SFR_MEM_ADDR(ADCH))); /* ADCH needs to be read for the next acquisition */ #else /* (MIC_GAIN == 0) or anything else */ - /* LOW GAIN MODE */ - if (ADCH == 0) /* XXX RF looses connection if too much '0' are sent, but the noise should normally be enough to avoid that */ - pushFifo(&ADCFifo, 0x01); - else - pushFifo(&ADCFifo, ADCH); + /* LOW GAIN MODE */ + if (ADCH == 0) /* XXX RF looses connection if too much '0' are sent, but the noise should normally be enough to avoid that */ + pushFifo(&ADCFifo, 0x01); + else + pushFifo(&ADCFifo, ADCH); #endif - if (!popFifo(&PWMFifo, &dataFifo)) /* set the sample value to timer pulse width */ + if (!popFifo(&PWMFifo, &dataFifo)) /* set the sample value to timer pulse width */ + { + OCR0B = dataFifo; + 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) { - OCR0B = dataFifo; - 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(); + if (tuxaudio_config.automute) + mute_amp(); + Fifoinert = 30; + //OCR0A = 250; // Normal operation for ADC sampling if FIFO Adaptative is on } - 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 (--sendSensorsCmpt == 0) sendSensorsFlag = 1; /* send status to the behavioural CPU, 8KHz divided by 256 lead to a status sent each 32ms */ Deleted: firmware/tuxaudio/branches/audio_cleanup/test.c =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/test.c 2007-09-06 07:27:54 UTC (rev 487) +++ firmware/tuxaudio/branches/audio_cleanup/test.c 2007-09-06 11:35:14 UTC (rev 488) @@ -1,76 +0,0 @@ -/* - * TUXAUDIO - Firmware for the 'audio' CPU of tuxdroid - * Copyright (C) 2007 C2ME S.A. <tux...@c2...> - * - * 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 <avr/io.h> -#include "varis.h" -#include "flash.h" - -void testaudio(void) -{ - int i; - unsigned char ad2, ad1, ad0, tmp; - -/* erase_flash (); // Erase flash - program_flash (0x00, 0x00, 0x00, 0x01); // Write first byte of the TOC - program_flash (0x00, 0x00, 0x01, 0x00); // Write speudo TOC for test - program_flash (0x00, 0x00, 0x02, 0x04); - program_flash (0x00, 0x00, 0x03, 0x00); - program_flash (0x00, 0x00, 0x04, 0x00); - program_flash (0x00, 0x00, 0x05, 0x42); - program_flash (0x00, 0x00, 0x06, 0x00); - ad2 = 0x00; // Init sound address - ad1 = 0x04; - ad0 = 0x00; - write_enable (); - PORTB &= ~0x02; // Chip Select - SPDR = 0xAF; // Send Sequencial Program Command - while ((SPSR & 0x80) == 0); // Wait SPI response - SPDR = ad2; // Send Address - while ((SPSR & 0x80) == 0); // Wait SPI response - SPDR = ad1; - while ((SPSR & 0x80) == 0); // Wait SPI response - SPDR = ad0; - 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 - 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 - while ((SPSR & 0x80) == 0); // Wait SPI response - PORTB |= 0x02; // Chip DeselecT - tmp++; - ad0++; // Increment address byte - if (ad0 == 0x00) - { - ad1++; - if (ad1 == 0x00) - ad2++; - } - while (read_status() != 0x10); // Wait Page Program Cycle - } -*/// ATTENTION NE PAS OBUBLIER LE MUTE -} Deleted: firmware/tuxaudio/branches/audio_cleanup/test.h =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/test.h 2007-09-06 07:27:54 UTC (rev 487) +++ firmware/tuxaudio/branches/audio_cleanup/test.h 2007-09-06 11:35:14 UTC (rev 488) @@ -1,27 +0,0 @@ -/* - * TUXAUDIO - Firmware for the 'audio' CPU of tuxdroid - * Copyright (C) 2007 C2ME S.A. <tux...@c2...> - * - * 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: */ - -#ifndef TEST_H -#define TEST_H - -extern void testaudio(void); - -#endif Modified: firmware/tuxaudio/branches/audio_cleanup/varis.c =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/varis.c 2007-09-06 07:27:54 UTC (rev 487) +++ firmware/tuxaudio/branches/audio_cleanup/varis.c 2007-09-06 11:35:14 UTC (rev 488) @@ -71,6 +71,3 @@ volatile unsigned char lockAdaptFifo = 1; volatile unsigned char Fifoinert = 0; - -// Test mode -uint8_t test_mode = 0; Modified: firmware/tuxaudio/branches/audio_cleanup/varis.h =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/varis.h 2007-09-06 07:27:54 UTC (rev 487) +++ firmware/tuxaudio/branches/audio_cleanup/varis.h 2007-09-06 11:35:14 UTC (rev 488) @@ -82,7 +82,4 @@ extern volatile unsigned char Fifoinert; -// Test mode -extern uint8_t test_mode; - #endif Modified: firmware/tuxaudio/branches/audio_cleanup/version.h =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/version.h 2007-09-06 07:27:54 UTC (rev 487) +++ firmware/tuxaudio/branches/audio_cleanup/version.h 2007-09-06 11:35:14 UTC (rev 488) @@ -30,7 +30,7 @@ #define VER_MAJOR 0 #define VER_MINOR 3 -#define VER_UPDATE 0 +#define VER_UPDATE 1 #define AUTHOR_ID 0 /* official release */ |
From: jaguarondi <c2m...@c2...> - 2007-09-06 07:27:54
|
Author: jaguarondi Date: 2007-09-06 09:27:54 +0200 (Thu, 06 Sep 2007) New Revision: 487 Added: firmware/tuxcore/trunk/debug.h Modified: firmware/tuxcore/trunk/doc/Doxyfile firmware/tuxcore/trunk/main.c Log: * Moved the debug functions to their own file (debug.h), added Doxygen comments and did some cleanup. Added: firmware/tuxcore/trunk/debug.h =================================================================== --- firmware/tuxcore/trunk/debug.h (rev 0) +++ firmware/tuxcore/trunk/debug.h 2007-09-06 07:27:54 UTC (rev 487) @@ -0,0 +1,90 @@ +/* + * TUXCORE - Firmware for the 'core' CPU of tuxdroid + * Copyright (C) 2007 C2ME S.A. <tux...@c2...> + * + * 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:$ */ + +/** + * \defgroup debug Debugging aid + * + * \section stack Checking for stack overflow + * + * Setting DBG_STACK to 1 will enable the init_ram function which initializes + * the ram with a constant value in the .init1 section. During initialization, + * the beginning of the ram is replaced with the variables, and the end of the + * ram is overwritten when the stack grows. Using an ICE (In-Circuit Debugger), + * you can pause the running process at any time and check that the middle part + * of the ram still has some cells with the initial constant value. Otherwise + * you have a stack overflow. + * + * Usage: + * - set DBG_STACK to 1 in debug.h + * - insert the DBG_STACK_INIT macro in your main code: + * \code + * // If stack debugging is enabled, this macro initializes the ram with a + * // constant value in order to catch stack overflow by examining the stack at a + * // breakpoint. + * DBG_STACK_INIT \endcode + * + * \todo TODO Could we get a function that checks the free memory by looking at + * that middle part of the ram and sends that information back to the computer? + * It might help knowing when we're getting close to a stack overflow. + */ + +/** + * \file debug.h + * \ingroup debug + * \brief Debugging aid + */ + +/** \name Configuration + * \ingroup debug */ +/*! @{ */ + +/** Enables stack overflow detection */ +#define DBG_STACK 0 + +/*! @} */ + +/** + * \var DBG_STACK_INIT + * \brief RAM initialization with a constant value + * \ingroup debug + * + * Fill the ram with a constant value at the first .init section, before GCC + * initializes the global variables. + * + * \todo TODO Explain where the offset comes from, change the code to have a define + * of the size instead of hard coded values for the ram boundaries + */ +/* __DOXYGEN__ is set when generating the doxygen documentation, this helps + * choosing what Doxygen should parse. */ +#if (DBG_STACK || __DOXYGEN__) +#define RAM_INIT_VALUE 0x5F +#define DBG_STACK_INIT \ +void init_ram(void) __attribute__((naked)) __attribute__((section(".init1"))); \ +void init_ram(void) \ +{ \ + uint8_t *ptr; \ + \ + for (ptr = (uint8_t *) 0x0100; ptr < (uint8_t *) 0x0300; ptr++) \ + *ptr = RAM_INIT_VALUE; \ +} +#else +#define DBG_STACK_INIT +#endif Property changes on: firmware/tuxcore/trunk/debug.h ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Name: svn:eol-style + native Modified: firmware/tuxcore/trunk/doc/Doxyfile =================================================================== --- firmware/tuxcore/trunk/doc/Doxyfile 2007-09-06 07:25:29 UTC (rev 486) +++ firmware/tuxcore/trunk/doc/Doxyfile 2007-09-06 07:27:54 UTC (rev 487) @@ -1049,7 +1049,7 @@ # undefined via #undef or recursively expanded use the := operator # instead of the = operator. -PREDEFINED = +PREDEFINED = __DOXYGEN__ # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. Modified: firmware/tuxcore/trunk/main.c =================================================================== --- firmware/tuxcore/trunk/main.c 2007-09-06 07:25:29 UTC (rev 486) +++ firmware/tuxcore/trunk/main.c 2007-09-06 07:27:54 UTC (rev 487) @@ -46,13 +46,8 @@ #include "standalone.h" #include "parser.h" #include "config.h" +#include "debug.h" -/* - * Debug and test flags - */ -#define DBG_STACK 0 /* stack overflow detection */ -#define TEST_CHARGER 0 /* use eyes LED's to indicate charger status */ - void initIO(void); void closeIO(void); void timer2Init(void); @@ -72,23 +67,13 @@ uint8_t t100ms_tim; /* 100ms tick timer */ uint8_t t1s_tim; /* 1s tick timer */ -#if (DBG_STACK) /* - * Stack Overflow detection - * - * Fill the ram with a value (0x5F) before the first initialization in order to - * detect any stack overflow just by looking into the memory at any breakpoint + * If stack debugging is enabled, this macro initializes the ram with a + * constant value in order to catch stack overflow by examining the stack at a + * breakpoint. */ -void init_ram(void) __attribute__ ((naked)) __attribute__ ((section(".init1"))); -void init_ram(void) -{ - uint8_t *ptr; +DBG_STACK_INIT - for (ptr = (uint8_t *) 0x0100; ptr < (uint8_t *) 0x0300; ptr++) - *ptr = 0x5F; -} -#endif - /* * Timer2 overflow interrupt will be called each 4ms * and will provide 100ms and 1s counters |
From: jaguarondi <c2m...@c2...> - 2007-09-06 07:25:29
|
Author: jaguarondi Date: 2007-09-06 09:25:29 +0200 (Thu, 06 Sep 2007) New Revision: 486 Modified: firmware/tuxcore/trunk/version.h Log: * Bumped to version 0.3.1. Modified: firmware/tuxcore/trunk/version.h =================================================================== --- firmware/tuxcore/trunk/version.h 2007-09-06 07:24:35 UTC (rev 485) +++ firmware/tuxcore/trunk/version.h 2007-09-06 07:25:29 UTC (rev 486) @@ -30,7 +30,7 @@ #define VER_MAJOR 0 #define VER_MINOR 3 -#define VER_UPDATE 0 +#define VER_UPDATE 1 #define AUTHOR_ID 0 /* official release */ |
From: jaguarondi <c2m...@c2...> - 2007-09-06 07:24:37
|
Author: jaguarondi Date: 2007-09-06 09:24:35 +0200 (Thu, 06 Sep 2007) New Revision: 485 Modified: firmware/tuxcore/trunk/global.c firmware/tuxcore/trunk/global.h firmware/tuxcore/trunk/main.c firmware/tuxcore/trunk/parser.c firmware/tuxcore/trunk/standalone.c Log: * Cleanup: removed all production test related stuff. The test_mode variable is now only used for the remote mode, so I renamed it remote_mode. Modified: firmware/tuxcore/trunk/global.c =================================================================== --- firmware/tuxcore/trunk/global.c 2007-09-05 15:24:47 UTC (rev 484) +++ firmware/tuxcore/trunk/global.c 2007-09-06 07:24:35 UTC (rev 485) @@ -28,9 +28,10 @@ /* * Standalone behavior */ +/* remote mode to control tux from the remote control, XXX to be replaced with + * a better approach from the standalone behavior */ +uint8_t remote_mode = 0; -uint8_t test_mode = BT_NO_TEST; /* normal mode */ - /* * General global registers */ Modified: firmware/tuxcore/trunk/global.h =================================================================== --- firmware/tuxcore/trunk/global.h 2007-09-05 15:24:47 UTC (rev 484) +++ firmware/tuxcore/trunk/global.h 2007-09-06 07:24:35 UTC (rev 485) @@ -322,7 +322,7 @@ * Standalone behavior */ -extern uint8_t test_mode; /* normal mode */ +extern uint8_t remote_mode; /* normal mode */ /* * General global registers @@ -375,7 +375,6 @@ * Test modes */ -#define mb_test_condition (PINC & _BV(PC2)) #define sigout_set turnLeftLedOn #define sigout_unset turnLeftLedOff #define sigin_ini() {LED_PT &= ~LED_R_MK; LED_DDR &= ~LED_R_MK;} /* used as signal input */ Modified: firmware/tuxcore/trunk/main.c =================================================================== --- firmware/tuxcore/trunk/main.c 2007-09-05 15:24:47 UTC (rev 484) +++ firmware/tuxcore/trunk/main.c 2007-09-06 07:24:35 UTC (rev 485) @@ -147,10 +147,6 @@ */ int main(void) { - /* Prod tests condition check to enter mainboard test mode */ - if (mb_test_condition) - test_mode = BT_MBTEST; - /* I/O initialization */ initPosSwitches(); initMotors(); @@ -162,7 +158,7 @@ /* I2C communication initialization */ i2cCommunicationInit(); - /* Enables IR receiver */ + /* Enable IR receiver */ irGetRC5(); /* @@ -199,37 +195,6 @@ /* Wait for standalone actions to be done. */ if ((cond_flags.sleep == COND_SLEEP) && !event_timer) sleep(); - - /* - * Test and debug functions - */ - /* IR test procedure */ - // { - // while(1) - // { - // for (i=0; i<200;i++) _delay_ms (8); - // irSendRC5(0x1F,0x3F); - // } - // } - /* LDR test procedure */ - // { - // while(1) - // { - // for (i=0; i<200;i++) _delay_ms (8); - // getLight(); - // } - // } - -#if (TEST_CHARGER) - /* Test of the charger - * Use eyes LED's to indicate charger status */ - { - if (gStatus.sw & GSTATUS_CHARGER_MK) - turnLedsOff(); - else - turnLedsOn(); - } -#endif } } Modified: firmware/tuxcore/trunk/parser.c =================================================================== --- firmware/tuxcore/trunk/parser.c 2007-09-05 15:24:47 UTC (rev 484) +++ firmware/tuxcore/trunk/parser.c 2007-09-06 07:24:35 UTC (rev 485) @@ -194,20 +194,6 @@ return; } - /* Test modes */ - else if (command[0] == TEST_MODE_CMD) - { - if (!audioIntBufIdx) - { - for (i = 0; i < 3; i++) /* forwards the command to the audio CPU */ - audioIntBuf[i] = command[i]; - audioIntBufIdx = 3; - } - /* and switch to test mode */ - test_mode = command[1]; /* tuxcore test mode is the first parameter */ - return; - } - /* Version */ else if (command[0] == INFO_TUXCORE_CMD) { Modified: firmware/tuxcore/trunk/standalone.c =================================================================== --- firmware/tuxcore/trunk/standalone.c 2007-09-05 15:24:47 UTC (rev 484) +++ firmware/tuxcore/trunk/standalone.c 2007-09-06 07:24:35 UTC (rev 485) @@ -205,19 +205,14 @@ else setLeds(led_backup); - if ((!test_mode) || (test_mode == BT_REMOTE)) + /* Disable spinning when plugged */ + if ((gStatus.sw & GSTATUS_POWERPLUGSW_MK)) { - /* Disable spinning when plugged */ - if ((gStatus.sw & GSTATUS_POWERPLUGSW_MK)) - { - stopSpin(); /* flush the spinning commands */ - spinPosCnt = 0; - } - - /* Charging start notification */ + stopSpin(); /* flush the spinning commands */ + spinPosCnt = 0; } - if (test_mode == BT_REMOTE) + if (remote_mode) { /* BT_REMOTE: check buttons with leds */ if (gStatus. @@ -249,10 +244,10 @@ /* Entering remote mode */ if (ir_command == K_STARTVOIP) { - if (test_mode != BT_REMOTE) - test_mode = BT_REMOTE; + if (!remote_mode) + remote_mode = 1; else - test_mode = BT_NO_TEST; + remote_mode = 0; } } @@ -264,7 +259,7 @@ alt_mode = 0; /* Remote control mode */ - if (test_mode == BT_REMOTE) + if (remote_mode) { switch (ir_command) { @@ -327,196 +322,7 @@ break; } } - } - - /* Test mode */ - if (test_mode == BT_MBTEST) - { - volatile uint16_t i, j; - - /* Use led lines as communication signal */ - /* LED_R is still active low */ - - /* Release the signal input */ - sigin_ini(); - - /* #0 */ - for (i = 0; i < 0xFFF; i++) ; /* keep the negative pulse to synchronize with the tester */ - sigout_set(); /* signal test mode entered */ - /* #1 */ - while (!sigin) ; /* synchronize with the tester */ - - cli(); - /* Check capacitors */ - PORTD = 0x00; - DDRD = 0xFF; - PORTB = 0x00; - DDRB = 0xFF; - PORTC &= ~_BV(PC1); - DDRC |= _BV(PC1); - for (i = 0; i < 10; i++) - _delay_ms(5); - DDRD = 0x00; - DDRB = 0x00; - DDRC &= ~_BV(PC1); - PORTD |= (_BV(PD6) | _BV(PD7) | _BV(PD3)); - PORTB |= (_BV(PB3) | _BV(PB4)); - PORTC |= _BV(PC1); - _delay_ms(1); - if (PIND & (_BV(PD6) | _BV(PD7) | _BV(PD3))) - error(1); - if (PINB & (_BV(PB3) | _BV(PB4))) - error(2); - if (PINC & _BV(PC1)) - error(3); - - /* Check the shortcuts here */ - /* PORTB */ - PORTB = 0xFF; /* all pull-up */ - DDRB = 0xFF; - DDRC &= ~0x03; /* check only PC0 and PC1 */ - PORTC |= 0x03; /* all pull-up */ - DDRD = 0x00; - PORTD = 0xFF; /* all pull-up */ - for (j = 0; j < 5; j++) - _delay_ms(5); - DDRB = 0x00; - while (PINB != 0xFF) ; - while ((PINC & 0x03) != 0x03) ; - while (PIND != 0xFF) ; - for (i = 0; i < 8; i++) - { - PORTB = ~_BV(i); - DDRB = _BV(i); - if ((i == 3) || (i == 4) || (i == 7)) - for (j = 0; j < 10; j++) - _delay_ms(5); - while (PINB != (uint8_t) (~_BV(i))) ; - while ((PINC & 0x03) != 0x03) ; - while (PIND != 0xFF) ; - PORTB |= _BV(i); - if ((i == 3) || (i == 4) || (i == 7)) - for (j = 0; j < 10; j++) - _delay_ms(5); - } - PORTB = 0xFF; - /* PORTC */ - for (i = 0; i < 2; i++) - { - PORTC &= ~_BV(i); - DDRC |= _BV(i); - while (PINB != 0xFF) ; - while ((PINC & 0x03) != ((~_BV(i)) & 0x03)) ; - while (PIND != 0xFF) ; - PORTC |= _BV(i); - DDRC &= ~_BV(i); - } - /* PORTD */ - for (i = 0; i < 8; i++) - { - PORTD = ~_BV(i); - DDRD = _BV(i); - while (PINB != 0xFF) ; - while ((PINC & 0x03) != 0x03) ; - while (PIND != (uint8_t) (~_BV(i))) ; - } - - PORTB = 0x00; - DDRB = 0x00; - PORTD = 0x00; - DDRD = 0x00; - initMotors(); - CHARGER_INH_DDR |= CHARGER_INH_MK; - - /* Set the audio CPU in AT_MBTEST mode to check the flash and audio */ - audioIntBuf[0] = TEST_MODE_CMD; - audioIntBuf[2] = AT_MBTEST; - audioIntBufIdx = 3; - mb_test_flag = 0; - - test_mode = BT_MBTEST0; /* go to next state */ - /* #2 */ - sigout_unset(); - while (sigin) ; /* synchronize with the tester */ - } - else if (test_mode == BT_MBTEST0) /* check the I/O of the sound */ - { - if (gStatus.mic == 0xFF) - { - cli(); /* disable interrupts because the ADC ISR can affect PC0 */ - PORTC &= ~_BV(PC0); - while (PINC & _BV(PC0)) ; /* check the IR power connection */ - sei(); - /* #3 */ - sigout_set(); - while (!sigin) ; /* synchronize with the tester */ - sigout_unset(); - while (sigin) ; /* synchronize with the tester */ - - test_mode = BT_MBTEST1; /* go to next state */ - } - } - else if (test_mode == BT_MBTEST1) /* check the flash */ - { - if (gStatus.bat == 0xFF) - mb_test_flag = 1; - else if (gStatus.bat == 0xFE) /* flash failed */ - mb_test_flag = 0; - if ((gStatus.sw & GSTATUS_CHARGER_MK) && (gStatus.sw & STATUS_POWERPLUGSW_MK) && mb_test_flag) /* if not charging, not plugged and flash OK */ - { - /* #4 */ - sigout_set(); - while (!sigin) ; /* synchronize with the tester */ - test_mode = BT_MBTEST2; /* go to next state */ - } - } - else if (test_mode == BT_MBTEST2) /* check the motors */ - { - TIMSK2 = 0; - runEyes(); - sigout_unset(); - while (sigin) ; /* synchronize with the tester */ - runIEyes(); - sigout_set(); - while (!sigin) ; /* synchronize with the tester */ - stopEyes(); - runWingsFw(); - sigout_unset(); - while (sigin) ; /* synchronize with the tester */ - runWingsBw(); - sigout_set(); - while (!sigin) ; /* synchronize with the tester */ - stopWings(); - runSpinRight(); - sigout_unset(); - while (sigin) ; /* synchronize with the tester */ - runSpinLeft(); - sigout_set(); - while (!sigin) ; /* synchronize with the tester */ - stopSpin(); - - TIMSK2 = _BV(OCIE2A); - test_mode = BT_MBTEST3; /* go to next state */ - } - else if (test_mode == BT_MBTEST3) - { - if (!(gStatus.sw & GSTATUS_CHARGER_MK) && !(gStatus.sw & STATUS_POWERPLUGSW_MK)) /* if charging OK and plugged */ - { - /* #5 */ - sigout_unset(); - while (sigin) ; /* synchronize with the tester */ - while (!sigin) ; /* wait signal to turn the IR on */ - turnIrOn(); /* this should be the end of the test */ - test_mode = BT_NO_TEST; /* exit test mode */ - } - } - - /* Test mode */ - if (test_mode == BT_TEST_ALL) - { - } - } void error(uint8_t en) |
From: jaguarondi <c2m...@c2...> - 2007-09-05 15:24:47
|
Author: jaguarondi Date: 2007-09-05 17:24:47 +0200 (Wed, 05 Sep 2007) New Revision: 484 Modified: firmware/tuxdefs/config.h Log: * The initial values of the configuration registers are now clearer. Modified: firmware/tuxdefs/config.h =================================================================== --- firmware/tuxdefs/config.h 2007-09-05 15:21:44 UTC (rev 483) +++ firmware/tuxdefs/config.h 2007-09-05 15:24:47 UTC (rev 484) @@ -145,7 +145,12 @@ tuxaudio_config_t; /* Default configurations */ -#define TUXCORE_CONFIG {1, 1, 0} -#define TUXAUDIO_CONFIG {0} +#define TUXCORE_CONFIG { \ + .ir_feedback = 1, \ + .led_off_when_closed_eyes = 1, \ + .tux_greeting = 0} +#define TUXAUDIO_CONFIG { \ + .automute = 0} + #endif /* _CONFIG_H_ */ |
From: jaguarondi <c2m...@c2...> - 2007-09-05 15:21:47
|
Author: jaguarondi Date: 2007-09-05 17:21:44 +0200 (Wed, 05 Sep 2007) New Revision: 483 Modified: firmware/tuxdefs/commands.h firmware/tuxdefs/config.h firmware/tuxdefs/remote.h Log: * Updated the tuxdefs headers and licenses. * Removed the test enums. Modified: firmware/tuxdefs/commands.h =================================================================== --- firmware/tuxdefs/commands.h 2007-09-05 15:20:40 UTC (rev 482) +++ firmware/tuxdefs/commands.h 2007-09-05 15:21:44 UTC (rev 483) @@ -1,5 +1,5 @@ /* - * TUXCORE - Firmware for the 'core' CPU of tuxdroid + * TUXDEFS - Common defines used by the firmware and daemon of tuxdroid * Copyright (C) 2007 C2ME S.A. <tux...@c2...> * * This program is free software; you can redistribute it and/or modify @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: */ +/* $Id$*/ #ifndef _COMMAND_H_ #define _COMMAND_H_ @@ -361,34 +361,4 @@ #define RESERVED 0 -/* - * Test commands - */ - -#define TEST_MODE_CMD 0xB8 -/* 1st parameter: core CPU test mode */ - -enum test_mode_b_t -{ - BT_NO_TEST, /* run in normal mode, no tests activated */ - BT_TEST_ALL, /* production tests, enable spinning while plugged, continuous light measurement */ - BT_REMOTE, /* use the remote control to control movements and sounds of tux */ - BT_MBTEST, /* test of the MB naked */ - BT_MBTEST0, - BT_MBTEST1, - BT_MBTEST2, - BT_MBTEST3, -}; - -/* 2nd parameter: TUXAUDIO CPU test mode */ -enum test_mode_a_t -{ - AT_NO_TEST, /* run in normal mode, no tests activated */ - AT_NOSTATUSUP, /* flush the status buffer all the time so the I2C bus is running freely even without any RF connected */ - AT_MBTEST, /* test the flash,sends an acknowledge and enters audio link mode */ - AT_MBTEST1, - AT_MBTEST2, - AT_AUDIOLINK, /* link the microphone output to the speaker */ -}; - #endif /* _COMMAND_H_ */ Modified: firmware/tuxdefs/config.h =================================================================== --- firmware/tuxdefs/config.h 2007-09-05 15:20:40 UTC (rev 482) +++ firmware/tuxdefs/config.h 2007-09-05 15:21:44 UTC (rev 483) @@ -1,12 +1,24 @@ - -/* KySoH iTux agent +/* + * TUXDEFS - Common defines used by the firmware and daemon of tuxdroid + * Copyright (C) 2007 C2ME S.A. <tux...@c2...> * - * Config options for tux - * David Bourgeois - * -------------------------------------------------------- - * $Id$ + * 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$*/ + #ifndef _CONFIG_H_ #define _CONFIG_H_ Modified: firmware/tuxdefs/remote.h =================================================================== --- firmware/tuxdefs/remote.h 2007-09-05 15:20:40 UTC (rev 482) +++ firmware/tuxdefs/remote.h 2007-09-05 15:21:44 UTC (rev 483) @@ -1,12 +1,24 @@ - -/* KySoH iTux agent +/* + * TUXDEFS - Common defines used by the firmware and daemon of tuxdroid + * Copyright (C) 2007 C2ME S.A. <tux...@c2...> * - * General command listing - * David Bourgeois - * -------------------------------------------------------- - * $Id$ + * 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$*/ + #ifndef _REMOTE_H_ #define _REMOTE_H_ |
From: jaguarondi <c2m...@c2...> - 2007-09-05 15:20:45
|
Author: jaguarondi Date: 2007-09-05 17:20:40 +0200 (Wed, 05 Sep 2007) New Revision: 482 Removed: firmware/tuxaudio/trunk/test.c firmware/tuxaudio/trunk/test.h Modified: firmware/tuxaudio/trunk/Makefile firmware/tuxaudio/trunk/init.c firmware/tuxaudio/trunk/main.c firmware/tuxaudio/trunk/varis.c firmware/tuxaudio/trunk/varis.h firmware/tuxaudio/trunk/version.h Log: * When programming with the bootloader section, the bootloader is programmed first, so avrdude doesn't report a programming mismatch anymore. * Removed some production test stuff. * Bumped version to 0.3.1 Modified: firmware/tuxaudio/trunk/Makefile =================================================================== --- firmware/tuxaudio/trunk/Makefile 2007-09-05 15:04:43 UTC (rev 481) +++ firmware/tuxaudio/trunk/Makefile 2007-09-05 15:20:40 UTC (rev 482) @@ -167,10 +167,10 @@ $(AVRDUDE) -p $(MCU) -c jtag2isp -P usb -B 10 -e -U flash:w:$(PROJECT).hex -U eeprom:w:$(PROJECT).eep progisp_bl: $(PROJECT).hex $(PROJECT).eep $(PROJECT)_bl.hex - $(AVRDUDE) -p $(MCU) -c jtag2isp -P usb -B 10 -e -U flash:w:$(PROJECT).hex -U eeprom:w:$(PROJECT).eep -D -U flash:w:$(PROJECT)_bl.hex + $(AVRDUDE) -p $(MCU) -c jtag2isp -P usb -B 10 -e -U flash:w:$(PROJECT)_bl.hex -U eeprom:w:$(PROJECT).eep -D -U flash:w:$(PROJECT).hex progstk: $(PROJECT).hex $(PROJECT).eep $(AVRDUDE) -p $(MCU) -c stk500v2 -e -U flash:w:$(PROJECT).hex -U eeprom:w:$(PROJECT).eep progstk_bl: $(PROJECT).hex $(PROJECT).eep $(PROJECT)_bl.hex - $(AVRDUDE) -p $(MCU) -c stk500v2 -e -U flash:w:$(PROJECT).hex -U eeprom:w:$(PROJECT).eep -D -U flash:w:$(PROJECT)_bl.hex + $(AVRDUDE) -p $(MCU) -c stk500v2 -e -U flash:w:$(PROJECT)_bl.hex -U eeprom:w:$(PROJECT).eep -D -U flash:w:$(PROJECT).hex Modified: firmware/tuxaudio/trunk/init.c =================================================================== --- firmware/tuxaudio/trunk/init.c 2007-09-05 15:04:43 UTC (rev 481) +++ firmware/tuxaudio/trunk/init.c 2007-09-05 15:20:40 UTC (rev 482) @@ -59,7 +59,8 @@ // Port D initialization //PORTD.0 -> OUT IR receiver power - //PORTD.1 -> OUT microphone preamplifier power (PU at beginning the switched to strong 1) + //PORTD.1 -> OUT microphone preamplifier power (PU at beginning then + // switched to strong 1) //PORTD.2 -> IN RF SPI READY //PORTD.3 -> IN RF SPI START //PORTD.4 -> PU CHARGER STATUS Modified: firmware/tuxaudio/trunk/main.c =================================================================== --- firmware/tuxaudio/trunk/main.c 2007-09-05 15:04:43 UTC (rev 481) +++ firmware/tuxaudio/trunk/main.c 2007-09-05 15:20:40 UTC (rev 482) @@ -169,10 +169,6 @@ else unmute_amp(); } - else if (audioBuf[0] == TEST_MODE_CMD) - { - test_mode = audioBuf[2]; /* audio test mode is the second parameter */ - } else if (audioBuf[0] == SLEEP_CMD) { pre_sleep_delay = 30; /* handle sleep in its own function */ @@ -400,57 +396,50 @@ { sampling_pwm = 0x04; /* reinit counter */ - if (test_mode == AT_AUDIOLINK) - { - OCR0B = ADCH; - } - else - { #ifndef MIC_GAIN #define MIC_GAIN 0 /* default value if not declared in the makefile */ #endif #if (MIC_GAIN == 6) - /* MEDIUM GAIN MODE */ - uint8_t tmp; + /* MEDIUM GAIN MODE */ + uint8_t tmp; - tmp = ADCL; - tmp = tmp >> 1; - if (!(ADCH & 0x01)) /* AND the 9th bit then add 0x80 is equivalent to AND the complement of the 9th bit */ - tmp |= 0x80; - pushFifo(&ADCFifo, tmp); - /* HIGH GAIN MODE */ + tmp = ADCL; + tmp = tmp >> 1; + if (!(ADCH & 0x01)) /* AND the 9th bit then add 0x80 is equivalent to AND the complement of the 9th bit */ + tmp |= 0x80; + pushFifo(&ADCFifo, tmp); + /* HIGH GAIN MODE */ #elif (MIC_GAIN == 12) - uint8_t tmp; + uint8_t tmp; - tmp = ADCL + 0x80; - pushFifo(&ADCFifo, tmp); - asm volatile ("lds __tmp_reg__, %0"::"M" (_SFR_MEM_ADDR(ADCH))); /* ADCH needs to be read for the next acquisition */ + tmp = ADCL + 0x80; + pushFifo(&ADCFifo, tmp); + asm volatile ("lds __tmp_reg__, %0"::"M" (_SFR_MEM_ADDR(ADCH))); /* ADCH needs to be read for the next acquisition */ #else /* (MIC_GAIN == 0) or anything else */ - /* LOW GAIN MODE */ - if (ADCH == 0) /* XXX RF looses connection if too much '0' are sent, but the noise should normally be enough to avoid that */ - pushFifo(&ADCFifo, 0x01); - else - pushFifo(&ADCFifo, ADCH); + /* LOW GAIN MODE */ + if (ADCH == 0) /* XXX RF looses connection if too much '0' are sent, but the noise should normally be enough to avoid that */ + pushFifo(&ADCFifo, 0x01); + else + pushFifo(&ADCFifo, ADCH); #endif - if (!popFifo(&PWMFifo, &dataFifo)) /* set the sample value to timer pulse width */ + if (!popFifo(&PWMFifo, &dataFifo)) /* set the sample value to timer pulse width */ + { + OCR0B = dataFifo; + 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) { - OCR0B = dataFifo; - 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(); + if (tuxaudio_config.automute) + mute_amp(); + Fifoinert = 30; + //OCR0A = 250; // Normal operation for ADC sampling if FIFO Adaptative is on } - 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 (--sendSensorsCmpt == 0) sendSensorsFlag = 1; /* send status to the behavioural CPU, 8KHz divided by 256 lead to a status sent each 32ms */ Deleted: firmware/tuxaudio/trunk/test.c =================================================================== --- firmware/tuxaudio/trunk/test.c 2007-09-05 15:04:43 UTC (rev 481) +++ firmware/tuxaudio/trunk/test.c 2007-09-05 15:20:40 UTC (rev 482) @@ -1,76 +0,0 @@ -/* - * TUXAUDIO - Firmware for the 'audio' CPU of tuxdroid - * Copyright (C) 2007 C2ME S.A. <tux...@c2...> - * - * 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 <avr/io.h> -#include "varis.h" -#include "flash.h" - -void testaudio(void) -{ - int i; - unsigned char ad2, ad1, ad0, tmp; - -/* erase_flash (); // Erase flash - program_flash (0x00, 0x00, 0x00, 0x01); // Write first byte of the TOC - program_flash (0x00, 0x00, 0x01, 0x00); // Write speudo TOC for test - program_flash (0x00, 0x00, 0x02, 0x04); - program_flash (0x00, 0x00, 0x03, 0x00); - program_flash (0x00, 0x00, 0x04, 0x00); - program_flash (0x00, 0x00, 0x05, 0x42); - program_flash (0x00, 0x00, 0x06, 0x00); - ad2 = 0x00; // Init sound address - ad1 = 0x04; - ad0 = 0x00; - write_enable (); - PORTB &= ~0x02; // Chip Select - SPDR = 0xAF; // Send Sequencial Program Command - while ((SPSR & 0x80) == 0); // Wait SPI response - SPDR = ad2; // Send Address - while ((SPSR & 0x80) == 0); // Wait SPI response - SPDR = ad1; - while ((SPSR & 0x80) == 0); // Wait SPI response - SPDR = ad0; - 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 - 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 - while ((SPSR & 0x80) == 0); // Wait SPI response - PORTB |= 0x02; // Chip DeselecT - tmp++; - ad0++; // Increment address byte - if (ad0 == 0x00) - { - ad1++; - if (ad1 == 0x00) - ad2++; - } - while (read_status() != 0x10); // Wait Page Program Cycle - } -*/// ATTENTION NE PAS OBUBLIER LE MUTE -} Deleted: firmware/tuxaudio/trunk/test.h =================================================================== --- firmware/tuxaudio/trunk/test.h 2007-09-05 15:04:43 UTC (rev 481) +++ firmware/tuxaudio/trunk/test.h 2007-09-05 15:20:40 UTC (rev 482) @@ -1,27 +0,0 @@ -/* - * TUXAUDIO - Firmware for the 'audio' CPU of tuxdroid - * Copyright (C) 2007 C2ME S.A. <tux...@c2...> - * - * 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: */ - -#ifndef TEST_H -#define TEST_H - -extern void testaudio(void); - -#endif Modified: firmware/tuxaudio/trunk/varis.c =================================================================== --- firmware/tuxaudio/trunk/varis.c 2007-09-05 15:04:43 UTC (rev 481) +++ firmware/tuxaudio/trunk/varis.c 2007-09-05 15:20:40 UTC (rev 482) @@ -71,6 +71,3 @@ volatile unsigned char lockAdaptFifo = 1; volatile unsigned char Fifoinert = 0; - -// Test mode -uint8_t test_mode = 0; Modified: firmware/tuxaudio/trunk/varis.h =================================================================== --- firmware/tuxaudio/trunk/varis.h 2007-09-05 15:04:43 UTC (rev 481) +++ firmware/tuxaudio/trunk/varis.h 2007-09-05 15:20:40 UTC (rev 482) @@ -82,7 +82,4 @@ extern volatile unsigned char Fifoinert; -// Test mode -extern uint8_t test_mode; - #endif Modified: firmware/tuxaudio/trunk/version.h =================================================================== --- firmware/tuxaudio/trunk/version.h 2007-09-05 15:04:43 UTC (rev 481) +++ firmware/tuxaudio/trunk/version.h 2007-09-05 15:20:40 UTC (rev 482) @@ -30,7 +30,7 @@ #define VER_MAJOR 0 #define VER_MINOR 3 -#define VER_UPDATE 0 +#define VER_UPDATE 1 #define AUTHOR_ID 0 /* official release */ |
From: jaguarondi <c2m...@c2...> - 2007-09-05 15:05:14
|
Author: jaguarondi Date: 2007-09-05 17:04:43 +0200 (Wed, 05 Sep 2007) New Revision: 481 Added: firmware/tuxcore/trunk/doc/Doxyfile firmware/tuxcore/trunk/doc/builddoc.sh Removed: firmware/tuxcore/trunk/Doxyfile Modified: firmware/tuxcore/trunk/Makefile Log: * Cleaned the Makefile a bit, moved the doxygen documentation generation to a separate script. This is cleaner as we'll have 2 separate scripts for *nix and Windows. There was also a problem if svnrev.h didn't exist when 'make doc' was called, the version number was not generated correctly (revision part). Now, 'make clean; make doc' works. * Moved Doxyfile to the doc folder. Deleted: firmware/tuxcore/trunk/Doxyfile =================================================================== --- firmware/tuxcore/trunk/Doxyfile 2007-09-05 11:58:09 UTC (rev 480) +++ firmware/tuxcore/trunk/Doxyfile 2007-09-05 15:04:43 UTC (rev 481) @@ -1,1277 +0,0 @@ -# Doxyfile 1.5.2 - Doxygen configuration file for TUXCORE -# -# TUXCORE - Firmware for the 'core' CPU of tuxdroid -# Copyright (C) 2007 C2ME S.A. <tux...@c2...> -# -# 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:$ - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project -# -# All text after a hash (#) is considered a comment and will be ignored -# The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" ") - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the config file that -# follow. The default is UTF-8 which is also the encoding used for all text before -# the first occurrence of this tag. Doxygen uses libiconv (or the iconv built into -# libc) for the transcoding. See http://www.gnu.org/software/libiconv for the list of -# possible encodings. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded -# by quotes) that should identify the project. - -PROJECT_NAME = tuxcore - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or -# if some version control system is used. - -PROJECT_NUMBER = $(VERSION) - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location -# where doxygen was started. If left blank the current directory will be used. - -OUTPUT_DIRECTORY = doc - -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create -# 4096 sub-directories (in 2 levels) under the output directory of each output -# format and will distribute the generated files over these directories. -# Enabling this option can be useful when feeding doxygen a huge amount of -# source files, where putting all generated files in the same directory would -# otherwise cause performance problems for the file system. - -CREATE_SUBDIRS = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, -# Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hungarian, -# Italian, Japanese, Japanese-en (Japanese with English messages), Korean, -# Korean-en, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian, -# Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is -# used as the annotated text. Otherwise, the brief description is used as-is. -# If left blank, the following values are used ("$name" is automatically -# replaced with the name of the entity): "The $name class" "The $name widget" -# "The $name file" "is" "provides" "specifies" "contains" -# "represents" "a" "an" "the" - -ABBREVIATE_BRIEF = - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief -# description. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. - -FULL_PATH_NAMES = YES - -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the -# path to strip. - -STRIP_FROM_PATH = - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of -# the path mentioned in the documentation of a class, which tells -# the reader which header file to include in order to use a class. -# If left blank only the name of the header file containing the class -# definition is used. Otherwise one should specify the include paths that -# are normally passed to the compiler using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful is your file systems -# doesn't support long names like on DOS, Mac, or CD-ROM. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like the Qt-style comments (thus requiring an -# explicit @brief command for a brief description. - -JAVADOC_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the DETAILS_AT_TOP tag is set to YES then Doxygen -# will output the detailed description near the top, like JavaDoc. -# If set to NO, the detailed description appears after the member -# documentation. - -DETAILS_AT_TOP = NO - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce -# a new page for each member. If set to NO, the documentation of a member will -# be part of the file/class/namespace that contains it. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. - -TAB_SIZE = 4 - -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". -# You can put \n's in the value part of an alias to insert newlines. - -ALIASES = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C -# sources only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. - -OPTIMIZE_OUTPUT_FOR_C = YES - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java -# sources only. Doxygen will then generate output that is more tailored for Java. -# For instance, namespaces will be presented as packages, qualified scopes -# will look different, etc. - -OPTIMIZE_OUTPUT_JAVA = NO - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to -# include (a tag file for) the STL sources as input, then you should -# set this tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. -# func(std::string) {}). This also make the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. - -BUILTIN_STL_SUPPORT = NO - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. - -CPP_CLI_SUPPORT = NO - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. - -DISTRIBUTE_GROUP_DOC = NO - -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using -# the \nosubgrouping command. - -SUBGROUPING = YES - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES - -EXTRACT_ALL = YES - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. - -EXTRACT_PRIVATE = NO - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -EXTRACT_STATIC = NO - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. - -EXTRACT_LOCAL_CLASSES = YES - -# This flag is only useful for Objective-C code. When set to YES local -# methods, which are defined in the implementation section but not in -# the interface are included in the documentation. -# If set to NO (the default) only methods in the interface are included. - -EXTRACT_LOCAL_METHODS = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the -# documentation. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the -# function's detailed documentation block. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. - -CASE_SENSE_NAMES = YES - -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. - -SHOW_INCLUDE_FILES = YES - -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in -# declaration order. - -SORT_BRIEF_DOCS = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the -# alphabetical list. - -SORT_BY_SCOPE_NAME = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or define consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and defines in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. - -SHOW_USED_FILES = YES - -# If the sources in your project are distributed over multiple directories -# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy -# in the documentation. The default is NO. - -SHOW_DIRECTORIES = NO - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from the -# version control system). Doxygen will invoke the program by executing (via -# popen()) the command <command> <input-file>, where <command> is the value of -# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file -# provided by doxygen. Whatever the program writes to standard output -# is used as the file version. See the manual for examples. - -FILE_VERSION_FILTER = - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. - -WARNINGS = YES - -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. - -WARN_IF_UNDOCUMENTED = YES - -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that -# don't exist or using markup commands wrongly. - -WARN_IF_DOC_ERROR = YES - -# This WARN_NO_PARAMDOC option can be abled to get warnings for -# functions that are documented, but have no documentation for their parameters -# or return value. If set to NO (the default) doxygen will only warn about -# wrong or incomplete parameter documentation, but not about the absence of -# documentation. - -WARN_NO_PARAMDOC = NO - -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. Optionally the format may contain -# $version, which will be replaced by the version of the file (if it could -# be obtained via FILE_VERSION_FILTER) - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written -# to stderr. - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. - -INPUT = - -# This tag can be used to specify the character encoding of the source files that -# doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default -# input encoding. Doxygen uses libiconv (or the iconv built into libc) for the transcoding. -# See http://www.gnu.org/software/libiconv for the list of possible encodings. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx -# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py - -FILE_PATTERNS = - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. - -RECURSIVE = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used select whether or not files or -# directories that are symbolic links (a Unix filesystem feature) are excluded -# from the input. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. Note that the wildcards are matched -# against the file with absolute path, so to exclude all test directories -# for example use the pattern */test/* - -EXCLUDE_PATTERNS = */.svn/* */dep/* - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the output. -# The symbol name can be a fully qualified name, a word, or if the wildcard * is used, -# a substring. Examples: ANamespace, AClass, AClass::ANamespace, ANamespace::*Test - -EXCLUDE_SYMBOLS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. - -EXAMPLE_PATTERNS = - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). - -IMAGE_PATH = doc - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command <filter> <input-file>, where <filter> -# is the value of the INPUT_FILTER tag, and <input-file> is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. If FILTER_PATTERNS is specified, this tag will be -# ignored. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. The filters are a list of the form: -# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further -# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER -# is applied to all files. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). - -FILTER_SOURCE_FILES = NO - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. - -SOURCE_BROWSER = YES - -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C and C++ comments will always remain visible. - -STRIP_CODE_COMMENTS = NO - -# If the REFERENCED_BY_RELATION tag is set to YES (the default) -# then for each documented function all documented -# functions referencing it will be listed. - -REFERENCED_BY_RELATION = YES - -# If the REFERENCES_RELATION tag is set to YES (the default) -# then for each documented function all documented entities -# called/used by that function will be listed. - -REFERENCES_RELATION = YES - -# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) -# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from -# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will -# link to the source code. Otherwise they will link to the documentstion. - -REFERENCES_LINK_SOURCE = YES - -# If the USE_HTAGS tag is set to YES then the references to source code -# will point to the HTML generated by the htags(1) tool instead of doxygen -# built-in source browser. The htags tool is part of GNU's global source -# tagging system (see http://www.gnu.org/software/global/global.html). You -# will need version 4.8.6 or higher. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. - -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. - -ALPHABETICAL_INDEX = NO - -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that -# should be ignored while generating the index headers. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `html' will be used as the default path. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a -# standard header. - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. - -HTML_FOOTER = - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own -# stylesheet in the HTML output directory as well, or it will be erased! - -HTML_STYLESHEET = - -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to -# NO a bullet list will be used. - -HTML_ALIGN_MEMBERS = YES - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) -# of the generated HTML documentation. - -GENERATE_HTMLHELP = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be -# written to the html output directory. - -CHM_FILE = - -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. - -HHC_LOCATION = - -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that -# it should be included in the master .chm file (NO). - -GENERATE_CHI = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. - -TOC_EXPAND = NO - -# The DISABLE_INDEX tag can be used to turn on/off the condensed index at -# top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. - -DISABLE_INDEX = NO - -# This tag can be used to set the number of enum values (range [1..20]) -# that doxygen will group on one line in the generated HTML documentation. - -ENUM_VALUES_PER_LINE = 4 - -# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be -# generated containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, -# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are -# probably better off using the HTML help feature. - -GENERATE_TREEVIEW = NO - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree -# is shown. - -TREEVIEW_WIDTH = 250 - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will -# generate Latex output. - -GENERATE_LATEX = NO - -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `latex' will be used as the default path. - -LATEX_OUTPUT = latex - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be -# invoked. If left blank `latex' will be used as the default command name. - -LATEX_CMD_NAME = latex - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the -# default command name. - -MAKEINDEX_CMD_NAME = makeindex - -# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact -# LaTeX documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_LATEX = NO - -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, a4wide, letter, legal and -# executive. If left blank a4wide will be used. - -PAPER_TYPE = a4wide - -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX -# packages that should be included in the LaTeX output. - -EXTRA_PACKAGES = - -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for -# the generated latex document. The header should contain everything until -# the first chapter. If it is left blank doxygen will generate a -# standard header. Notice: only use this tag if you know what you are doing! - -LATEX_HEADER = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references -# This makes the output suitable for online browsing using a pdf viewer. - -PDF_HYPERLINKS = NO - -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a -# higher quality PDF documentation. - -USE_PDFLATEX = NO - -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. -# command to the generated LaTeX files. This will instruct LaTeX to keep -# running if errors occur, instead of asking the user for help. -# This option is also used when generating formulas in HTML. - -LATEX_BATCHMODE = NO - -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) -# in the output. - -LATEX_HIDE_INDICES = NO - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- - -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimized for Word 97 and may not look very pretty with -# other RTF readers or editors. - -GENERATE_RTF = NO - -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `rtf' will be used as the default path. - -RTF_OUTPUT = rtf - -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_RTF = NO - -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. -# Note: wordpad (write) and others do not support links. - -RTF_HYPERLINKS = NO - -# Load stylesheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assignments. You only have to provide -# replacements, missing definitions are set to their default value. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an rtf document. -# Syntax is similar to doxygen's config file. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will -# generate man pages - -GENERATE_MAN = NO - -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `man' will be used as the default path. - -MAN_OUTPUT = man - -# The MAN_EXTENSION tag determines the extension that is added to -# the generated man pages (default is the subroutine's section .3) - -MAN_EXTENSION = .3 - -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command -# would be unable to find the correct page. The default is NO. - -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- - -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of -# the code including all documentation. - -GENERATE_XML = NO - -# The XML_OUTPUT tag is used to specify where the XML pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `xml' will be used as the default path. - -XML_OUTPUT = xml - -# The XML_SCHEMA tag can be used to specify an XML schema, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify an XML DTD, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_DTD = - -# If the XML_PROGRAMLISTING tag is set to YES Doxygen will -# dump the program listings (including syntax highlighting -# and cross-referencing information) to the XML output. Note that -# enabling this will significantly increase the size of the XML output. - -XML_PROGRAMLISTING = YES - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental -# and incomplete at the moment. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# If the GENERATE_PERLMOD tag is set to YES Doxygen will -# generate a Perl module file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the -# moment. - -GENERATE_PERLMOD = NO - -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate -# the necessary Makefile rules, Perl scripts and LaTeX code to be able -# to generate PDF and DVI output from the Perl module output. - -PERLMOD_LATEX = NO - -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be -# nicely formatted so it can be parsed by a human reader. This is useful -# if you want to understand what is going on. On the other hand, if this -# tag is set to NO the size of the Perl module output will be much smaller -# and Perl will parse it just the same. - -PERLMOD_PRETTY = YES - -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the same -# Makefile don't overwrite each other's variables. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include -# files. - -ENABLE_PREPROCESSING = YES - -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled -# way by setting EXPAND_ONLY_PREDEF to YES. - -MACRO_EXPANSION = NO - -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the -# PREDEFINED and EXPAND_AS_DEFINED tags. - -EXPAND_ONLY_PREDEF = NO - -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# in the INCLUDE_PATH (see below) will be search if a #include is found. - -SEARCH_INCLUDES = YES - -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by -# the preprocessor. - -INCLUDE_PATH = - -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will -# be used. - -INCLUDE_FILE_PATTERNS = - -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. To prevent a macro definition from being -# undefined via #undef or recursively expanded use the := operator -# instead of the = operator. - -PREDEFINED = - -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. -# Use the PREDEFINED tag if you want to use a different macro definition. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all function-like macros that are alone -# on a line, have an all uppercase name, and do not end with a semicolon. Such -# function macros are typically used for boiler-plate code, and will confuse -# the parser if not removed. - -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES option can be used to specify one or more tagfiles. -# Optionally an initial location of the external documentation -# can be added for each tagfile. The format of a tag file without -# this location is as follows: -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where "loc1" and "loc2" can be relative or absolute paths or -# URLs. If a location is present for each tag, the installdox tool -# does not have to be run to correct the links. -# Note that each tag file must have a unique name -# (where the name does NOT include the path) -# If a tag file is not located in the directory in which doxygen -# is run, you must also specify the path to the tagfile here. - -TAGFILES = - -# When a file name is specified after GENERATE_TAGFILE, doxygen will create -# a tag file that is based on the input files it reads. - -GENERATE_TAGFILE = - -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes -# will be listed. - -ALLEXTERNALS = NO - -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will -# be listed. - -EXTERNAL_GROUPS = YES - -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of `which perl'). - -PERL_PATH = /usr/bin/perl - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base -# or super classes. Setting the tag to NO turns the diagrams off. Note that -# this option is superseded by the HAVE_DOT option below. This is only a -# fallback. It is recommended to install and use dot, since it yields more -# powerful graphs. - -CLASS_DIAGRAMS = YES - -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see http://www.mcternan.me.uk/mscgen/) to -# produce the chart and insert it in the documentation. The MSCGEN_PATH tag allows you to -# specify the directory where the mscgen tool resides. If left empty the tool is assumed to -# be found in the default search path. - -MSCGEN_PATH = - -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented -# or is not a class. - -HIDE_UNDOC_RELATIONS = YES - -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section -# have no effect if this option is set to NO (the default) - -HAVE_DOT = NO - -# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect inheritance relations. Setting this tag to YES will force the -# the CLASS_DIAGRAMS tag to NO. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and -# class references variables) of the class with other documented classes. - -COLLABORATION_GRAPH = YES - -# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for groups, showing the direct groups dependencies - -GROUP_GRAPHS = YES - -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similar to the OMG's Unified Modeling -# Language. - -UML_LOOK = NO - -# If set to YES, the inheritance and collaboration graphs will show the -# relations between templates and their instances. - -TEMPLATE_RELATIONS = NO - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with -# other documented files. - -INCLUDE_GRAPH = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or -# indirectly include this file. - -INCLUDED_BY_GRAPH = YES - -# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will -# generate a call dependency graph for every global function or class method. -# Note that enabling this option will significantly increase the time of a run. -# So in most cases it will be better to enable call graphs for selected -# functions only using the \callgraph command. - -CALL_GRAPH = NO - -# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then doxygen will -# generate a caller dependency graph for every global function or class method. -# Note that enabling this option will significantly increase the time of a run. -# So in most cases it will be better to enable caller graphs for selected -# functions only using the \callergraph command. - -CALLER_GRAPH = NO - -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen -# will graphical hierarchy of all classes instead of a textual one. - -GRAPHICAL_HIERARCHY = YES - -# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES -# then doxygen will show the dependencies a directory has on other directories -# in a graphical way. The dependency relations are determined by the #include -# relations between the files in the directories. - -DIRECTORY_GRAPH = YES - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are png, jpg, or gif -# If left blank png will be used. - -DOT_IMAGE_FORMAT = png - -# The tag DOT_PATH can be used to specify the path where the dot tool can be -# found. If left blank, it is assumed the dot tool can be found in the path. - -DOT_PATH = - -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the -# \dotfile command). - -DOTFILE_DIRS = - -# The MAX_DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of -# nodes that will be shown in the graph. If the number of nodes in a graph -# becomes larger than this value, doxygen will truncate the graph, which is -# visualized by representing a node as a red box. Note that doxygen will always -# show the root nodes and its direct children regardless of this setting. - -DOT_GRAPH_MAX_NODES = 50 - -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, which results in a white background. -# Warning: Depending on the platform used, enabling this option may lead to -# badly anti-aliased labels on the edges of a graph (i.e. they become hard to -# read). - -DOT_TRANSPARENT = NO - -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output -# files in one run (i.e. multiple -o and -T options on the command line). This -# makes dot run faster, but since only newer versions of dot (>1.8.10) -# support this, this feature is disabled by default. - -DOT_MULTI_TARGETS = NO - -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and -# arrows in the dot generated graphs. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate -# the various graphs. - -DOT_CLEANUP = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to the search engine -#--------------------------------------------------------------------------- - -# The SEARCHENGINE tag specifies whether or not a search engine should be -# used. If set to NO the values of all tags below this one will be ignored. - -SEARCHENGINE = NO Modified: firmware/tuxcore/trunk/Makefile =================================================================== --- firmware/tuxcore/trunk/Makefile 2007-09-05 11:58:09 UTC (rev 480) +++ firmware/tuxcore/trunk/Makefile 2007-09-05 15:04:43 UTC (rev 481) @@ -18,7 +18,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# $Id:$ +# $Id$ ## General Flags PROJECT = tuxcore @@ -85,14 +85,14 @@ HEX_EEPROM_FLAGS += --set-section-flags=.eeprom="alloc,load" HEX_EEPROM_FLAGS += --change-section-lma .eeprom=0 +## All source and header files +CSOURCE = $(wildcards *.c) +HEADERS = $(wildcards *.h) ## 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 explicitly added by the user -LINKONLYOBJECTS = - ## Build all: svnrev.h $(TARGET) tuxcore.hex tuxcore.eep tuxcore.lss size boot: $(BOOTLOADER) tuxcore_bl.hex tuxcore_bl.lss bl_size @@ -137,9 +137,20 @@ standalone.o: standalone.c $(CC) $(INCLUDES) $(CFLAGS) -c $< +## Generate SVN info +# We need to change the status each time a file changes, thus so many +# dependencies +svnrev.h: $(CSOURCE) $(HEADERS) + +ifdef windir + SubWCRev . svnrev.tmpl.h svnrev.h +else + svnwcrev . svnrev.tmpl.h svnrev.h +endif + ##Link $(TARGET): $(OBJECTS) - $(CC) $(LDFLAGS) $(OBJECTS) $(LINKONLYOBJECTS) $(LIBDIRS) $(LIBS) \ + $(CC) $(LDFLAGS) $(OBJECTS) $(LIBDIRS) $(LIBS) \ -o $(TARGET) $(BOOTLOADER): bootloader.o @@ -170,19 +181,10 @@ @avr-size ${BOOTLOADER} endif -## Generate SVN info -.PHONY: svnrev.h -svnrev.h: -ifdef windir - SubWCRev . svnrev.tmpl.h svnrev.h -else - svnwcrev . svnrev.tmpl.h svnrev.h -endif - ## Clean target .PHONY: clean clean: - -rm -rf $(OBJECTS) svnrev.h tuxcore.elf dep/* tuxcore.hex tuxcore.eep \ + -rm -rf $(OBJECTS) svnrev.h tuxcore.elf dep tuxcore.hex tuxcore.eep \ tuxcore.lss tuxcore.map bootloader.o tuxcore_bl.hex tuxcore_bl.lss \ tuxcore_bl.map tuxcore_bl.elf svnrev.h dep @@ -192,20 +194,12 @@ ## Generate doxygen documentation .PHONY: doc -REVISION = $(shell sed -n "s/\#define SVN_REV\> *//p" svnrev.h) -URL = $(shell sed -n "s/\#define SVN_URL\> *//p" svnrev.h) -# if we're in a tag folder, we don't show 'UNRELEASED' -ifeq ($(shell sed -n "s/\#define SVN_URL\> *//p" svnrev.h | grep tags),) - UNRELEASED = "UNRELEASED " +doc: svnrev.h +ifdef windir + # XXX add windows version +else + @./doc/builddoc.sh endif -VERSION_MAJ = $(shell sed -n "s/\#define VER_MAJOR *//p" version.h) -VERSION_MIN = $(shell sed -n "s/\#define VER_MINOR *//p" version.h) -VERSION_UP = $(shell sed -n "s/\#define VER_UPDATE *//p" version.h) -doc: export VERSION = "Version $(VERSION_MAJ).$(VERSION_MIN).$(VERSION_UP)\ - $(UNRELEASED)(Revision $(REVISION))" -doc: svnrev.h version.h - @echo "Generating documentation for tuxcore" $(VERSION) - doxygen ./Doxyfile # Programming prog: $(PROJECT).hex Copied: firmware/tuxcore/trunk/doc/Doxyfile (from rev 479, firmware/tuxcore/trunk/Doxyfile) =================================================================== --- firmware/tuxcore/trunk/doc/Doxyfile (rev 0) +++ firmware/tuxcore/trunk/doc/Doxyfile 2007-09-05 15:04:43 UTC (rev 481) @@ -0,0 +1,1277 @@ +# Doxyfile 1.5.2 - Doxygen configuration file for TUXCORE +# +# TUXCORE - Firmware for the 'core' CPU of tuxdroid +# Copyright (C) 2007 C2ME S.A. <tux...@c2...> +# +# 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:$ + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project +# +# All text after a hash (#) is considered a comment and will be ignored +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" ") + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file that +# follow. The default is UTF-8 which is also the encoding used for all text before +# the first occurrence of this tag. Doxygen uses libiconv (or the iconv built into +# libc) for the transcoding. See http://www.gnu.org/software/libiconv for the list of +# possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. + +PROJECT_NAME = tuxcore + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = $(VERSION) + +# The OUTPUT_DIRECTORY t... [truncated message content] |