diff options
| author | hathach <[email protected]> | 2021-04-02 14:43:38 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2021-04-02 14:43:38 +0700 |
| commit | da59c4ad4434b64691aa7a93e03381702633964d (patch) | |
| tree | ffbd2b0bd94124fbee1db634ecfc0a30da688009 /examples | |
| parent | 99b78e62f2172988ffa3835b7d6bcaaf455cef10 (diff) | |
rename midi write()/read() to stream_write() stream_read()
also add deprecated for warning and rename hint
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/device/dynamic_configuration/src/main.c | 6 | ||||
| -rw-r--r-- | examples/device/midi_test/src/main.c | 4 |
2 files changed, 6 insertions, 4 deletions
diff --git a/examples/device/dynamic_configuration/src/main.c b/examples/device/dynamic_configuration/src/main.c index ce1f752d0..4c10f55b0 100644 --- a/examples/device/dynamic_configuration/src/main.c +++ b/examples/device/dynamic_configuration/src/main.c @@ -186,10 +186,12 @@ void midi_task(void) if (previous < 0) previous = sizeof(note_sequence) - 1; // Send Note On for current position at full velocity (127) on channel 1. - tud_midi_write24(cable_num, 0x90 | channel, note_sequence[note_pos], 127); + uint8_t note_on[3] = { 0x90 | channel, note_sequence[note_pos], 127 }; + tud_midi_stream_write(cable_num, note_on, 3); // Send Note Off for previous note. - tud_midi_write24(cable_num, 0x80 | channel, note_sequence[previous], 0); + uint8_t note_off[3] = { 0x80 | channel, note_sequence[previous], 0}; + tud_midi_stream_write(cable_num, note_off, 3); // Increment position note_pos++; diff --git a/examples/device/midi_test/src/main.c b/examples/device/midi_test/src/main.c index af10350df..9e0e82a10 100644 --- a/examples/device/midi_test/src/main.c +++ b/examples/device/midi_test/src/main.c @@ -147,11 +147,11 @@ void midi_task(void) // Send Note On for current position at full velocity (127) on channel 1. uint8_t note_on[3] = { 0x90 | channel, note_sequence[note_pos], 127 }; - tud_midi_write(cable_num, note_on, 3); + tud_midi_stream_write(cable_num, note_on, 3); // Send Note Off for previous note. uint8_t note_off[3] = { 0x80 | channel, note_sequence[previous], 0}; - tud_midi_write(cable_num, note_off, 3); + tud_midi_stream_write(cable_num, note_off, 3); // Increment position note_pos++; |
