mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-14 11:59:58 +03:00
Merge branch 'fix_custom_defaults_addresses' into add_custom_defaults_to_msp
This commit is contained in:
commit
36dc7306e2
4 changed files with 15 additions and 15 deletions
|
@ -34,13 +34,6 @@ SECTIONS
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
} >FLASH AT >AXIM_FLASH
|
} >FLASH AT >AXIM_FLASH
|
||||||
|
|
||||||
/* Storage for the address for the configuration section so we can grab it out of the hex file */
|
|
||||||
.custom_defaults :
|
|
||||||
{
|
|
||||||
. = ALIGN(4);
|
|
||||||
*(.custom_defaults_address)
|
|
||||||
} >FLASH1 AT >AXIM_FLASH1
|
|
||||||
|
|
||||||
/* The program code and other data goes into FLASH */
|
/* The program code and other data goes into FLASH */
|
||||||
.text :
|
.text :
|
||||||
{
|
{
|
||||||
|
@ -103,7 +96,9 @@ SECTIONS
|
||||||
.custom_defaults :
|
.custom_defaults :
|
||||||
{
|
{
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
KEEP (*(.custom_defaults_address))
|
KEEP (*(.custom_defaults_start_address))
|
||||||
|
. = ALIGN(4);
|
||||||
|
KEEP (*(.custom_defaults_end_address))
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
__custom_defaults_internal_start = .;
|
__custom_defaults_internal_start = .;
|
||||||
*(.custom_defaults);
|
*(.custom_defaults);
|
||||||
|
|
|
@ -120,14 +120,16 @@ SECTIONS
|
||||||
.custom_defaults :
|
.custom_defaults :
|
||||||
{
|
{
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
KEEP (*(.custom_defaults_address))
|
KEEP (*(.custom_defaults_start_address))
|
||||||
|
. = ALIGN(4);
|
||||||
|
KEEP (*(.custom_defaults_end_address))
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
__custom_defaults_internal_start = .;
|
__custom_defaults_internal_start = .;
|
||||||
*(.custom_defaults);
|
*(.custom_defaults);
|
||||||
} >FLASH_CUSTOM_DEFAULTS
|
} >FLASH_CUSTOM_DEFAULTS
|
||||||
|
|
||||||
PROVIDE_HIDDEN (__custom_defaults_start = DEFINED(USE_CUSTOM_DEFAULTS_EXTENDED) ? ORIGIN(FLASH_CUSTOM_DEFAULTS_EXTENDED) : __custom_defaults_internal_start);
|
PROVIDE_HIDDEN (__custom_defaults_start = DEFINED(USE_CUSTOM_DEFAULTS_EXTENDED) ? ORIGIN(FLASH_CUSTOM_DEFAULTS_EXTENDED) : __custom_defaults_internal_start);
|
||||||
PROVIDE_HIDDEN (__custom_defaults_end = DEFINED(USE_CUSTOM_DEFAULTS_EXTENDED) ? ORIGIN(FLASH_CUSTOM_DEFAULTS_EXTENDED) + LENGTH(FLASH_CUSTOM_DEFAULTS_EXTENDED) : ORIGIN(FLASH_CUSTOM_DEFAULTS) + LENGTH(FLASH_CUSTOM_DEFAULTS));
|
PROVIDE_HIDDEN (__custom_defaults_end = DEFINED(USE_CUSTOM_DEFAULTS_EXTENDED) ? ORIGIN(FLASH_CUSTOM_DEFAULTS_EXTENDED) + LENGTH(FLASH_CUSTOM_DEFAULTS_EXTENDED) : ORIGIN(FLASH_CUSTOM_DEFAULTS) + LENGTH(FLASH_CUSTOM_DEFAULTS));
|
||||||
|
|
||||||
/* used by the startup to initialize data */
|
/* used by the startup to initialize data */
|
||||||
_sidata = LOADADDR(.data);
|
_sidata = LOADADDR(.data);
|
||||||
|
|
|
@ -228,8 +228,8 @@ static char cliBufferTemp[CLI_IN_BUFFER_SIZE];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(USE_CUSTOM_DEFAULTS_ADDRESS)
|
#if defined(USE_CUSTOM_DEFAULTS_ADDRESS)
|
||||||
static char __attribute__ ((section(".custom_defaults_address"))) *customDefaultsStart = CUSTOM_DEFAULTS_START;
|
static char __attribute__ ((section(".custom_defaults_start_address"))) *customDefaultsStart = CUSTOM_DEFAULTS_START;
|
||||||
static char __attribute__ ((section(".custom_defaults_address"))) *customDefaultsEnd = CUSTOM_DEFAULTS_END;
|
static char __attribute__ ((section(".custom_defaults_end_address"))) *customDefaultsEnd = CUSTOM_DEFAULTS_END;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef USE_QUAD_MIXER_ONLY
|
#ifndef USE_QUAD_MIXER_ONLY
|
||||||
|
@ -4140,7 +4140,7 @@ static bool doSave(void)
|
||||||
{
|
{
|
||||||
#if defined(USE_CUSTOM_DEFAULTS)
|
#if defined(USE_CUSTOM_DEFAULTS)
|
||||||
if (processingCustomDefaults) {
|
if (processingCustomDefaults) {
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -4174,12 +4174,15 @@ static void cliSave(char *cmdline)
|
||||||
{
|
{
|
||||||
UNUSED(cmdline);
|
UNUSED(cmdline);
|
||||||
|
|
||||||
|
#if defined(USE_CLI_BATCH)
|
||||||
if (!doSave()) {
|
if (!doSave()) {
|
||||||
cliPrintCommandBatchWarning("PLEASE FIX ERRORS THEN 'SAVE'");
|
cliPrintCommandBatchWarning("PLEASE FIX ERRORS THEN 'SAVE'");
|
||||||
resetCommandBatch();
|
resetCommandBatch();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
} else {
|
} else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
cliPrintHashLine("saving");
|
cliPrintHashLine("saving");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -265,7 +265,7 @@ void beeperOffSet(uint32_t) {}
|
||||||
void beeperOffClear(uint32_t) {}
|
void beeperOffClear(uint32_t) {}
|
||||||
void beeperOffClearAll(void) {}
|
void beeperOffClearAll(void) {}
|
||||||
bool parseColor(int, const char *) {return false; }
|
bool parseColor(int, const char *) {return false; }
|
||||||
void resetEEPROM(bool) {}
|
bool resetEEPROM(bool) { return true; }
|
||||||
void bufWriterFlush(bufWriter_t *) {}
|
void bufWriterFlush(bufWriter_t *) {}
|
||||||
void mixerResetDisarmedMotors(void) {}
|
void mixerResetDisarmedMotors(void) {}
|
||||||
void gpsEnablePassthrough(struct serialPort_s *) {}
|
void gpsEnablePassthrough(struct serialPort_s *) {}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue