X-Git-Url: http://git.linex4red.de/pub/USBaspLoader.git/blobdiff_plain/4c35c3b6d7988c8f7ff5d33c4df608cfd7b85442..a3d7386c66be4c2479a15ebfa60eb733c0005dbc:/firmware/bootloaderconfig.h diff --git a/firmware/bootloaderconfig.h b/firmware/bootloaderconfig.h index e3520b4..072aa81 100644 --- a/firmware/bootloaderconfig.h +++ b/firmware/bootloaderconfig.h @@ -322,6 +322,31 @@ these macros are defined, the boot loader usees them. * user intervention */ +#ifdef CONFIG_NO__BOOTLOADER_HIDDENEXITCOMMAND +# define HAVE_BOOTLOADER_HIDDENEXITCOMMAND 0 +#else +# define HAVE_BOOTLOADER_HIDDENEXITCOMMAND 0xff +#endif +/* + * When enabling "BOOTLOADER_HIDDENEXITCOMMAND", then + * sending the RAW-ISP command "0xff 0xXX 0xXX 0xXX" + * will cause the bootloader to start the firmware + * as soon as the programming software disconnects. + */ + +#ifndef BOOTLOADER_LOOPCYCLES_TIMEOUT +# define BOOTLOADER_LOOPCYCLES_TIMEOUT 0 +#endif +/* + * When greater than "0", "BOOTLOADER_LOOPCYCLES_TIMEOUT" + * defines how many 16bit loopcycles can be cycled, + * before bootloader times out and starts user + * firmware. + * Of course "BOOTLOADER_CAN_EXIT" must be enabled. + * If value is even too small, bootloader will not + * exit as long as bootLoaderConditionSimple stays on. + */ + //#define SIGNATURE_BYTES 0x1e, 0x93, 0x07, 0 /* ATMega8 */ /* This macro defines the signature bytes returned by the emulated USBasp to * the programmer software. They should match the actual device at least in @@ -389,7 +414,8 @@ static volatile uint8_t __BOOTLOADERENTRY_FROMSOFTWARE__bootup_MCUCSR __attribut static inline bool bootLoaderCondition(void) { - if (__BOOTLOADERENTRY_FROMSOFTWARE__bootup_MCUCSR & (_BV(WDRF))) { + if (__BOOTLOADERENTRY_FROMSOFTWARE__bootup_MCUCSR & (~(_BV(WDRF)))) { + } else { if (__BOOTLOADERENTRY_FROMSOFTWARE__bootup_RAMEND_doesmatch == (__BOOTLOADERENTRY_FROMSOFTWARE__EXPECTEDADDRESS & 0xff)) { // anything else: match - the firmware is calling the bootloader return true;