aboutsummaryrefslogtreecommitdiffstats
path: root/src/stm32/usbfs.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2019-09-16 19:33:06 -0400
committerKevin O'Connor <kevin@koconnor.net>2019-09-16 19:33:06 -0400
commit4f889ecd9309c5ba619ba95c7c9f0f170f45628f (patch)
treebf75b360da5e3dcbfb0f04b181bd9785606f4c0d /src/stm32/usbfs.c
parent045c938a617c2e174a036d5e0929c6dbe7784061 (diff)
downloadkutter-4f889ecd9309c5ba619ba95c7c9f0f170f45628f.tar.gz
kutter-4f889ecd9309c5ba619ba95c7c9f0f170f45628f.tar.xz
kutter-4f889ecd9309c5ba619ba95c7c9f0f170f45628f.zip
stm32: Fix usbfs rx buffer sizing
The usbfs receive buffers must also have space for the 2 byte crc at the end of a transmission. This fixes an error that could lead to lost messages from mcu to host (resulting in bytes_invalid increasing in stats) on the stm32f103. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/stm32/usbfs.c')
-rw-r--r--src/stm32/usbfs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/stm32/usbfs.c b/src/stm32/usbfs.c
index 2e0db507..de80b9ae 100644
--- a/src/stm32/usbfs.c
+++ b/src/stm32/usbfs.c
@@ -29,9 +29,9 @@ struct ep_desc {
struct ep_mem {
struct ep_desc ep0, ep_acm, ep_bulk_out, ep_bulk_in;
uint32_t ep0_tx[USB_CDC_EP0_SIZE / 2];
- uint32_t ep0_rx[USB_CDC_EP0_SIZE / 2];
+ uint32_t ep0_rx[USB_CDC_EP0_SIZE / 2 + 1];
uint32_t ep_acm_tx[USB_CDC_EP_ACM_SIZE / 2];
- uint32_t ep_bulk_out_rx[USB_CDC_EP_BULK_OUT_SIZE / 2];
+ uint32_t ep_bulk_out_rx[USB_CDC_EP_BULK_OUT_SIZE / 2 + 1];
uint32_t ep_bulk_in_tx[USB_CDC_EP_BULK_IN_SIZE / 2];
};