refactoring related to RED FATAL/CRITICAL LED is a bit dim when it should be OFF

#157
This commit is contained in:
rusefi 2020-05-11 18:22:51 -04:00
parent 7d4c86db9f
commit a88b41a8d0
4 changed files with 12 additions and 12 deletions

View File

@ -80,8 +80,8 @@
#undef TS_SERIAL_AF #undef TS_SERIAL_AF
#define TS_SERIAL_AF 8 #define TS_SERIAL_AF 8
#undef LED_ERROR_BRAIN_PIN #undef LED_CRITICAL_ERROR_BRAIN_PIN
#define LED_ERROR_BRAIN_PIN GPIOA_13 #define LED_CRITICAL_ERROR_BRAIN_PIN GPIOA_13
#undef CONSOLE_MODE_SWITCH_PORT #undef CONSOLE_MODE_SWITCH_PORT
#undef CONFIG_RESET_SWITCH_PORT #undef CONFIG_RESET_SWITCH_PORT

View File

@ -368,8 +368,8 @@
// todo: this should be detected automatically based on pin selection // todo: this should be detected automatically based on pin selection
#define TS_SERIAL_AF 7 #define TS_SERIAL_AF 7
#ifndef LED_ERROR_BRAIN_PIN #ifndef LED_CRITICAL_ERROR_BRAIN_PIN
#define LED_ERROR_BRAIN_PIN GPIOD_14 #define LED_CRITICAL_ERROR_BRAIN_PIN GPIOD_14
#endif #endif
// USART1 -> check defined STM32_SERIAL_USE_USART1 // USART1 -> check defined STM32_SERIAL_USE_USART1

View File

@ -64,14 +64,14 @@ char *getFirmwareError(void) {
#if EFI_PROD_CODE #if EFI_PROD_CODE
extern ioportid_t errorLedPort; extern ioportid_t criticalErrorLedPort;
extern ioportmask_t errorLedPin; extern ioportmask_t criticalErrorLedPin;
/** /**
* low-level function is used here to reduce stack usage * low-level function is used here to reduce stack usage
*/ */
#define ON_CRITICAL_ERROR() \ #define ON_CRITICAL_ERROR() \
palWritePad(errorLedPort, errorLedPin, 1); \ palWritePad(criticalErrorLedPort, criticalErrorLedPin, 1); \
turnAllPinsOff(); \ turnAllPinsOff(); \
enginePins.communicationLedPin.setValue(1); enginePins.communicationLedPin.setValue(1);
#endif /* EFI_PROD_CODE */ #endif /* EFI_PROD_CODE */

View File

@ -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 // 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 // by reducing stack requirement
ioportid_t errorLedPort; ioportid_t criticalErrorLedPort;
ioportmask_t errorLedPin; ioportmask_t criticalErrorLedPin;
void initPrimaryPins(Logging *sharedLogger) { void initPrimaryPins(Logging *sharedLogger) {
logger = sharedLogger; logger = sharedLogger;
#if EFI_PROD_CODE #if EFI_PROD_CODE
enginePins.errorLedPin.initPin("led: ERROR status", LED_ERROR_BRAIN_PIN); enginePins.errorLedPin.initPin("led: CRITICAL status", LED_CRITICAL_ERROR_BRAIN_PIN);
errorLedPort = getHwPort("primary", LED_ERROR_BRAIN_PIN); criticalErrorLedPort = getHwPort("CRITICAL", LED_CRITICAL_ERROR_BRAIN_PIN);
errorLedPin = getHwPin("primary", LED_ERROR_BRAIN_PIN); criticalErrorLedPin = getHwPin("CRITICAL", LED_CRITICAL_ERROR_BRAIN_PIN);
#endif /* EFI_PROD_CODE */ #endif /* EFI_PROD_CODE */
} }