1
0
mirror of https://github.com/Optiboot/optiboot.git synced 2025-07-03 05:42:30 +03:00

change OSCCAL in bootloader

This commit is contained in:
inajob
2020-03-14 10:43:47 +09:00
parent 1810af8050
commit 4e55b23002
2 changed files with 11 additions and 1 deletions

View File

@ -243,11 +243,17 @@ APPSPM_CMD = -DAPP_NOSPM=1
endif endif
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 = $(BAUD_RATE_CMD) $(LED_START_FLASHES_CMD) $(BIGBOOT_CMD)
COMMON_OPTIONS += $(SOFT_UART_CMD) $(LED_DATA_FLASH_CMD) $(LED_CMD) $(SS_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 += $(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. #UART is handled separately and only passed for devices with more than one.
HELPTEXT += "Option UART=n - use UARTn for communications\n" HELPTEXT += "Option UART=n - use UARTn for communications\n"

View File

@ -563,6 +563,10 @@ int main(void) {
SP=RAMEND; // This is done by hardware reset SP=RAMEND; // This is done by hardware reset
#endif #endif
#if defined(OSCCAL_VALUE)
OSCCAL = OSCCAL_VALUE;
#endif
/* /*
* Protect as much from MCUSR as possible for application * Protect as much from MCUSR as possible for application
* and still skip bootloader if not necessary * and still skip bootloader if not necessary