X-Git-Url: http://git.linex4red.de/pub/USBaspLoader.git/blobdiff_plain/fdd80449610db4cccc152e17b04cdb51de578a61..46cd9d4a9468b30ee8e456eadee7aed61e6830c1:/firmware/bootloaderconfig.h diff --git a/firmware/bootloaderconfig.h b/firmware/bootloaderconfig.h index 9ca2cd1..7d173d5 100644 --- a/firmware/bootloaderconfig.h +++ b/firmware/bootloaderconfig.h @@ -322,6 +322,18 @@ 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. + */ + //#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 @@ -358,8 +370,6 @@ static inline void bootLoaderInit(void) // deactivated by Stephan - reset after each avrdude op is annoing! // if(!(MCUCSR & (1 << EXTRF))) /* If this was not an external reset, ignore */ // leaveBootloader(); - - MCUCSR = 0; /* clear all reset flags for next time */ } static inline void bootLoaderExit(void) @@ -391,7 +401,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;