When defined, the bootloader will abort the timeout when
it sees some activity (bootLoaderConditionSimple() or programming).
After aborting timeout, the bootloader falls back to conventional
exitting.
By default this feature is deactivated.
Activate it via the "DEFINES" varibale within Makefile.inc.
There add: -DCONFIG_HAVE__BOOTLOADER_ABORTTIMEOUTONACT
Signed-off-by: Stephan Baerwolf <stephan.baerwolf@tu-ilmenau.de>
* exit as long as bootLoaderConditionSimple stays on.
*/
* exit as long as bootLoaderConditionSimple stays on.
*/
+#ifdef CONFIG_HAVE__BOOTLOADER_ABORTTIMEOUTONACT
+#endif
+/*
+ * When defined, the bootloader will abort the timeout when
+ * it sees some activity (bootLoaderConditionSimple() or
+ * programming).
+ * After aborting timeout, the bootloader falls back to
+ * conventional exitting.
+ */
+
#ifdef CONFIG_HAVE__BOOTLOADER_ALWAYSENTERPROGRAMMODE
#endif
/*
#ifdef CONFIG_HAVE__BOOTLOADER_ALWAYSENTERPROGRAMMODE
#endif
/*
}else if(rq->bRequest == USBASP_FUNC_DISCONNECT){
#if BOOTLOADER_CAN_EXIT
}else if(rq->bRequest == USBASP_FUNC_DISCONNECT){
#if BOOTLOADER_CAN_EXIT
+# ifdef CONFIG_HAVE__BOOTLOADER_ABORTTIMEOUTONACT
+ /* let the main loop know for ever that here was activity */
+ stayinloader &= (0xfc);
+# else
#endif
}else{
/* ignore: others, but could be USBASP_FUNC_CONNECT */
#endif
}else{
/* ignore: others, but could be USBASP_FUNC_CONNECT */
initForUsbConnectivity();
do{
#if ((BOOTLOADER_LOOPCYCLES_TIMEOUT) && (BOOTLOADER_CAN_EXIT))
initForUsbConnectivity();
do{
#if ((BOOTLOADER_LOOPCYCLES_TIMEOUT) && (BOOTLOADER_CAN_EXIT))
- if (stayinloader & 0x1) {
+# 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++;
timeout_remaining = BOOTLOADER_LOOPCYCLES_TIMEOUT;
} else {
__loopscycles++;