samples: usb: uac2: Leave cache management up to drivers

Do not call cache management functions in sample because it does not
work properly if driver uses bounce buffers.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
This commit is contained in:
Tomasz Moń 2025-05-15 12:14:35 +02:00 committed by Fabio Baltieri
parent 9493af937d
commit 810118d2c6
2 changed files with 0 additions and 7 deletions

View File

@ -10,7 +10,6 @@
#include <sample_usbd.h>
#include "feedback.h"
#include <zephyr/cache.h>
#include <zephyr/device.h>
#include <zephyr/usb/usbd.h>
#include <zephyr/usb/class/usbd_uac2.h>
@ -117,7 +116,6 @@ static void uac2_data_recv_cb(const struct device *dev, uint8_t terminal,
*/
size = BLOCK_SIZE;
memset(buf, 0, size);
sys_cache_data_flush_range(buf, size);
}
LOG_DBG("Received %d data to input terminal %d", size, terminal);

View File

@ -10,7 +10,6 @@
#include <sample_usbd.h>
#include "feedback.h"
#include <zephyr/cache.h>
#include <zephyr/device.h>
#include <zephyr/usb/usbd.h>
#include <zephyr/usb/class/usbd_uac2.h>
@ -164,7 +163,6 @@ static void uac2_data_recv_cb(const struct device *dev, uint8_t terminal,
size = SAMPLES_PER_SOF * BYTES_PER_SLOT;
}
memset(buf, 0, size);
sys_cache_data_flush_range(buf, size);
}
LOG_DBG("Received %d data to input terminal %d", size, terminal);
@ -259,7 +257,6 @@ static void process_mic_data(const struct device *dev, struct usb_i2s_ctx *ctx)
/* No data available, I2S will restart soon */
return;
}
sys_cache_data_invd_range(rx_block, num_bytes);
/* I2S operates on 2 channels (stereo) */
rx_samples = num_bytes / (BYTES_PER_SAMPLE * 2);
@ -314,7 +311,6 @@ static void process_mic_data(const struct device *dev, struct usb_i2s_ctx *ctx)
ctx->pending_mic_samples = mic_samples;
return;
}
sys_cache_data_invd_range(rx_block, num_bytes);
src = rx_block;
rx_samples = num_bytes / (BYTES_PER_SAMPLE * 2);
@ -424,7 +420,6 @@ static void process_mic_data(const struct device *dev, struct usb_i2s_ctx *ctx)
}
/* Finally send the microphone samples to host */
sys_cache_data_flush_range(mic_buf, mic_samples * BYTES_PER_SAMPLE);
if (usbd_uac2_send(dev, MICROPHONE_IN_TERMINAL_ID,
mic_buf, mic_samples * BYTES_PER_SAMPLE) < 0) {
k_mem_slab_free(&i2s_rx_slab, mic_buf);