[tuxdroid-svn] r496 - firmware/tuxaudio/trunk
Status: Beta
Brought to you by:
ks156
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 |