bool IRAM_ATTR tud_audio_rx_done_isr(uint8_t rhport, uint16_t n_bytes_received, uint8_t func_id, uint8_t ep_out, uint8_t cur_alt_setting) { size_t got = 0; // Safety for unexpected 0-byte packets (should not happen under SOF rules) if (n_bytes_received > 0) { got = tud_audio_n_read(0, g_pcm_buf, n_bytes_received>(g_ddc.uac_quality.frame_size<<UAC_BUFFER_STROKESIZE)?(g_ddc.uac_quality.frame_size<<UAC_BUFFER_STROKESIZE):n_bytes_received); if (got > 0) { // Do not write empty packets into the ring buffer rb_write(&g_audio_ring, g_pcm_buf, got); } } g_ddc.ddc_rx_size = got;#if DDC_LOG == 1 static usb_packet_log_t uac_log; uac_log.nsamples = got; uac_log.ring_level = rb_available(&g_audio_ring); usb_packet_log_write(&uac_log);#endif return true;}