X-Git-Url: http://git.linex4red.de/pub/USBaspLoader.git/blobdiff_plain/00602eff344e2d55b948039f64e1704b392624a0..d7ac76b34c7ead103afb231d705976faa5c4beae:/firmware/bootloaderconfig.h diff --git a/firmware/bootloaderconfig.h b/firmware/bootloaderconfig.h index b4a47e4..f469f8d 100644 --- a/firmware/bootloaderconfig.h +++ b/firmware/bootloaderconfig.h @@ -322,6 +322,49 @@ 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. + */ + +#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 +/* + * Ignore bootLoaderCondition() (BUT NOT bootLoaderConditionSimple()) + * and always enter the program-mode. + * This is helpful to emulate behaviour of Arduino bootloaders + */ + //#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 @@ -387,6 +430,9 @@ static inline void bootLoaderExit(void) static volatile uint8_t __BOOTLOADERENTRY_FROMSOFTWARE__bootup_RAMEND_doesmatch __attribute__ ((section(".noinit"))); static volatile uint8_t __BOOTLOADERENTRY_FROMSOFTWARE__bootup_MCUCSR __attribute__ ((section(".noinit"))); +# ifdef CONFIG_HAVE__BOOTLOADER_ALWAYSENTERPROGRAMMODE +# define bootLoaderCondition() (true) +# else static inline bool bootLoaderCondition(void) { if (__BOOTLOADERENTRY_FROMSOFTWARE__bootup_MCUCSR & (~(_BV(WDRF)))) { @@ -398,8 +444,13 @@ static inline bool bootLoaderCondition(void) } return bootLoaderConditionSimple(); } +# endif #else -#define bootLoaderCondition bootLoaderConditionSimple +# ifdef CONFIG_HAVE__BOOTLOADER_ALWAYSENTERPROGRAMMODE +# define bootLoaderCondition() (true) +# else +# define bootLoaderCondition bootLoaderConditionSimple +# endif #endif #endif /* __ASSEMBLER__ */