Author: Paul_R
Date: 2008-06-23 14:32:00 +0200 (Mon, 23 Jun 2008)
New Revision: 1247

Modified:
   firmware/tuxaudio/trunk/flash.c
Log:
* Reset the soundToPlay variable when a invalid play command has been received.


Modified: firmware/tuxaudio/trunk/flash.c
===================================================================
--- firmware/tuxaudio/trunk/flash.c     2008-06-23 11:20:58 UTC (rev 1246)
+++ firmware/tuxaudio/trunk/flash.c     2008-06-23 12:32:00 UTC (rev 1247)
@@ -341,11 +341,13 @@
     if (numSound == 0x00)  /* if unprogrammed we have 0xFF stored in flash */
     {
         flashPlay = 0;
+        soundToPlay = 0;
         return;
     }
     if (!nsound || (nsound > numSound))    /* check the limits */
     {
         flashPlay = 0;
+        soundToPlay = 0;
         return;
     }
 
@@ -387,26 +389,31 @@
     if (ad[0] > TOP_A2)
     {
         flashPlay = 0;
+        soundToPlay = 0;
         return;
     }                  /* don't read outside the flash */
     if (ad[3] > TOP_A2)
     {
         flashPlay = 0;
+        soundToPlay = 0;
         return;
     }                  /* don't read outside the flash */
     if ((ad[0] == 0) && (ad[1] < 0x04))
     {
         flashPlay = 0;
+        soundToPlay = 0;
         return;
     }                  /* minimum index not respected */
     if ((ad[4] == 0) && (ad[5] < 0x04))
     {
         flashPlay = 0;
+        soundToPlay = 0;
         return;
     }    /* minimum index not respected */
     if (ad[3] < ad[0])
     {
         flashPlay = 0;
+        soundToPlay = 0;
         return;
     }    /* check that the stop index is greater than the start index */
     else if (ad[3] == ad[0])
@@ -414,6 +421,7 @@
         if (ad[4] < ad[1])
         {
             flashPlay = 0;
+            soundToPlay = 0;
             return;
         }
         else if (ad[4] == ad[1])
@@ -421,6 +429,7 @@
             if (ad[5] <= ad[2])
             {
                 flashPlay = 0;
+                soundToPlay = 0;
                 return;
             }
         }


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to