summaryrefslogtreecommitdiff
path: root/src/portable/microchip
diff options
context:
space:
mode:
authormaddyaby <[email protected]>2022-06-17 16:07:32 -0700
committermaddyaby <[email protected]>2022-06-17 16:07:32 -0700
commit2cc2a90215f94692f18e0a402470c58366bfca47 (patch)
tree4d8f2af9fe8a5d7afc5ed7b38376b04845862e6e /src/portable/microchip
parentd09d0b314777d57d9df9fdcd128887e98a8e22c5 (diff)
Allow more endpoint packet sizes for SAMD
Tested on SAMD51 - we can allow more packet sizes by checking that the set size value is greater than the requested packet size instead of exactly the same.
Diffstat (limited to 'src/portable/microchip')
-rw-r--r--src/portable/microchip/samd/dcd_samd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/portable/microchip/samd/dcd_samd.c b/src/portable/microchip/samd/dcd_samd.c
index 5ae5a554b..2f40c8247 100644
--- a/src/portable/microchip/samd/dcd_samd.c
+++ b/src/portable/microchip/samd/dcd_samd.c
@@ -222,14 +222,14 @@ bool dcd_edpt_open (uint8_t rhport, tusb_desc_endpoint_t const * desc_edpt)
UsbDeviceDescBank* bank = &sram_registers[epnum][dir];
uint32_t size_value = 0;
while (size_value < 7) {
- if (1 << (size_value + 3) == tu_edpt_packet_size(desc_edpt)) {
+ if (1 << (size_value + 3) >= tu_edpt_packet_size(desc_edpt)) {
break;
}
size_value++;
}
// unsupported endpoint size
- if ( size_value == 7 && tu_edpt_packet_size(desc_edpt) != 1023 ) return false;
+ if ( size_value == 7 && tu_edpt_packet_size(desc_edpt) > 1023 ) return false;
bank->PCKSIZE.bit.SIZE = size_value;