Suga koubou / Mbed 2 deprecated i2s_audio_madplayer

Dependencies:   FatFileSystemCpp I2SSlave TLV320 mbed

Fork of madplayer by Andreas Grün

Revision:
2:f28cf0afd021
diff -r 7c923cbe9f1d -r f28cf0afd021 lpc1768_mem.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lpc1768_mem.cpp	Sat Nov 27 17:27:33 2010 +0000
@@ -0,0 +1,25 @@
+#include "mbed.h"
+#include "config.h"
+
+static char *free_ptr = (char *)AHBMEM;
+static int free_sz = AHBMEMSIZE;
+void reset_ahb_mem(void)
+ {
+   free_ptr = (char *)AHBMEM;
+   free_sz = AHBMEMSIZE;
+ }
+void *mad_malloc(unsigned int sz)
+{
+  unsigned int nsz = ((sz >> 3) + 1) << 3; // align to 8 byte
+  if(nsz < free_sz)
+  {
+    char *p = free_ptr;
+	free_ptr += nsz;
+	free_sz -=nsz;
+	return(p);
+  }
+  else
+  {
+    return(malloc(sz));
+  }
+}