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