Pin uint16_t bootloader_magic_key at the MAGIC_KEY_POS location to prevent magic key overwrite

This commit is contained in:
Delio Brignoli 2018-01-14 17:22:44 +01:00
parent f8f46de06d
commit ad9ec1de55
1 changed files with 4 additions and 0 deletions

View File

@ -6,6 +6,10 @@
#include "Arduboy2Core.h"
// Reserve the location of the bootloader's magic key
// so it cannot be overwritten by program variables
uint16_t bootloader_magic_key __attribute__((used)) __attribute__((address(MAGIC_KEY_POS)));
const uint8_t PROGMEM lcdBootProgram[] = {
// boot defaults are commented out but left here in case they
// might prove useful for reference