Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tud_midi_available() not working #141

Open
nateexptr opened this issue Jun 7, 2023 · 0 comments
Open

tud_midi_available() not working #141

nateexptr opened this issue Jun 7, 2023 · 0 comments

Comments

@nateexptr
Copy link

tud_midi_available() not working

I tried using tusb midi and found that it works fine to sending MIDI message . But when I want to receive the data it doesn't work

till I try to print out the status It's not show anything. While I can still send MIDI message normally.

static void midi_task_read_example(void *arg)
{
// The MIDI interface always creates input and output port/jack descriptors
// regardless of these being used or not. Therefore incoming traffic should be read
// (possibly just discarded) to avoid the sender blocking in IO
uint8_t packet[4];
bool read = false;
for (;;)
{
vTaskDelay(1);
while (tud_midi_available())
{
printf("tud_midi_available\n");
read = tud_midi_packet_read(packet);
if (read)
{

        printf(" Data: %02hhX %02hhX %02hhX %02hhX\n", packet[0], packet[1], packet[2], packet[3]);
        // ESP_LOGI(TAG, "Read - Time (ms since boot): %lld, Data: %02hhX %02hhX %02hhX %02hhX",
        //          esp_timer_get_time(), packet[0], packet[1], packet[2], packet[3]);
    }
}

}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant