mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-15 12:25:20 +03:00
Changed 'EEPROM_IN_...' to 'CONFIG_IN_...' for clarity. (#8658)
Changed 'EEPROM_IN_...' to 'CONFIG_IN_...' for clarity.
This commit is contained in:
commit
521e09fbf8
11 changed files with 57 additions and 57 deletions
|
@ -191,7 +191,7 @@ TARGET_FLAGS := -DUSE_EXST $(TARGET_FLAGS)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(RAM_BASED),yes)
|
ifeq ($(RAM_BASED),yes)
|
||||||
TARGET_FLAGS := -DUSE_EXST -DEEPROM_IN_RAM $(TARGET_FLAGS)
|
TARGET_FLAGS := -DUSE_EXST -DCONFIG_IN_RAM $(TARGET_FLAGS)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(SIMULATOR_BUILD),yes)
|
ifeq ($(SIMULATOR_BUILD),yes)
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
#include "pg/pg.h"
|
#include "pg/pg.h"
|
||||||
#include "fc/config.h"
|
#include "fc/config.h"
|
||||||
|
|
||||||
#ifdef EEPROM_IN_SDCARD
|
#ifdef CONFIG_IN_SDCARD
|
||||||
#include "io/asyncfatfs/asyncfatfs.h"
|
#include "io/asyncfatfs/asyncfatfs.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ typedef struct {
|
||||||
uint32_t word;
|
uint32_t word;
|
||||||
} PG_PACKED packingTest_t;
|
} PG_PACKED packingTest_t;
|
||||||
|
|
||||||
#if defined(EEPROM_IN_EXTERNAL_FLASH)
|
#if defined(CONFIG_IN_EXTERNAL_FLASH)
|
||||||
bool loadEEPROMFromExternalFlash(void)
|
bool loadEEPROMFromExternalFlash(void)
|
||||||
{
|
{
|
||||||
const flashPartition_t *flashPartition = flashPartitionFindByType(FLASH_PARTITION_TYPE_CONFIG);
|
const flashPartition_t *flashPartition = flashPartitionFindByType(FLASH_PARTITION_TYPE_CONFIG);
|
||||||
|
@ -106,7 +106,7 @@ bool loadEEPROMFromExternalFlash(void)
|
||||||
|
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
#elif defined(EEPROM_IN_SDCARD)
|
#elif defined(CONFIG_IN_SDCARD)
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
FILE_STATE_NONE = 0,
|
FILE_STATE_NONE = 0,
|
||||||
|
@ -236,7 +236,7 @@ bool loadEEPROMFromSDCard(void)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef EEPROM_IN_FILE
|
#ifdef CONFIG_IN_FILE
|
||||||
void loadEEPROMFromFile(void) {
|
void loadEEPROMFromFile(void) {
|
||||||
FLASH_Unlock(); // load existing config file into eepromData
|
FLASH_Unlock(); // load existing config file into eepromData
|
||||||
}
|
}
|
||||||
|
@ -252,15 +252,15 @@ void initEEPROM(void)
|
||||||
STATIC_ASSERT(sizeof(configFooter_t) == 2, footer_size_failed);
|
STATIC_ASSERT(sizeof(configFooter_t) == 2, footer_size_failed);
|
||||||
STATIC_ASSERT(sizeof(configRecord_t) == 6, record_size_failed);
|
STATIC_ASSERT(sizeof(configRecord_t) == 6, record_size_failed);
|
||||||
|
|
||||||
#if defined(EEPROM_IN_FILE)
|
#if defined(CONFIG_IN_FILE)
|
||||||
loadEEPROMFromFile();
|
loadEEPROMFromFile();
|
||||||
#elif defined(EEPROM_IN_EXTERNAL_FLASH)
|
#elif defined(CONFIG_IN_EXTERNAL_FLASH)
|
||||||
bool eepromLoaded = loadEEPROMFromExternalFlash();
|
bool eepromLoaded = loadEEPROMFromExternalFlash();
|
||||||
if (!eepromLoaded) {
|
if (!eepromLoaded) {
|
||||||
// Flash read failed - just die now
|
// Flash read failed - just die now
|
||||||
failureMode(FAILURE_FLASH_READ_FAILED);
|
failureMode(FAILURE_FLASH_READ_FAILED);
|
||||||
}
|
}
|
||||||
#elif defined(EEPROM_IN_SDCARD)
|
#elif defined(CONFIG_IN_SDCARD)
|
||||||
bool eepromLoaded = loadEEPROMFromSDCard();
|
bool eepromLoaded = loadEEPROMFromSDCard();
|
||||||
if (!eepromLoaded) {
|
if (!eepromLoaded) {
|
||||||
// SDCard read failed - just die now
|
// SDCard read failed - just die now
|
||||||
|
@ -335,12 +335,12 @@ uint16_t getEEPROMConfigSize(void)
|
||||||
|
|
||||||
size_t getEEPROMStorageSize(void)
|
size_t getEEPROMStorageSize(void)
|
||||||
{
|
{
|
||||||
#if defined(EEPROM_IN_EXTERNAL_FLASH)
|
#if defined(CONFIG_IN_EXTERNAL_FLASH)
|
||||||
|
|
||||||
const flashPartition_t *flashPartition = flashPartitionFindByType(FLASH_PARTITION_TYPE_CONFIG);
|
const flashPartition_t *flashPartition = flashPartitionFindByType(FLASH_PARTITION_TYPE_CONFIG);
|
||||||
return FLASH_PARTITION_SECTOR_COUNT(flashPartition) * flashGetGeometry()->sectorSize;
|
return FLASH_PARTITION_SECTOR_COUNT(flashPartition) * flashGetGeometry()->sectorSize;
|
||||||
#endif
|
#endif
|
||||||
#ifdef EEPROM_IN_RAM
|
#ifdef CONFIG_IN_RAM
|
||||||
return EEPROM_SIZE;
|
return EEPROM_SIZE;
|
||||||
#else
|
#else
|
||||||
return &__config_end - &__config_start;
|
return &__config_end - &__config_start;
|
||||||
|
@ -450,11 +450,11 @@ void writeConfigToEEPROM(void)
|
||||||
if (writeSettingsToEEPROM()) {
|
if (writeSettingsToEEPROM()) {
|
||||||
success = true;
|
success = true;
|
||||||
|
|
||||||
#ifdef EEPROM_IN_EXTERNAL_FLASH
|
#ifdef CONFIG_IN_EXTERNAL_FLASH
|
||||||
// copy it back from flash to the in-memory buffer.
|
// copy it back from flash to the in-memory buffer.
|
||||||
success = loadEEPROMFromExternalFlash();
|
success = loadEEPROMFromExternalFlash();
|
||||||
#endif
|
#endif
|
||||||
#ifdef EEPROM_IN_SDCARD
|
#ifdef CONFIG_IN_SDCARD
|
||||||
// copy it back from flash to the in-memory buffer.
|
// copy it back from flash to the in-memory buffer.
|
||||||
success = loadEEPROMFromSDCard();
|
success = loadEEPROMFromSDCard();
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -27,8 +27,8 @@
|
||||||
|
|
||||||
#include "config/config_streamer.h"
|
#include "config/config_streamer.h"
|
||||||
|
|
||||||
#if !defined(EEPROM_IN_FLASH)
|
#if !defined(CONFIG_IN_FLASH)
|
||||||
#if defined(EEPROM_IN_RAM) && defined(PERSISTENT)
|
#if defined(CONFIG_IN_RAM) && defined(PERSISTENT)
|
||||||
PERSISTENT uint8_t eepromData[EEPROM_SIZE];
|
PERSISTENT uint8_t eepromData[EEPROM_SIZE];
|
||||||
#else
|
#else
|
||||||
uint8_t eepromData[EEPROM_SIZE];
|
uint8_t eepromData[EEPROM_SIZE];
|
||||||
|
@ -36,7 +36,7 @@ uint8_t eepromData[EEPROM_SIZE];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if defined(STM32H750xx) && !(defined(EEPROM_IN_EXTERNAL_FLASH) || defined(EEPROM_IN_RAM) || defined(EEPROM_IN_SDCARD))
|
#if defined(STM32H750xx) && !(defined(CONFIG_IN_EXTERNAL_FLASH) || defined(CONFIG_IN_RAM) || defined(CONFIG_IN_SDCARD))
|
||||||
#error "STM32750xx only has one flash page which contains the bootloader, no spare flash pages available, use external storage for persistent config or ram for target testing"
|
#error "STM32750xx only has one flash page which contains the bootloader, no spare flash pages available, use external storage for persistent config or ram for target testing"
|
||||||
#endif
|
#endif
|
||||||
// @todo this is not strictly correct for F4/F7, where sector sizes are variable
|
// @todo this is not strictly correct for F4/F7, where sector sizes are variable
|
||||||
|
@ -91,9 +91,9 @@ void config_streamer_start(config_streamer_t *c, uintptr_t base, int size)
|
||||||
c->address = base;
|
c->address = base;
|
||||||
c->size = size;
|
c->size = size;
|
||||||
if (!c->unlocked) {
|
if (!c->unlocked) {
|
||||||
#if defined(EEPROM_IN_RAM) || defined(EEPROM_IN_EXTERNAL_FLASH) || defined(EEPROM_IN_SDCARD)
|
#if defined(CONFIG_IN_RAM) || defined(CONFIG_IN_EXTERNAL_FLASH) || defined(CONFIG_IN_SDCARD)
|
||||||
// NOP
|
// NOP
|
||||||
#elif defined(EEPROM_IN_FLASH) || defined(EEPROM_IN_FILE)
|
#elif defined(CONFIG_IN_FLASH) || defined(CONFIG_IN_FILE)
|
||||||
#if defined(STM32F7) || defined(STM32H7)
|
#if defined(STM32F7) || defined(STM32H7)
|
||||||
HAL_FLASH_Unlock();
|
HAL_FLASH_Unlock();
|
||||||
#else
|
#else
|
||||||
|
@ -103,9 +103,9 @@ void config_streamer_start(config_streamer_t *c, uintptr_t base, int size)
|
||||||
c->unlocked = true;
|
c->unlocked = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(EEPROM_IN_RAM) || defined(EEPROM_IN_FILE) || defined(EEPROM_IN_EXTERNAL_FLASH)
|
#if defined(CONFIG_IN_RAM) || defined(CONFIG_IN_FILE) || defined(CONFIG_IN_EXTERNAL_FLASH)
|
||||||
// NOP
|
// NOP
|
||||||
#elif defined(EEPROM_IN_FLASH)
|
#elif defined(CONFIG_IN_FLASH)
|
||||||
#if defined(STM32F10X)
|
#if defined(STM32F10X)
|
||||||
FLASH_ClearFlag(FLASH_FLAG_EOP | FLASH_FLAG_PGERR | FLASH_FLAG_WRPRTERR);
|
FLASH_ClearFlag(FLASH_FLAG_EOP | FLASH_FLAG_PGERR | FLASH_FLAG_WRPRTERR);
|
||||||
#elif defined(STM32F303)
|
#elif defined(STM32F303)
|
||||||
|
@ -125,9 +125,9 @@ void config_streamer_start(config_streamer_t *c, uintptr_t base, int size)
|
||||||
c->err = 0;
|
c->err = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(EEPROM_IN_RAM) || defined(EEPROM_IN_EXTERNAL_FLASH) || defined(EEPROM_IN_SDCARD)
|
#if defined(CONFIG_IN_RAM) || defined(CONFIG_IN_EXTERNAL_FLASH) || defined(CONFIG_IN_SDCARD)
|
||||||
// No flash sector method required.
|
// No flash sector method required.
|
||||||
#elif defined(EEPROM_IN_FLASH)
|
#elif defined(CONFIG_IN_FLASH)
|
||||||
#if defined(STM32F745xx) || defined(STM32F746xx) || defined(STM32F765xx)
|
#if defined(STM32F745xx) || defined(STM32F746xx) || defined(STM32F765xx)
|
||||||
/*
|
/*
|
||||||
Sector 0 0x08000000 - 0x08007FFF 32 Kbytes
|
Sector 0 0x08000000 - 0x08007FFF 32 Kbytes
|
||||||
|
@ -360,7 +360,7 @@ static int write_word(config_streamer_t *c, config_streamer_buffer_align_type_t
|
||||||
if (c->err != 0) {
|
if (c->err != 0) {
|
||||||
return c->err;
|
return c->err;
|
||||||
}
|
}
|
||||||
#if defined(EEPROM_IN_EXTERNAL_FLASH)
|
#if defined(CONFIG_IN_EXTERNAL_FLASH)
|
||||||
|
|
||||||
uint32_t dataOffset = (uint32_t)(c->address - (uintptr_t)&eepromData[0]);
|
uint32_t dataOffset = (uint32_t)(c->address - (uintptr_t)&eepromData[0]);
|
||||||
|
|
||||||
|
@ -395,7 +395,7 @@ static int write_word(config_streamer_t *c, config_streamer_buffer_align_type_t
|
||||||
|
|
||||||
flashPageProgramContinue((uint8_t *)buffer, CONFIG_STREAMER_BUFFER_SIZE);
|
flashPageProgramContinue((uint8_t *)buffer, CONFIG_STREAMER_BUFFER_SIZE);
|
||||||
|
|
||||||
#elif defined(EEPROM_IN_RAM) || defined(EEPROM_IN_SDCARD)
|
#elif defined(CONFIG_IN_RAM) || defined(CONFIG_IN_SDCARD)
|
||||||
if (c->address == (uintptr_t)&eepromData[0]) {
|
if (c->address == (uintptr_t)&eepromData[0]) {
|
||||||
memset(eepromData, 0, sizeof(eepromData));
|
memset(eepromData, 0, sizeof(eepromData));
|
||||||
}
|
}
|
||||||
|
@ -409,7 +409,7 @@ static int write_word(config_streamer_t *c, config_streamer_buffer_align_type_t
|
||||||
*dest_addr++ = *src_addr++;
|
*dest_addr++ = *src_addr++;
|
||||||
} while (--row_index != 0);
|
} while (--row_index != 0);
|
||||||
|
|
||||||
#elif defined(EEPROM_IN_FILE)
|
#elif defined(CONFIG_IN_FILE)
|
||||||
|
|
||||||
if (c->address % FLASH_PAGE_SIZE == 0) {
|
if (c->address % FLASH_PAGE_SIZE == 0) {
|
||||||
const FLASH_Status status = FLASH_ErasePage(c->address);
|
const FLASH_Status status = FLASH_ErasePage(c->address);
|
||||||
|
@ -422,7 +422,7 @@ static int write_word(config_streamer_t *c, config_streamer_buffer_align_type_t
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif defined(EEPROM_IN_FLASH)
|
#elif defined(CONFIG_IN_FLASH)
|
||||||
|
|
||||||
#if defined(STM32H7)
|
#if defined(STM32H7)
|
||||||
if (c->address % FLASH_PAGE_SIZE == 0) {
|
if (c->address % FLASH_PAGE_SIZE == 0) {
|
||||||
|
@ -518,17 +518,17 @@ int config_streamer_flush(config_streamer_t *c)
|
||||||
int config_streamer_finish(config_streamer_t *c)
|
int config_streamer_finish(config_streamer_t *c)
|
||||||
{
|
{
|
||||||
if (c->unlocked) {
|
if (c->unlocked) {
|
||||||
#if defined(EEPROM_IN_SDCARD)
|
#if defined(CONFIG_IN_SDCARD)
|
||||||
bool saveEEPROMToSDCard(void); // XXX forward declaration to avoid circular dependency between config_streamer / config_eeprom
|
bool saveEEPROMToSDCard(void); // XXX forward declaration to avoid circular dependency between config_streamer / config_eeprom
|
||||||
saveEEPROMToSDCard();
|
saveEEPROMToSDCard();
|
||||||
// TODO overwrite the data in the file on the SD card.
|
// TODO overwrite the data in the file on the SD card.
|
||||||
#elif defined(EEPROM_IN_EXTERNAL_FLASH)
|
#elif defined(CONFIG_IN_EXTERNAL_FLASH)
|
||||||
flashFlush();
|
flashFlush();
|
||||||
#elif defined(EEPROM_IN_RAM)
|
#elif defined(CONFIG_IN_RAM)
|
||||||
// NOP
|
// NOP
|
||||||
#elif defined(EEPROM_IN_FILE)
|
#elif defined(CONFIG_IN_FILE)
|
||||||
FLASH_Lock();
|
FLASH_Lock();
|
||||||
#elif defined(EEPROM_IN_FLASH)
|
#elif defined(CONFIG_IN_FLASH)
|
||||||
#if defined(STM32F7) || defined(STM32H7)
|
#if defined(STM32F7) || defined(STM32H7)
|
||||||
HAL_FLASH_Lock();
|
HAL_FLASH_Lock();
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
// Streams data out to the EEPROM, padding to the write size as
|
// Streams data out to the EEPROM, padding to the write size as
|
||||||
// needed, and updating the checksum as it goes.
|
// needed, and updating the checksum as it goes.
|
||||||
|
|
||||||
#ifdef EEPROM_IN_EXTERNAL_FLASH
|
#ifdef CONFIG_IN_EXTERNAL_FLASH
|
||||||
#define CONFIG_STREAMER_BUFFER_SIZE 8 // Must not be greater than the smallest flash page size of all compiled-in flash devices.
|
#define CONFIG_STREAMER_BUFFER_SIZE 8 // Must not be greater than the smallest flash page size of all compiled-in flash devices.
|
||||||
typedef uint32_t config_streamer_buffer_align_type_t;
|
typedef uint32_t config_streamer_buffer_align_type_t;
|
||||||
#elif defined(STM32H7)
|
#elif defined(STM32H7)
|
||||||
|
|
|
@ -310,7 +310,7 @@ static void flashConfigurePartitions(void)
|
||||||
startSector = 0;
|
startSector = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(EEPROM_IN_EXTERNAL_FLASH)
|
#if defined(CONFIG_IN_EXTERNAL_FLASH)
|
||||||
const uint32_t configSize = EEPROM_SIZE;
|
const uint32_t configSize = EEPROM_SIZE;
|
||||||
flashSector_t configSectors = (configSize / flashGeometry->sectorSize);
|
flashSector_t configSectors = (configSize / flashGeometry->sectorSize);
|
||||||
|
|
||||||
|
|
|
@ -290,7 +290,7 @@ void init(void)
|
||||||
uint8_t initFlags = 0;
|
uint8_t initFlags = 0;
|
||||||
|
|
||||||
|
|
||||||
#ifdef EEPROM_IN_SDCARD
|
#ifdef CONFIG_IN_SDCARD
|
||||||
|
|
||||||
//
|
//
|
||||||
// Config in sdcard presents an issue with pin configuration since the pin and sdcard configs for the
|
// Config in sdcard presents an issue with pin configuration since the pin and sdcard configs for the
|
||||||
|
@ -302,7 +302,7 @@ void init(void)
|
||||||
// the system to boot and/or to save the config.
|
// the system to boot and/or to save the config.
|
||||||
//
|
//
|
||||||
// note that target specific SDCARD/SDIO/SPI/QUADSPI configs are
|
// note that target specific SDCARD/SDIO/SPI/QUADSPI configs are
|
||||||
// also not supported in USE_TARGET_CONFIG/targetConfigure() when using EEPROM_IN_SDCARD.
|
// also not supported in USE_TARGET_CONFIG/targetConfigure() when using CONFIG_IN_SDCARD.
|
||||||
//
|
//
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -312,7 +312,7 @@ void init(void)
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifdef TARGET_BUS_INIT
|
#ifdef TARGET_BUS_INIT
|
||||||
#error "EEPROM_IN_SDCARD and TARGET_BUS_INIT are mutually exclusive"
|
#error "CONFIG_IN_SDCARD and TARGET_BUS_INIT are mutually exclusive"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
pgResetAll();
|
pgResetAll();
|
||||||
|
@ -336,9 +336,9 @@ void init(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // EEPROM_IN_SDCARD
|
#endif // CONFIG_IN_SDCARD
|
||||||
|
|
||||||
#ifdef EEPROM_IN_EXTERNAL_FLASH
|
#ifdef CONFIG_IN_EXTERNAL_FLASH
|
||||||
//
|
//
|
||||||
// Config on external flash presents an issue with pin configuration since the pin and flash configs for the
|
// Config on external flash presents an issue with pin configuration since the pin and flash configs for the
|
||||||
// external flash are in the config which is on a chip which we can't read yet!
|
// external flash are in the config which is on a chip which we can't read yet!
|
||||||
|
@ -349,7 +349,7 @@ void init(void)
|
||||||
// the system to boot and/or to save the config.
|
// the system to boot and/or to save the config.
|
||||||
//
|
//
|
||||||
// note that target specific FLASH/SPI/QUADSPI configs are
|
// note that target specific FLASH/SPI/QUADSPI configs are
|
||||||
// also not supported in USE_TARGET_CONFIG/targetConfigure() when using EEPROM_IN_EXTERNAL_FLASH.
|
// also not supported in USE_TARGET_CONFIG/targetConfigure() when using CONFIG_IN_EXTERNAL_FLASH.
|
||||||
//
|
//
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -360,7 +360,7 @@ void init(void)
|
||||||
pgResetAll();
|
pgResetAll();
|
||||||
|
|
||||||
#ifdef TARGET_BUS_INIT
|
#ifdef TARGET_BUS_INIT
|
||||||
#error "EEPROM_IN_EXTERNAL_FLASH and TARGET_BUS_INIT are mutually exclusive"
|
#error "CONFIG_IN_EXTERNAL_FLASH and TARGET_BUS_INIT are mutually exclusive"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
configureSPIAndQuadSPI();
|
configureSPIAndQuadSPI();
|
||||||
|
@ -368,7 +368,7 @@ void init(void)
|
||||||
|
|
||||||
|
|
||||||
#ifndef USE_FLASH_CHIP
|
#ifndef USE_FLASH_CHIP
|
||||||
#error "EEPROM_IN_EXTERNAL_FLASH requires USE_FLASH_CHIP to be defined."
|
#error "CONFIG_IN_EXTERNAL_FLASH requires USE_FLASH_CHIP to be defined."
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool haveFlash = flashInit(flashConfig());
|
bool haveFlash = flashInit(flashConfig());
|
||||||
|
@ -378,7 +378,7 @@ void init(void)
|
||||||
}
|
}
|
||||||
initFlags |= FLASH_INIT_ATTEMPTED;
|
initFlags |= FLASH_INIT_ATTEMPTED;
|
||||||
|
|
||||||
#endif // EEPROM_IN_EXTERNAL_FLASH
|
#endif // CONFIG_IN_EXTERNAL_FLASH
|
||||||
|
|
||||||
initEEPROM();
|
initEEPROM();
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
|
|
||||||
// file name to save config
|
// file name to save config
|
||||||
#define EEPROM_FILENAME "eeprom.bin"
|
#define EEPROM_FILENAME "eeprom.bin"
|
||||||
#define EEPROM_IN_FILE
|
#define CONFIG_IN_FILE
|
||||||
#define EEPROM_SIZE 32768
|
#define EEPROM_SIZE 32768
|
||||||
|
|
||||||
#define U_ID_0 0
|
#define U_ID_0 0
|
||||||
|
|
|
@ -59,10 +59,10 @@
|
||||||
#define QUADSPI1_CS_FLAGS (QUADSPI_BK1_CS_HARDWARE | QUADSPI_BK2_CS_NONE | QUADSPI_CS_MODE_LINKED)
|
#define QUADSPI1_CS_FLAGS (QUADSPI_BK1_CS_HARDWARE | QUADSPI_BK2_CS_NONE | QUADSPI_CS_MODE_LINKED)
|
||||||
|
|
||||||
#define USE_FLASH_CHIP
|
#define USE_FLASH_CHIP
|
||||||
#define EEPROM_IN_EXTERNAL_FLASH
|
#define CONFIG_IN_EXTERNAL_FLASH
|
||||||
//#define EEPROM_IN_SDCARD
|
//#define CONFIG_IN_SDCARD
|
||||||
//#define EEPROM_IN_RAM
|
//#define CONFIG_IN_RAM
|
||||||
#if !defined(EEPROM_IN_RAM) && !defined(EEPROM_IN_SDCARD) && !defined(EEPROM_IN_EXTERNAL_FLASH)
|
#if !defined(CONFIG_IN_RAM) && !defined(CONFIG_IN_SDCARD) && !defined(CONFIG_IN_EXTERNAL_FLASH)
|
||||||
#error "EEPROM storage location not defined"
|
#error "EEPROM storage location not defined"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -61,10 +61,10 @@
|
||||||
#define QUADSPI1_CS_FLAGS (QUADSPI_BK1_CS_NONE | QUADSPI_BK2_CS_SOFTWARE | QUADSPI_CS_MODE_SEPARATE)
|
#define QUADSPI1_CS_FLAGS (QUADSPI_BK1_CS_NONE | QUADSPI_BK2_CS_SOFTWARE | QUADSPI_CS_MODE_SEPARATE)
|
||||||
|
|
||||||
#define USE_FLASH_CHIP
|
#define USE_FLASH_CHIP
|
||||||
#define EEPROM_IN_EXTERNAL_FLASH
|
#define CONFIG_IN_EXTERNAL_FLASH
|
||||||
//#define EEPROM_IN_SDCARD
|
//#define CONFIG_IN_SDCARD
|
||||||
//#define EEPROM_IN_RAM
|
//#define CONFIG_IN_RAM
|
||||||
#if !defined(EEPROM_IN_RAM) && !defined(EEPROM_IN_SDCARD) && !defined(EEPROM_IN_EXTERNAL_FLASH)
|
#if !defined(CONFIG_IN_RAM) && !defined(CONFIG_IN_SDCARD) && !defined(CONFIG_IN_EXTERNAL_FLASH)
|
||||||
#error "EEPROM storage location not defined"
|
#error "EEPROM storage location not defined"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -61,10 +61,10 @@
|
||||||
#define QUADSPI1_CS_FLAGS (QUADSPI_BK1_CS_HARDWARE | QUADSPI_BK2_CS_NONE | QUADSPI_CS_MODE_LINKED)
|
#define QUADSPI1_CS_FLAGS (QUADSPI_BK1_CS_HARDWARE | QUADSPI_BK2_CS_NONE | QUADSPI_CS_MODE_LINKED)
|
||||||
|
|
||||||
#define USE_FLASH_CHIP
|
#define USE_FLASH_CHIP
|
||||||
#define EEPROM_IN_EXTERNAL_FLASH
|
#define CONFIG_IN_EXTERNAL_FLASH
|
||||||
//#define EEPROM_IN_SDCARD
|
//#define CONFIG_IN_SDCARD
|
||||||
//#define EEPROM_IN_RAM
|
//#define CONFIG_IN_RAM
|
||||||
#if !defined(EEPROM_IN_RAM) && !defined(EEPROM_IN_SDCARD) && !defined(EEPROM_IN_EXTERNAL_FLASH)
|
#if !defined(CONFIG_IN_RAM) && !defined(CONFIG_IN_SDCARD) && !defined(CONFIG_IN_EXTERNAL_FLASH)
|
||||||
#error "EEPROM storage location not defined"
|
#error "EEPROM storage location not defined"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -346,7 +346,7 @@
|
||||||
#undef USE_ESCSERIAL
|
#undef USE_ESCSERIAL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(EEPROM_IN_RAM) || defined(EEPROM_IN_FILE) || defined(EEPROM_IN_EXTERNAL_FLASH) || defined(EEPROM_IN_SDCARD)
|
#if defined(CONFIG_IN_RAM) || defined(CONFIG_IN_FILE) || defined(CONFIG_IN_EXTERNAL_FLASH) || defined(CONFIG_IN_SDCARD)
|
||||||
#ifndef EEPROM_SIZE
|
#ifndef EEPROM_SIZE
|
||||||
#define EEPROM_SIZE 4096
|
#define EEPROM_SIZE 4096
|
||||||
#endif
|
#endif
|
||||||
|
@ -354,8 +354,8 @@ extern uint8_t eepromData[EEPROM_SIZE];
|
||||||
#define __config_start (*eepromData)
|
#define __config_start (*eepromData)
|
||||||
#define __config_end (*ARRAYEND(eepromData))
|
#define __config_end (*ARRAYEND(eepromData))
|
||||||
#else
|
#else
|
||||||
#ifndef EEPROM_IN_FLASH
|
#ifndef CONFIG_IN_FLASH
|
||||||
#define EEPROM_IN_FLASH
|
#define CONFIG_IN_FLASH
|
||||||
#endif
|
#endif
|
||||||
extern uint8_t __config_start; // configured via linker script when building binaries.
|
extern uint8_t __config_start; // configured via linker script when building binaries.
|
||||||
extern uint8_t __config_end;
|
extern uint8_t __config_end;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue