From a6f1318f3e4c27852d6d55dab12d60f992ec420c Mon Sep 17 00:00:00 2001 From: hathach Date: Sat, 18 Mar 2017 17:00:19 +0700 Subject: [PATCH] trigger callback once byte event --- libraries/Bluefruit52Lib/src/services/BLEMidi.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libraries/Bluefruit52Lib/src/services/BLEMidi.cpp b/libraries/Bluefruit52Lib/src/services/BLEMidi.cpp index 258631b0..847365e7 100644 --- a/libraries/Bluefruit52Lib/src/services/BLEMidi.cpp +++ b/libraries/Bluefruit52Lib/src/services/BLEMidi.cpp @@ -194,10 +194,11 @@ void BLEMidi::_write_handler(uint8_t* data, uint16_t len) // write the status or MIDI data to the FIFO _rxd_fifo.write(data++, 1); len--; - - if ( _write_cb ) _write_cb(); } + // Call write callback if configured + if ( _write_cb ) _write_cb(); + #ifdef MIDI_LIB_INCLUDED // read while possible if configured if ( _midilib_obj )