My Fork of F401RE-USBHost. Add USBHostMIDI functions (originaled by Kaoru Shoji http://mbed.org/users/kshoji/code/USBHostMIDI/)

Dependencies:   FATFileSystem

Dependents:   F401RE-USBHostMIDI_RecieveExample

Fork of F401RE-USBHost by Norimasa Okamoto

Revision:
27:23fa4e04b1db
Parent:
26:077ab26227c6
diff -r 077ab26227c6 -r 23fa4e04b1db USBHostMIDI/USBHostMIDI.cpp
--- a/USBHostMIDI/USBHostMIDI.cpp	Thu Sep 18 12:32:33 2014 +0000
+++ b/USBHostMIDI/USBHostMIDI.cpp	Mon Oct 13 19:33:40 2014 +0000
@@ -42,6 +42,23 @@
     midi_intf = -1;
     midi_device_found = false;
     sysExBufferPos = 0;
+    
+    // init callback functions
+    
+    miscellaneousFunctionCode = &callbackDummy3Bytes;
+    cableEvent = callbackDummy3Bytes;
+    systemCommonTwoBytes = &callbackDummy2Bytes;
+    systemCommonThreeBytes = &callbackDummy3Bytes;
+    systemExclusive = &callbackDummysystemExclusive;
+    noteOff = &callbackDummy3Bytes;
+    noteOn = &callbackDummy3Bytes;
+    polyKeyPress = &callbackDummy3Bytes;
+    controlChange = &callbackDummy3Bytes;
+    programChange = &callbackDummy2Bytes;
+    channelPressure = &callbackDummy2Bytes;
+    pitchBend = &callbackDummypitchBend;
+    singleByte = &callbackDummysingleByte;
+    
 }
 
 bool USBHostMIDI::connected()
@@ -333,6 +350,10 @@
     return sendMidiBuffer(15, data, 0, 0);
 }
 
+void callback_dummy(uint8_t firstArg, ...){
+    USB_DBG("Not attached command comming! %d\n", firstArg);
+}
+
 /*virtual*/ void USBHostMIDI::setVidPid(uint16_t vid, uint16_t pid)
 {
     // we don't check VID/PID for this driver