Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions Bootloaders/DFU/BootloaderDFU.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,22 +135,21 @@ void Application_Jump_Check(void)
/* Check if the device's BOOTRST fuse is set */
if (!(BootloaderAPI_ReadFuse(GET_HIGH_FUSE_BITS) & ~FUSE_BOOTRST))
{
/* If the reset source was not an external reset or the key is correct, clear it and jump to the application */
//if (!(MCUSR & (1 << EXTRF)) || (MagicBootKey == MAGIC_BOOT_KEY))
// JumpToApplication = true;
/* If the reset source was a power on reset or a brown out reset or the key is correct, clear it and jump to the application */
if (MCUSR & ((1 << PORF) | (1 << BORF)) || (MagicBootKey == MAGIC_BOOT_KEY))
{
JumpToApplication = true;
}

/* Clear reset source */
MCUSR &= ~(1 << EXTRF);
/* Clear reset sources */
MCUSR &= ~((1 << PORF) | (1 << BORF));
}
else
{
/* If the reset source was the bootloader and the key is correct, clear it and jump to the application;
* this can happen in the HWBE fuse is set, and the HBE pin is low during the watchdog reset */
//if ((MCUSR & (1 << WDRF)) && (MagicBootKey == MAGIC_BOOT_KEY))
// JumpToApplication = true;

/* Clear reset source */
MCUSR &= ~(1 << WDRF);
/* If the reset source was the bootloader the key is correct. Jump to the application;
* this can happen if the HWBE fuse is set, and the HWB pin is low during the watchdog reset */
if (MagicBootKey == MAGIC_BOOT_KEY)
JumpToApplication = true;
}
#endif

Expand Down
4 changes: 4 additions & 0 deletions Bootloaders/DFU/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ BOOT_API_LD_FLAGS = $(call BOOT_SECTION_LD_FLAG, .apitable_trampolines, Boot
BOOT_API_LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, .apitable_jumptable, BootloaderAPI_JumpTable, 32)
BOOT_API_LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, .apitable_signatures, BootloaderAPI_Signatures, 8)

ifeq ($(strip $(CHECK_RESET_SOURCE)), yes)
OPT_DEFS += -DCHECK_RESET_SOURCE
endif

# Default target
all:

Expand Down
3 changes: 3 additions & 0 deletions LUFA/Build/DMBS/DMBS/gcc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ ifeq ($(LTO), Y)
BASE_CC_FLAGS += -flto -fuse-linker-plugin
BASE_LD_FLAGS += -flto -fuse-linker-plugin
endif
ifneq ($(OPT_DEFS),)
BASE_CC_FLAGS += $(OPT_DEFS)
endif

# Additional language specific compiler flags
BASE_C_FLAGS := -x c -O$(OPTIMIZATION) -std=$(C_STANDARD) -Wstrict-prototypes
Expand Down