Toyomasa Watarai / Mbed 2 deprecated eVY1_SMF_player_mod

Dependencies:   DirectoryList SDFileSystem mbed

Fork of eVY1_SMF_player by Toyomasa Watarai

Files at this revision

API Documentation at this revision

Comitter:
MACRUM
Date:
Mon Jan 04 08:21:32 2016 +0000
Parent:
1:c536df09d2e8
Child:
3:2a58b7f4b0cb
Commit message:
Add WIZwiki-W7500P platform support

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Mon Jul 20 09:06:05 2015 +0000
+++ b/main.cpp	Mon Jan 04 08:21:32 2016 +0000
@@ -34,6 +34,14 @@
 #undef _DEBUG
 #endif
 
+#elif defined(TARGET_WIZWIKI_W7500P)
+SDFileSystem sd(PB_3, PB_2, PB_1, PB_0, "sd"); // MOSI, MISO, SCK, CS
+RawSerial midi(D1, NC);
+InterruptIn btn(PC_6);
+#if defined(_DEBUG)
+#undef _DEBUG
+#endif
+
 #endif
 
 #ifdef _DEBUG
@@ -170,6 +178,16 @@
     TIMER = 0;
     tempo = 500; // default value
 
+    uint32_t ch;
+    for (ch=0; ch<16; ch++) {
+        midi.putc(0xB0|ch);
+        midi.putc(0x78);
+        midi.putc(0x00);
+        midi.putc(0xB0|ch);
+        midi.putc(0x79);
+        midi.putc(0x00);
+    }
+
     // Skip MIDI header
     for (uint32_t i=0; i<8; i++) {
         midi_read();
@@ -179,12 +197,10 @@
     format = (midi_read() << 8);
     format |= midi_read();
 
-    if ( format > 2) {
-        DEBUG_PRINT("This is not a MIDI format file!\n", format);
+    if ( format > 1) {
+        DEBUG_PRINT("This is not a MIDI format 0 file!\n", format);
         STATE = 2;
         return;
-    } else {
-        DEBUG_PRINT("MIDI format : %d\n", format);
     }
 
     uint32_t track;
--- a/mbed.bld	Mon Jul 20 09:06:05 2015 +0000
+++ b/mbed.bld	Mon Jan 04 08:21:32 2016 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/da0ca467f8b5
\ No newline at end of file
+http://mbed.org/users/mbed_official/code/mbed/builds/4336505e4b1c
\ No newline at end of file