Author: jaguarondi
Date: 2008-06-25 10:27:53 +0200 (Wed, 25 Jun 2008)
New Revision: 1263

Modified:
   firmware/tuxaudio/branches/new_rf/communication.c
   firmware/tuxaudio/branches/new_rf/main.c
Log:
* This version works with 16kHz audio. Mic has been disabled for now.


Modified: firmware/tuxaudio/branches/new_rf/communication.c
===================================================================
--- firmware/tuxaudio/branches/new_rf/communication.c   2008-06-24 14:57:55 UTC 
(rev 1262)
+++ firmware/tuxaudio/branches/new_rf/communication.c   2008-06-25 08:27:53 UTC 
(rev 1263)
@@ -333,10 +333,10 @@
 
         /* Limits to avoid oscillations when a lot of frames are
          * dropped and to prevent jumping over 255. */
-        if (OCR0A > 252)
-            OCR0A = 252;
-        if (OCR0A < 246)
-            OCR0A = 246;
+        if (OCR0A > 254)
+            OCR0A = 254;
+        if (OCR0A < 240)
+            OCR0A = 240;
     }
 }
 
@@ -396,19 +396,13 @@
                 if (!parse_cmd(cmd))
                     queue_core_cmd(cmd);
             }
-            if (config & CFG_PREVAUDIO_MK)
-            {
-                for (i=0; i<AUDIO_SIZE; i++)
-                {
-                    FifoPut(PWMFifo, spi_in[i+SPI_PREVAUDIO_OFFSET]);
-                }
-            }
             if (config & CFG_AUDIO_MK)
             {
                 adapt_audio_rate();
 
                 //static uint8_t cnt = 0;
-                for (i=0; i<AUDIO_SIZE; i++)
+                //for (i=0; i<AUDIO_SIZE; i++)
+                for (i=0; i<34; i++)
                 {
                     //if ((spi_in[i+SPI_AUDIO_OFFSET] == (cnt+1)) ||
                         //(spi_in[i+SPI_AUDIO_OFFSET] == (cnt-1)))

Modified: firmware/tuxaudio/branches/new_rf/main.c
===================================================================
--- firmware/tuxaudio/branches/new_rf/main.c    2008-06-24 14:57:55 UTC (rev 
1262)
+++ firmware/tuxaudio/branches/new_rf/main.c    2008-06-25 08:27:53 UTC (rev 
1263)
@@ -250,6 +250,7 @@
                 else
                     DDRD &= ~0x03;
             }
+            /* XXX debug of the audio stack */
             queue_rf_cmd_p(0xFE, FifoLength(PWMFifo), OCR0A, 0);
         }
 
@@ -359,17 +360,12 @@
  */
 ISR(SIG_OVERFLOW0)
 {
-    uint8_t tmp = sampling_pwm;
-
     /* timer 0 is clocked at 32KHz so we divide it by 4 to get 8KHz */
-    tmp--;
-    tmp &= 3;
-    if (tmp == 0)
+    if (++sampling_pwm & 0x01)
     {
         asm("rcall __vector_audio_sampling"::);
         cli();
     }
-    sampling_pwm = tmp;
 }
 
 //ISR(SIG_OVERFLOW0) __attribute__((naked));


-------------------------------------------------------------------------
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