From cd5a2db73dde414e2eaeb2ef8e3aae279915c7bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Monda?= Date: Mon, 22 May 2017 02:04:39 +0200 Subject: [PATCH] Use the "used" attribute, so that GCC won't remove BootloaderConfig as part of its optimization process. --- left/src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/left/src/main.c b/left/src/main.c index ca0910f..569fb64 100644 --- a/left/src/main.c +++ b/left/src/main.c @@ -60,7 +60,7 @@ typedef struct { uint8_t clockDivider; // Inverted value of the divider to use for core and bus clocks when in high speed mode. } bootloader_config_t; -__attribute__((section(".BootloaderConfig"))) const bootloader_config_t BootloaderConfig = { +__attribute__((used, section(".BootloaderConfig"))) const bootloader_config_t BootloaderConfig = { .tag = 0x6766636B, // Magic Number .enabledPeripherals = 0xE2, // Enabled Peripheral: I2C .i2cSlaveAddress = 0x10, // Use user-defined I2C address