Skip to content
Merged
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
8 changes: 7 additions & 1 deletion optiboot/bootloaders/optiboot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,17 @@ APPSPM_CMD = -DAPP_NOSPM=1
endif
endif

HELPTEXT += "Option OSCCAL_VALUE=nnn - set set OSCCAL_VALUE in bootloader\n"
ifdef OSCCAL_VALUE
OSCCAL_VALUE_CMD = -DOSCCAL_VALUE=$(OSCCAL_VALUE)
dummy = FORCE
endif


COMMON_OPTIONS = $(BAUD_RATE_CMD) $(LED_START_FLASHES_CMD) $(BIGBOOT_CMD)
COMMON_OPTIONS += $(SOFT_UART_CMD) $(LED_DATA_FLASH_CMD) $(LED_CMD) $(SS_CMD)
COMMON_OPTIONS += $(SUPPORT_EEPROM_CMD) $(LED_START_ON_CMD) $(APPSPM_CMD)
COMMON_OPTIONS += $(VERSION_CMD)
COMMON_OPTIONS += $(OSCCAL_VALUE_CMD) $(VERSION_CMD)

#UART is handled separately and only passed for devices with more than one.
HELPTEXT += "Option UART=n - use UARTn for communications\n"
Expand Down
4 changes: 4 additions & 0 deletions optiboot/bootloaders/optiboot/optiboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,10 @@ int main(void) {
SP=RAMEND; // This is done by hardware reset
#endif

#if defined(OSCCAL_VALUE)
OSCCAL = OSCCAL_VALUE;
#endif

/*
* Protect as much from MCUSR as possible for application
* and still skip bootloader if not necessary
Expand Down