Add the RTOS processing. for the Network radio streaming receiver.

Fork of VS1053b by Christian Schmiljun

Revision:
8:5e4a21202223
Parent:
6:eed008905159
Child:
10:114ac02a3875
--- a/VS1053.cpp	Sat Jan 08 16:36:00 2011 +0000
+++ b/VS1053.cpp	Wed Jan 12 18:30:28 2011 +0000
@@ -48,7 +48,7 @@
  * =================================================================*/
 VS1053::VS1053(
     PinName mosi, PinName miso, PinName sck, PinName cs, PinName rst,
-    PinName dreq, PinName dcs)
+    PinName dreq, PinName dcs, char* buffer, int buffer_size)
         :
         _spi(mosi, miso, sck),
         _CS(cs),
@@ -63,11 +63,14 @@
         _sb_freqlimit = DEFAULT_BASS_FREQUENCY;
         _st_amplitude = DEFAULT_TREBLE_AMPLITUDE;
         _st_freqlimit = DEFAULT_TREBLE_FREQUENCY;   
+        _buffer = buffer;
+        BUFFER_SIZE = buffer_size;
         _DREQ_INTERUPT_IN.mode(PullDown);
         INTERRUPT_HANDLER_DISABLE;
         bufferReset();
 }
 
+
 /*===================================================================
  * Functions
  *==================================================================*/
@@ -492,6 +495,11 @@
 /*===================================================================
  * Buffer handling
  *==================================================================*/
+ 
+unsigned int VS1053::bufferLength(void)
+{
+    return BUFFER_SIZE; 
+} 
 
 unsigned char VS1053::bufferGetByte(void)
 {    
@@ -507,7 +515,7 @@
     return retVal;
 }
 
-bool VS1053::bufferSetByte(unsigned char c)
+bool VS1053::bufferSetByte(char c)
 {
     if (bufferFree() > 0x00)
     {        
@@ -521,7 +529,7 @@
     return false;
 }
 
-bool VS1053::bufferPutStream(const unsigned char *s, unsigned int length)
+bool VS1053::bufferPutStream(const char *s, unsigned int length)
 {
     if (bufferFree() >= length)
     {
@@ -745,4 +753,4 @@
     retVal->decodeTime = sci_read(SCI_DECODE_TIME);    
     DEBUGOUT("VS1053b:  Decodetime: %i s\r\n", retVal->decodeTime);
                   
-}
\ No newline at end of file
+}