Author: jaguarondi
Date: 2008-07-16 10:26:54 +0200 (Wed, 16 Jul 2008)
New Revision: 1329

Modified:
   firmware/tuxaudio/trunk/PC_communication.c
Log:
* Dirty hack when an ACK is never received, resend the command. This problem
  doesn't seem to appear with the new RF so this is just a temporary solution.


Modified: firmware/tuxaudio/trunk/PC_communication.c
===================================================================
--- firmware/tuxaudio/trunk/PC_communication.c  2008-07-16 08:14:37 UTC (rev 
1328)
+++ firmware/tuxaudio/trunk/PC_communication.c  2008-07-16 08:26:54 UTC (rev 
1329)
@@ -54,6 +54,7 @@
                 spi_ready = 0;
                 if (spi_slave == HEADERS)
                 {
+                    uint8_t static force_resend = 0;
                     /* Sound */
                     if (FifoLength(ADCFifo) >= 17)
                         spi_headerb = 0x02;     /* frame will contain sound */
@@ -67,8 +68,18 @@
                         spi_headerb |= 0x08;    /* resend the previous status 
if nacked */
                     }
                     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 */
+                    }
+                    else
+                    {
+                        if (++force_resend == 20)
+                        {
+                            force_resend = 0;
+                            spi_headerb |= 0x08;    /* resend the previous 
status if nacked */
+                        }
+                    }
 
                     SPDR = spi_headerb; // Header byte
                     spi_slave = GET_SOUND_FIFO; // Next state


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to