reduce HID max packet size to 32

This commit is contained in:
Raphael Assenat 2016-05-28 00:17:43 -04:00
parent 4fbba42896
commit b9a6f23607
2 changed files with 4 additions and 4 deletions

2
main.c
View File

@ -91,7 +91,7 @@ static const struct cfg0 cfg0 PROGMEM = {
.bDescriptorType = ENDPOINT_DESCRIPTOR,
.bEndpointAddress = USB_RQT_DEVICE_TO_HOST | 1, // 0x81
.bmAttributes = TRANSFER_TYPE_INT,
.wMaxPacketsize = 64,
.wMaxPacketsize = 32,
.bInterval = LS_FS_INTERVAL_MS(1),
},

6
usb.c
View File

@ -89,7 +89,7 @@ static void setupEndpoints(void)
UECONX = 1<<EPEN; // activate endpoint
UECFG0X = (3<<6) | (1<<EPDIR); // Interrupt IN
UEIENX = (1<<TXINE);
UECFG1X |= (1<<EPSIZE0)|(1<<EPSIZE1)|(1<<ALLOC); // 64 bytes, one bank, and allocate
UECFG1X |= (1<<EPSIZE1)|(1<<ALLOC); // 32 bytes, one bank, and allocate
UEINTX = 0;
if (!(UESTA0X & (1<<CFGOK))) {
@ -102,8 +102,8 @@ static void setupEndpoints(void)
UECONX = 1<<EPEN; // activate endpoint
UECFG0X = (3<<6) | (1<<EPDIR); // Interrupt IN
//UEIENX = (1<<TXINE);
UECFG1X |= (1<<EPSIZE0)|(1<<EPSIZE1)|(1<<ALLOC); // 64 bytes, one bank, and allocate
// UEIENX = (1<<TXINE);
UECFG1X = (1<<EPSIZE0)|(1<<EPSIZE1)|(1<<ALLOC); // 64 bytes, one bank, and allocate
UEINTX = 0;
if (!(UESTA0X & (1<<CFGOK))) {