refactoring related to RED FATAL/CRITICAL LED is a bit dim when it should be OFF
#157
This commit is contained in:
parent
e5db74c3ee
commit
047d2e0ce1
|
@ -315,7 +315,7 @@
|
|||
|
||||
#define LED_WARNING_BRAIN_PIN GPIOD_13
|
||||
|
||||
#define LED_ERROR_BRAIN_PIN GPIOD_14
|
||||
#define LED_CRITICAL_ERROR_BRAIN_PIN GPIOD_14
|
||||
|
||||
#define EFI_WARNING_LED FALSE
|
||||
|
||||
|
|
|
@ -80,8 +80,8 @@
|
|||
#undef TS_SERIAL_AF
|
||||
#define TS_SERIAL_AF 8
|
||||
|
||||
#undef LED_ERROR_BRAIN_PIN
|
||||
#define LED_ERROR_BRAIN_PIN GPIOA_13
|
||||
#undef LED_CRITICAL_ERROR_BRAIN_PIN
|
||||
#define LED_CRITICAL_ERROR_BRAIN_PIN GPIOA_13
|
||||
|
||||
#undef CONSOLE_MODE_SWITCH_PORT
|
||||
#undef CONFIG_RESET_SWITCH_PORT
|
||||
|
|
|
@ -316,8 +316,8 @@
|
|||
#undef EFI_CONSOLE_SERIAL_DEVICE
|
||||
#endif
|
||||
|
||||
#ifndef LED_ERROR_BRAIN_PIN
|
||||
#define LED_ERROR_BRAIN_PIN GPIOD_14
|
||||
#ifndef LED_CRITICAL_ERROR_BRAIN_PIN
|
||||
#define LED_CRITICAL_ERROR_BRAIN_PIN GPIOD_14
|
||||
#endif
|
||||
|
||||
// USART1 -> check defined STM32_SERIAL_USE_USART1
|
||||
|
|
|
@ -368,8 +368,8 @@
|
|||
// todo: this should be detected automatically based on pin selection
|
||||
#define TS_SERIAL_AF 7
|
||||
|
||||
#ifndef LED_ERROR_BRAIN_PIN
|
||||
#define LED_ERROR_BRAIN_PIN GPIOD_14
|
||||
#ifndef LED_CRITICAL_ERROR_BRAIN_PIN
|
||||
#define LED_CRITICAL_ERROR_BRAIN_PIN GPIOD_14
|
||||
#endif
|
||||
|
||||
// USART1 -> check defined STM32_SERIAL_USE_USART1
|
||||
|
|
|
@ -64,14 +64,14 @@ char *getFirmwareError(void) {
|
|||
|
||||
#if EFI_PROD_CODE
|
||||
|
||||
extern ioportid_t errorLedPort;
|
||||
extern ioportmask_t errorLedPin;
|
||||
extern ioportid_t criticalErrorLedPort;
|
||||
extern ioportmask_t criticalErrorLedPin;
|
||||
|
||||
/**
|
||||
* low-level function is used here to reduce stack usage
|
||||
*/
|
||||
#define ON_CRITICAL_ERROR() \
|
||||
palWritePad(errorLedPort, errorLedPin, 1); \
|
||||
palWritePad(criticalErrorLedPort, criticalErrorLedPin, 1); \
|
||||
turnAllPinsOff(); \
|
||||
enginePins.communicationLedPin.setValue(1);
|
||||
#endif /* EFI_PROD_CODE */
|
||||
|
|
|
@ -501,15 +501,15 @@ void OutputPin::unregisterOutput(brain_pin_e oldPin) {
|
|||
|
||||
// questionable trick: we avoid using 'getHwPort' and 'getHwPin' in case of errors in order to increase the changes of turning the LED
|
||||
// by reducing stack requirement
|
||||
ioportid_t errorLedPort;
|
||||
ioportmask_t errorLedPin;
|
||||
ioportid_t criticalErrorLedPort;
|
||||
ioportmask_t criticalErrorLedPin;
|
||||
|
||||
void initPrimaryPins(Logging *sharedLogger) {
|
||||
logger = sharedLogger;
|
||||
#if EFI_PROD_CODE
|
||||
enginePins.errorLedPin.initPin("led: ERROR status", LED_ERROR_BRAIN_PIN);
|
||||
errorLedPort = getHwPort("primary", LED_ERROR_BRAIN_PIN);
|
||||
errorLedPin = getHwPin("primary", LED_ERROR_BRAIN_PIN);
|
||||
enginePins.errorLedPin.initPin("led: CRITICAL status", LED_CRITICAL_ERROR_BRAIN_PIN);
|
||||
criticalErrorLedPort = getHwPort("CRITICAL", LED_CRITICAL_ERROR_BRAIN_PIN);
|
||||
criticalErrorLedPin = getHwPin("CRITICAL", LED_CRITICAL_ERROR_BRAIN_PIN);
|
||||
#endif /* EFI_PROD_CODE */
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue