mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 21:33:47 -07:00
Fix the USB enumeration process
Keep the interval between usb_enable() and AT91F_CDC_Enumerate() as short as possible
This commit is contained in:
parent
2be05ceeae
commit
d5cd08b30e
1 changed files with 9 additions and 6 deletions
|
@ -2722,12 +2722,6 @@ void __attribute__((noreturn)) AppMain(void) {
|
||||||
usart_init(USART_BAUD_RATE, USART_PARITY);
|
usart_init(USART_BAUD_RATE, USART_PARITY);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// This is made as late as possible to ensure enumeration without timeout
|
|
||||||
// against device such as http://www.hobbytronics.co.uk/usb-host-board-v2
|
|
||||||
usb_disable();
|
|
||||||
usb_enable();
|
|
||||||
allow_send_wtx = true;
|
|
||||||
|
|
||||||
#ifdef WITH_FLASH
|
#ifdef WITH_FLASH
|
||||||
// If flash is not present, BUSY_TIMEOUT kicks in, let's do it after USB
|
// If flash is not present, BUSY_TIMEOUT kicks in, let's do it after USB
|
||||||
loadT55xxConfig();
|
loadT55xxConfig();
|
||||||
|
@ -2735,9 +2729,18 @@ void __attribute__((noreturn)) AppMain(void) {
|
||||||
//
|
//
|
||||||
// Enforce a spiffs check/garbage collection at boot so we are likely to never
|
// Enforce a spiffs check/garbage collection at boot so we are likely to never
|
||||||
// fall under the 2 contigous free blocks availables
|
// fall under the 2 contigous free blocks availables
|
||||||
|
// This is a time-consuming process on large flash.
|
||||||
rdv40_spiffs_check();
|
rdv40_spiffs_check();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// This is made as late as possible to ensure enumeration without timeout
|
||||||
|
// against device such as http://www.hobbytronics.co.uk/usb-host-board-v2
|
||||||
|
// In other words, keep the interval between usb_enable() and the main loop as short as possible.
|
||||||
|
// (AT91F_CDC_Enumerate() will be called in the main loop)
|
||||||
|
usb_disable();
|
||||||
|
usb_enable();
|
||||||
|
allow_send_wtx = true;
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
WDT_HIT();
|
WDT_HIT();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue