}else if(rq->bRequest == USBASP_FUNC_DISCONNECT){
#if BOOTLOADER_CAN_EXIT
-# if (BOOTLOADER_LOOPCYCLES_TIMEOUT)
- timeout_remaining = BOOTLOADER_LOOPCYCLES_TIMEOUT;
- stayinloader = (0xfe);
+# ifdef CONFIG_HAVE__BOOTLOADER_ABORTTIMEOUTONACT
+ /* let the main loop know for ever that here was activity */
+ stayinloader &= (0xfc);
# else
stayinloader &= (0xfe);
# endif
initForUsbConnectivity();
do{
#if ((BOOTLOADER_LOOPCYCLES_TIMEOUT) && (BOOTLOADER_CAN_EXIT))
- __loopscycles++;
- if (!(__loopscycles)) {
- if(timeout_remaining) timeout_remaining--;
- else stayinloader&=0xf1;
+# ifdef CONFIG_HAVE__BOOTLOADER_ABORTTIMEOUTONACT
+ if (stayinloader != 0x0e) {
+ /* can be reached, since high-nibble is decreased every cycle... */
+#else
+ if (stayinloader & 0x01) {
+#endif
+ timeout_remaining = BOOTLOADER_LOOPCYCLES_TIMEOUT;
+ } else {
+ __loopscycles++;
+ if (!(__loopscycles)) {
+ if(timeout_remaining) timeout_remaining--;
+ else stayinloader&=0xf1;
+ }
}
#endif
usbPoll();