Big Mouth Billy Bass player that takes raw wavefiles and decision list text files from an SD card

Dependencies:   SDFileSystem mbed BillyBass

Files at this revision

API Documentation at this revision

Comitter:
bikeNomad
Date:
Tue Jun 18 13:11:31 2013 +0000
Parent:
10:a02fdcfd9ef1
Child:
12:1206e56712d8
Commit message:
got first song working; added inversion of BB outputs; still running out of memory.

Changed in this revision

BillyBass.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/BillyBass.lib	Tue Jun 18 06:13:40 2013 +0000
+++ b/BillyBass.lib	Tue Jun 18 13:11:31 2013 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/bikeNomad/code/BillyBass/#eaba75af0f0d
+http://mbed.org/users/bikeNomad/code/BillyBass/#6c91a6232c4a
--- a/main.cpp	Tue Jun 18 06:13:40 2013 +0000
+++ b/main.cpp	Tue Jun 18 13:11:31 2013 +0000
@@ -8,8 +8,8 @@
 // Power GND  J9/14
 // Vin (6V)   J9/16
 
-//                 tailPin,  mouthPin, bodyPin
-BillyBass testBass(LED_RED, LED_GREEN, LED_BLUE);
+//                 tailPin,  mouthPin, bodyPin   inverted
+BillyBass testBass(LED_RED, LED_GREEN, LED_BLUE, true);
 
 //               tailPin, mouthPin, bodyPin
 //                  J3/2,  J3/1, J3/3
@@ -32,7 +32,7 @@
 
 Serial pc(USBTX, USBRX);
 
-void biggestAllocation()
+static void biggestAllocation()
 {
     size_t blksize = 16384;
     char *m;
@@ -51,7 +51,7 @@
     free(m);
 }
 
-void dumpHeap()
+static void dumpHeap()
 {
     biggestAllocation();
     __heapstats((__heapprt)fprintf,stderr);
@@ -75,12 +75,15 @@
     }
 
     while (dirent *d = readdir(bassDir)) {
+    dumpHeap();
         Song *song = Song::newSong(d->d_name);
         if (song) {
+        dumpHeap();
             pc.printf("Playing %s\r\n", song->getSampleFileName());
             player.playEntireSong(song);
             pc.printf("total length: %f done: %u\r\n", player.timeInSong, player.actionsDone);
             delete song;
+            dumpHeap();
         }
     }