fix
This commit is contained in:
@@ -473,10 +473,11 @@ main (int argc, char *argv[])
|
||||
#endif
|
||||
}
|
||||
|
||||
set_led (1);
|
||||
/* USB Dissconnect (when supported) */
|
||||
usb_lld_shutdown ();
|
||||
USB_Cable_Config (0);
|
||||
set_led (1);
|
||||
chThdSleep (MS2ST (100));
|
||||
chThdSleep (MS2ST (1)); /* > 2.5us required */
|
||||
port_disable ();
|
||||
/* set vector */
|
||||
SCB->VTOR = (uint32_t)&_regnual_start;
|
||||
|
||||
@@ -228,8 +228,9 @@ gnuk_setup (uint8_t req, uint8_t req_no,
|
||||
if (addr < &_regnual_start || addr + len > &__heap_end__)
|
||||
return USB_UNSUPPORT;
|
||||
|
||||
if (index == 0 && len != 256)
|
||||
memset (addr, 0, 256);
|
||||
if (index + len < 256)
|
||||
memset (addr + index + len, 0, 256 - (index + len));
|
||||
|
||||
usb_lld_set_data_to_recv (addr, len);
|
||||
return USB_SUCCESS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user