Do not wait until a user does one transaction. Just wait for a
repress of the JUMPER-Button.
Also: if there is a transaction going on - do NOT exit!
Signed-off-by: Stephan Baerwolf <stephan.baerwolf@tu-ilmenau.de>
}
}else if(rq->bRequest == USBASP_FUNC_DISCONNECT){
}
}else if(rq->bRequest == USBASP_FUNC_DISCONNECT){
+ stayinloader &= (0x7f);
#if BOOTLOADER_CAN_EXIT
requestBootLoaderExit = 1; /* allow proper shutdown/close of connection */
#endif
#if BOOTLOADER_CAN_EXIT
requestBootLoaderExit = 1; /* allow proper shutdown/close of connection */
#endif
+ }else if(rq->bRequest == USBASP_FUNC_CONNECT){
+ stayinloader |= (0x80);
- /* ignore: USBASP_FUNC_CONNECT */
- }while ((stayinloader) || (!bootLoaderCondition())); /* main event loop */
+ if (stayinloader & 0x1) {
+ if (!bootLoaderCondition()) {
+ stayinloader = (stayinloader & 0xfc) | 0x2;
+ }
+ } else {
+ if (bootLoaderCondition()) {
+ stayinloader &= 0xfc;
+ }
+ }
+
+ }while (stayinloader); /* main event loop */