Cleanup 3 (#745)
* status leds: pick warning LED pin from configuration * wave analyzer: do not init if no pin assigned
This commit is contained in:
parent
b5bd4f646e
commit
e938372a4b
|
@ -70,9 +70,6 @@
|
|||
#undef TS_SERIAL_AF
|
||||
#define TS_SERIAL_AF 8
|
||||
|
||||
#undef LED_WARNING_BRAIN_PIN
|
||||
#define LED_WARNING_BRAIN_PIN GPIOA_13
|
||||
|
||||
#undef LED_ERROR_BRAIN_PIN
|
||||
#define LED_ERROR_BRAIN_PIN GPIOA_13
|
||||
#undef LED_ERROR_PORT
|
||||
|
@ -80,9 +77,6 @@
|
|||
#undef LED_ERROR_PIN
|
||||
#define LED_ERROR_PIN 13
|
||||
|
||||
#undef EFI_WARNING_LED
|
||||
#define EFI_WARNING_LED FALSE
|
||||
|
||||
#undef CONSOLE_MODE_SWITCH_PORT
|
||||
#define CONSOLE_MODE_SWITCH_PORT GPIOE // ???
|
||||
|
||||
|
|
|
@ -348,15 +348,11 @@
|
|||
// todo: this should be detected automatically based on pin selection
|
||||
#define TS_SERIAL_AF 7
|
||||
|
||||
#define LED_WARNING_BRAIN_PIN GPIOD_13
|
||||
|
||||
// LED_ERROR_BRAIN_PIN should match LED_ERROR_PORT/LED_ERROR_PIN
|
||||
#define LED_ERROR_BRAIN_PIN GPIOD_14
|
||||
#define LED_ERROR_PORT GPIOD
|
||||
#define LED_ERROR_PIN 14
|
||||
|
||||
#define EFI_WARNING_LED TRUE
|
||||
|
||||
// USART1 -> check defined STM32_SERIAL_USE_USART1
|
||||
// For GPS we have USART1. We can start with PB7 USART1_RX and PB6 USART1_TX
|
||||
#define GPS_SERIAL_DEVICE &SD1
|
||||
|
|
|
@ -95,9 +95,6 @@
|
|||
#undef EFI_CONSOLE_RX_PIN
|
||||
#define EFI_CONSOLE_RX_PIN 9
|
||||
|
||||
#undef LED_WARNING_BRAIN_PIN
|
||||
#define LED_WARNING_BRAIN_PIN GPIOD_13
|
||||
|
||||
// LED_ERROR_BRAIN_PIN should match LED_ERROR_PORT/LED_ERROR_PIN
|
||||
#undef LED_ERROR_BRAIN_PIN
|
||||
#define LED_ERROR_BRAIN_PIN GPIOB_14
|
||||
|
|
|
@ -550,11 +550,8 @@ static void initStatusLeds(void) {
|
|||
// we initialize this here so that we can blink it on start-up
|
||||
enginePins.checkEnginePin.initPin("MalfunctionIndicator", CONFIGB(malfunctionIndicatorPin), &CONFIGB(malfunctionIndicatorPinMode));
|
||||
|
||||
|
||||
#if EFI_WARNING_LED || defined(__DOXYGEN__)
|
||||
enginePins.warningLedPin.initPin("led: warning status", LED_WARNING_BRAIN_PIN);
|
||||
enginePins.warningLedPin.initPin("led: warning status", engineConfiguration->warninigLedPin);
|
||||
enginePins.runningLedPin.initPin("led: running status", engineConfiguration->runningLedPin);
|
||||
#endif /* EFI_WARNING_LED */
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -120,6 +120,9 @@ static void setWaveModeSilent(int index, int mode) {
|
|||
static void initWave(const char *name, int index) {
|
||||
brain_pin_e brainPin = CONFIGB(logicAnalyzerPins)[index];
|
||||
|
||||
if (brainPin == GPIO_UNASSIGNED)
|
||||
return;
|
||||
|
||||
bool mode = CONFIGB(logicAnalyzerMode)[index];
|
||||
|
||||
waveReaderCount++;
|
||||
|
|
Loading…
Reference in New Issue