streo mp3 player see: http://mbed.org/users/okini3939/notebook/I2S_AUDIO

Dependencies:   FatFileSystemCpp I2SSlave TLV320 mbed

Fork of madplayer by Andreas Grün

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers lpc1768_mem.cpp Source File

lpc1768_mem.cpp

00001 #include "mbed.h"
00002 #include "config.h"
00003 
00004 static char *free_ptr = (char *)AHBMEM;
00005 static int free_sz = AHBMEMSIZE;
00006 void reset_ahb_mem(void)
00007  {
00008    free_ptr = (char *)AHBMEM;
00009    free_sz = AHBMEMSIZE;
00010  }
00011 void *mad_malloc(unsigned int sz)
00012 {
00013   unsigned int nsz = ((sz >> 3) + 1) << 3; // align to 8 byte
00014   if(nsz < free_sz)
00015   {
00016     char *p = free_ptr;
00017     free_ptr += nsz;
00018     free_sz -=nsz;
00019     return(p);
00020   }
00021   else
00022   {
00023     return(malloc(sz));
00024   }
00025 }