mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-13 19:40:31 +03:00
Renamed things to make them more understandable.
This commit is contained in:
parent
2c8d197ccb
commit
35e075098d
6 changed files with 29 additions and 23 deletions
|
@ -106,13 +106,11 @@ SECTIONS
|
|||
KEEP (*(.custom_defaults_address))
|
||||
. = ALIGN(4);
|
||||
__custom_defaults_internal_start = .;
|
||||
KEEP (*(.custom_defaults));
|
||||
. = ORIGIN(FLASH_CUSTOM_DEFAULTS) + LENGTH(FLASH_CUSTOM_DEFAULTS);
|
||||
__custom_defaults_internal_end = .;
|
||||
*(.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_end = DEFINED(USE_CUSTOM_DEFAULTS_EXTENDED) ? ORIGIN(FLASH_CUSTOM_DEFAULTS_EXTENDED) + LENGTH(FLASH_CUSTOM_DEFAULTS_EXTENDED) : __custom_defaults_internal_end);
|
||||
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 */
|
||||
_sidata = LOADADDR(.data);
|
||||
|
|
|
@ -123,13 +123,11 @@ SECTIONS
|
|||
KEEP (*(.custom_defaults_address))
|
||||
. = ALIGN(4);
|
||||
__custom_defaults_internal_start = .;
|
||||
KEEP (*(.custom_defaults));
|
||||
. = ORIGIN(FLASH_CUSTOM_DEFAULTS) + LENGTH(FLASH_CUSTOM_DEFAULTS);
|
||||
__custom_defaults_internal_end = .;
|
||||
*(.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_end = DEFINED(USE_CUSTOM_DEFAULTS_EXTENDED) ? ORIGIN(FLASH_CUSTOM_DEFAULTS_EXTENDED) + LENGTH(FLASH_CUSTOM_DEFAULTS_EXTENDED) : __custom_defaults_internal_end);
|
||||
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 */
|
||||
_sidata = LOADADDR(.data);
|
||||
|
|
|
@ -225,8 +225,10 @@ static bool processingCustomDefaults = false;
|
|||
static char cliBufferTemp[CLI_IN_BUFFER_SIZE];
|
||||
#endif
|
||||
|
||||
#if defined(USE_CUSTOM_DEFAULTS_ADDRESS)
|
||||
static char __attribute__ ((section(".custom_defaults_address"))) *customDefaultsStart = CUSTOM_DEFAULTS_START;
|
||||
static char __attribute__ ((section(".custom_defaults_address"))) *customDefaultsEnd = CUSTOM_DEFAULTS_END;
|
||||
#endif
|
||||
|
||||
#ifndef USE_QUAD_MIXER_ONLY
|
||||
// sync this with mixerMode_e
|
||||
|
@ -4186,7 +4188,7 @@ static void cliDefaults(char *cmdline)
|
|||
bool saveConfigs = true;
|
||||
#if defined(USE_CUSTOM_DEFAULTS)
|
||||
bool useCustomDefaults = true;
|
||||
#else
|
||||
#elif defined(USE_CUSTOM_DEFAULTS_ADDRESS)
|
||||
// Required to keep the linker from eliminating these
|
||||
if (customDefaultsStart != customDefaultsEnd) {
|
||||
delay(0);
|
||||
|
@ -4200,14 +4202,14 @@ static void cliDefaults(char *cmdline)
|
|||
} else if (strncasecmp(cmdline, "bare", 4) == 0) {
|
||||
useCustomDefaults = false;
|
||||
} else if (strncasecmp(cmdline, "show", 4) == 0) {
|
||||
char *ptr = customDefaultsStart;
|
||||
if (isDefaults(ptr)) {
|
||||
while (*ptr && ptr < customDefaultsEnd) {
|
||||
if (*ptr != '\n') {
|
||||
cliPrintf("%c", *ptr++);
|
||||
char *customDefaultsPtr = customDefaultsStart;
|
||||
if (isDefaults(customDefaultsPtr)) {
|
||||
while (*customDefaultsPtr && *customDefaultsPtr != 0xFF && customDefaultsPtr < customDefaultsEnd) {
|
||||
if (*customDefaultsPtr != '\n') {
|
||||
cliPrintf("%c", *customDefaultsPtr++);
|
||||
} else {
|
||||
cliPrintLinefeed();
|
||||
ptr++;
|
||||
customDefaultsPtr++;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -6316,7 +6318,7 @@ static void cliHelp(char *cmdline)
|
|||
}
|
||||
}
|
||||
|
||||
static void processCommandCharacter(const char c)
|
||||
static void processCharacter(const char c)
|
||||
{
|
||||
if (bufferIndex && (c == '\n' || c == '\r')) {
|
||||
// enter pressed
|
||||
|
@ -6375,7 +6377,7 @@ static void processCommandCharacter(const char c)
|
|||
}
|
||||
}
|
||||
|
||||
static void processCharacter(const char c)
|
||||
static void processCharacterInteractive(const char c)
|
||||
{
|
||||
if (c == '\t' || c == '?') {
|
||||
// do tab completion
|
||||
|
@ -6429,7 +6431,7 @@ static void processCharacter(const char c)
|
|||
cliPrint("\010 \010");
|
||||
}
|
||||
} else {
|
||||
processCommandCharacter(c);
|
||||
processCharacter(c);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6445,7 +6447,7 @@ void cliProcess(void)
|
|||
while (serialRxBytesWaiting(cliPort)) {
|
||||
uint8_t c = serialRead(cliPort);
|
||||
|
||||
processCharacter(c);
|
||||
processCharacterInteractive(c);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6456,8 +6458,8 @@ void cliProcessCustomDefaults(void)
|
|||
return;
|
||||
}
|
||||
|
||||
char *ptr = customDefaultsStart;
|
||||
if (isDefaults(ptr)) {
|
||||
char *customDefaultsPtr = customDefaultsStart;
|
||||
if (isDefaults(customDefaultsPtr)) {
|
||||
#if !defined(DEBUG_CUSTOM_DEFAULTS)
|
||||
bufWriter_t *cliWriterTemp = cliWriter;
|
||||
cliWriter = NULL;
|
||||
|
@ -6467,8 +6469,8 @@ void cliProcessCustomDefaults(void)
|
|||
bufferIndex = 0;
|
||||
processingCustomDefaults = true;
|
||||
|
||||
while (*ptr && *ptr != 0xFF && ptr < customDefaultsEnd) {
|
||||
processCommandCharacter(*ptr++);
|
||||
while (*customDefaultsPtr && *customDefaultsPtr != 0xFF && customDefaultsPtr < customDefaultsEnd) {
|
||||
processCharacter(*customDefaultsPtr++);
|
||||
}
|
||||
|
||||
processingCustomDefaults = false;
|
||||
|
|
|
@ -26,6 +26,8 @@
|
|||
|
||||
#define USBD_PRODUCT_STRING "KISSFCV2F7"
|
||||
|
||||
#undef USE_CUSTOM_DEFAULTS_ADDRESS
|
||||
|
||||
#define LED0_PIN PA8 // blue
|
||||
#define LED1_PIN PC8 // blingbling
|
||||
#define LED1_INVERTED
|
||||
|
|
|
@ -372,3 +372,7 @@ extern uint8_t __config_end;
|
|||
#ifndef USE_ITERM_RELAX
|
||||
#undef USE_ABSOLUTE_CONTROL
|
||||
#endif
|
||||
|
||||
#if defined(USE_CUSTOM_DEFAULTS)
|
||||
#define USE_CUSTOM_DEFAULTS_ADDRESS
|
||||
#endif
|
||||
|
|
|
@ -67,6 +67,7 @@
|
|||
#define USE_DMA_SPEC
|
||||
#define USE_TIMER_MGMT
|
||||
#define USE_PERSISTENT_OBJECTS
|
||||
#define USE_CUSTOM_DEFAULTS_ADDRESS
|
||||
// Re-enable this after 4.0 has been released, and remove the define from STM32F4DISCOVERY
|
||||
//#define USE_SPI_TRANSACTION
|
||||
|
||||
|
@ -97,6 +98,7 @@
|
|||
#define USE_DMA_SPEC
|
||||
#define USE_TIMER_MGMT
|
||||
#define USE_PERSISTENT_OBJECTS
|
||||
#define USE_CUSTOM_DEFAULTS_ADDRESS
|
||||
// Re-enable this after 4.0 has been released, and remove the define from STM32F4DISCOVERY
|
||||
//#define USE_SPI_TRANSACTION
|
||||
#endif // STM32F7
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue