mirror of
https://github.com/hathach/tinyusb.git
synced 2025-03-31 16:20:57 +00:00
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.
This commit is contained in:
parent
d09d0b3147
commit
2cc2a90215
@ -222,14 +222,14 @@ bool dcd_edpt_open (uint8_t rhport, tusb_desc_endpoint_t const * desc_edpt)
|
|||||||
UsbDeviceDescBank* bank = &sram_registers[epnum][dir];
|
UsbDeviceDescBank* bank = &sram_registers[epnum][dir];
|
||||||
uint32_t size_value = 0;
|
uint32_t size_value = 0;
|
||||||
while (size_value < 7) {
|
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;
|
break;
|
||||||
}
|
}
|
||||||
size_value++;
|
size_value++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// unsupported endpoint size
|
// 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;
|
bank->PCKSIZE.bit.SIZE = size_value;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user