[tuxdroid-svn] r507 - firmware/tuxaudio/branches/audio_cleanup
Status: Beta
Brought to you by:
ks156
From: Paul_R <c2m...@c2...> - 2007-09-10 14:59:49
|
Author: Paul_R Date: 2007-09-10 16:59:45 +0200 (Mon, 10 Sep 2007) New Revision: 507 Modified: firmware/tuxaudio/branches/audio_cleanup/flash.c Log: * Fix a bug in the playing audio functions - When a sound was played from the memory and, at the same time, a programming command was sent, the sound was not correctly stored in the data flash. At the end, the communication between tuxaudio and the RF was killed, and no more commands could not be sent. The only way to restart tux was to reflash tuxaudio firmware... Modified: firmware/tuxaudio/branches/audio_cleanup/flash.c =================================================================== --- firmware/tuxaudio/branches/audio_cleanup/flash.c 2007-09-10 09:25:22 UTC (rev 506) +++ firmware/tuxaudio/branches/audio_cleanup/flash.c 2007-09-10 14:59:45 UTC (rev 507) @@ -77,7 +77,7 @@ if (flash_state) erasingFlash(); - else if (read_status() & BUSY) + else if (!(read_status() & BUSY)) f_state ++; } else if (f_state == FIRST_PROG_STATE) @@ -175,23 +175,46 @@ FLASH_CS_OFF; // Chip Deselect /* Check adresses */ - if (ad[0] > TOP_A2) - return; /* don't read outside the flash */ + if (ad[0] > TOP_A2) + { + flashPlay = 0; + return; + } /* don't read outside the flash */ if (ad[3] > TOP_A2) - return; /* don't read outside the flash */ + { + flashPlay = 0; + return; + } /* don't read outside the flash */ if ((ad[0] == 0) && (ad[1] < 0x04)) - return; /* minimum index not respected */ + { + flashPlay = 0; + return; + } /* minimum index not respected */ if ((ad[4] == 0) && (ad[5] < 0x04)) - return; /* minimum index not respected */ + { + flashPlay = 0; + return; + } /* minimum index not respected */ if (ad[3] < ad[0]) - return; /* check that the stop index is greater than the start index */ + { + flashPlay = 0; + return; + } /* check that the stop index is greater than the start index */ else if (ad[3] == ad[0]) { if (ad[4] < ad[1]) + { + flashPlay = 0; return; + } else if (ad[4] == ad[1]) + { if (ad[5] <= ad[2]) + { + flashPlay = 0; return; + } + } } FLASH_CS_ON; // Chip Select |