From fefa4f0e4592b8fb235d38e60fb5daea4974ff95 Mon Sep 17 00:00:00 2001 From: Martin Ling Date: Sat, 22 Oct 2022 13:47:06 +0100 Subject: [PATCH] Reduce firmware USB transfer size from 16KB to 8KB. --- firmware/hackrf_usb/usb_api_transceiver.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/firmware/hackrf_usb/usb_api_transceiver.c b/firmware/hackrf_usb/usb_api_transceiver.c index 28958001..18a08938 100644 --- a/firmware/hackrf_usb/usb_api_transceiver.c +++ b/firmware/hackrf_usb/usb_api_transceiver.c @@ -45,7 +45,7 @@ #include "usb_endpoint.h" #include "usb_api_sweep.h" -#define USB_TRANSFER_SIZE 0x4000 +#define USB_TRANSFER_SIZE 0x2000 typedef struct { uint32_t freq_mhz; @@ -451,7 +451,8 @@ void tx_mode(uint32_t seq) baseband_streaming_enable(&sgpio_config); started = true; } - if ((usb_count - m0_state.m0_count) <= USB_TRANSFER_SIZE) { + if ((usb_count - m0_state.m0_count) <= + (USB_BULK_BUFFER_SIZE - USB_TRANSFER_SIZE)) { usb_transfer_schedule_block( &usb_endpoint_bulk_out, &usb_bulk_buffer[usb_count & USB_BULK_BUFFER_MASK],