CONFIG_RESET_SWITCH_PORT flexibility
This commit is contained in:
parent
17f073a439
commit
05d3ce22f4
|
@ -9,6 +9,7 @@ set EXTRA_PARAMS=-DDUMMY -DSTM32F767xx ^
|
||||||
-DEFI_INJECTOR_PIN3=GPIO_UNASSIGNED ^
|
-DEFI_INJECTOR_PIN3=GPIO_UNASSIGNED ^
|
||||||
-DEFI_COMMUNICATION_PIN=GPIOA_2 ^
|
-DEFI_COMMUNICATION_PIN=GPIOA_2 ^
|
||||||
-DEFI_FATAL_ERROR_PIN=GPIOA_5 ^
|
-DEFI_FATAL_ERROR_PIN=GPIOA_5 ^
|
||||||
|
-DCONFIG_RESET_SWITCH_PORT=NULL ^
|
||||||
-DEFI_ENABLE_ASSERTS=FALSE ^
|
-DEFI_ENABLE_ASSERTS=FALSE ^
|
||||||
-DCH_DBG_THREADS_PROFILING=FALSE
|
-DCH_DBG_THREADS_PROFILING=FALSE
|
||||||
rem set DEBUG_LEVEL_OPT="-O2"
|
rem set DEBUG_LEVEL_OPT="-O2"
|
||||||
|
|
|
@ -46,7 +46,10 @@
|
||||||
|
|
||||||
#define CONSOLE_MAX_ACTIONS 32
|
#define CONSOLE_MAX_ACTIONS 32
|
||||||
|
|
||||||
|
#ifndef CONFIG_RESET_SWITCH_PORT
|
||||||
#define CONFIG_RESET_SWITCH_PORT GPIOD
|
#define CONFIG_RESET_SWITCH_PORT GPIOD
|
||||||
|
#endif
|
||||||
|
|
||||||
#define CONFIG_RESET_SWITCH_PIN 6
|
#define CONFIG_RESET_SWITCH_PIN 6
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -362,8 +362,13 @@
|
||||||
#define GPS_SERIAL_DEVICE &SD1
|
#define GPS_SERIAL_DEVICE &SD1
|
||||||
#define GPS_SERIAL_SPEED 38400
|
#define GPS_SERIAL_SPEED 38400
|
||||||
|
|
||||||
|
#ifndef CONFIG_RESET_SWITCH_PORT
|
||||||
#define CONFIG_RESET_SWITCH_PORT GPIOD
|
#define CONFIG_RESET_SWITCH_PORT GPIOD
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef CONFIG_RESET_SWITCH_PIN
|
||||||
#define CONFIG_RESET_SWITCH_PIN 6
|
#define CONFIG_RESET_SWITCH_PIN 6
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the size of the MemoryStream used by chvprintf
|
* This is the size of the MemoryStream used by chvprintf
|
||||||
|
|
|
@ -24,8 +24,12 @@ typedef void (*CommandHandler)(char *);
|
||||||
#include "efifeatures.h"
|
#include "efifeatures.h"
|
||||||
#include "datalogging.h"
|
#include "datalogging.h"
|
||||||
|
|
||||||
|
#ifdef CONFIG_RESET_SWITCH_PORT
|
||||||
// todo: make this pin configurable
|
// todo: make this pin configurable
|
||||||
#define SHOULD_INGORE_FLASH() (palReadPad(CONFIG_RESET_SWITCH_PORT, CONFIG_RESET_SWITCH_PIN) == 0)
|
#define SHOULD_INGORE_FLASH() (CONFIG_RESET_SWITCH_PORT != NULL && palReadPad(CONFIG_RESET_SWITCH_PORT, CONFIG_RESET_SWITCH_PIN) == 0)
|
||||||
|
#else
|
||||||
|
#define SHOULD_INGORE_FLASH() (false)
|
||||||
|
#endif
|
||||||
|
|
||||||
BaseChannel * getConsoleChannel(void);
|
BaseChannel * getConsoleChannel(void);
|
||||||
|
|
||||||
|
|
|
@ -375,6 +375,8 @@ void initHardware(Logging *l) {
|
||||||
/**
|
/**
|
||||||
* this call reads configuration from flash memory or sets default configuration
|
* this call reads configuration from flash memory or sets default configuration
|
||||||
* if flash state does not look right.
|
* if flash state does not look right.
|
||||||
|
*
|
||||||
|
* interesting fact that we have another read from flash before we get here
|
||||||
*/
|
*/
|
||||||
if (SHOULD_INGORE_FLASH()) {
|
if (SHOULD_INGORE_FLASH()) {
|
||||||
engineConfiguration->engineType = DEFAULT_ENGINE_TYPE;
|
engineConfiguration->engineType = DEFAULT_ENGINE_TYPE;
|
||||||
|
|
Loading…
Reference in New Issue