Extract DEFINE_BOOTLOADER_CONFIG_AREA()
This commit is contained in:
@@ -1,11 +1,4 @@
|
||||
#include "bootloader.h"
|
||||
#include "i2c_addresses.h"
|
||||
|
||||
__attribute__((used, section(".BootloaderConfig"))) const bootloader_config_t BootloaderConfig = {
|
||||
.tag = BOOTLOADER_TAG,
|
||||
.enabledPeripherals = EnabledBootloaderPeripherial_I2c,
|
||||
.i2cSlaveAddress = I2C_ADDRESS_LEFT_KEYBOARD_HALF_BOOTLOADER,
|
||||
.peripheralDetectionTimeoutMs = BOOTLOADER_TIMEOUT_MS,
|
||||
.clockFlags = CLOCK_FLAG_HIGH_SPEED_MODE,
|
||||
.clockDivider = ~0
|
||||
};
|
||||
DEFINE_BOOTLOADER_CONFIG_AREA(I2C_ADDRESS_LEFT_KEYBOARD_HALF_BOOTLOADER)
|
||||
|
||||
@@ -12,6 +12,16 @@
|
||||
#define BOOTLOADER_TIMEOUT_MS 100
|
||||
#define CLOCK_FLAG_HIGH_SPEED_MODE 0x01
|
||||
|
||||
#define DEFINE_BOOTLOADER_CONFIG_AREA(address) \
|
||||
__attribute__((used, section(".BootloaderConfig"))) const bootloader_config_t BootloaderConfig = { \
|
||||
.tag = BOOTLOADER_TAG, \
|
||||
.enabledPeripherals = EnabledBootloaderPeripherial_I2c, \
|
||||
.i2cSlaveAddress = address, \
|
||||
.peripheralDetectionTimeoutMs = BOOTLOADER_TIMEOUT_MS, \
|
||||
.clockFlags = CLOCK_FLAG_HIGH_SPEED_MODE, \
|
||||
.clockDivider = ~0 \
|
||||
};
|
||||
|
||||
// Typedefs:
|
||||
|
||||
typedef enum {
|
||||
|
||||
Reference in New Issue
Block a user