Big Mouth Billy Bass player that takes raw wavefiles and decision list text files from an SD card
Dependencies: SDFileSystem mbed BillyBass
Diff: main.cpp
- Revision:
- 11:bc25840eca44
- Parent:
- 9:99213347474f
- Child:
- 12:1206e56712d8
--- 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();
}
}
Ned Konz