Merge remote-tracking branch 'origin/Hellen_fork_point' into master

# Conflicts:
#	firmware/controllers/core/error_handling.cpp
#	firmware/controllers/system/efi_gpio.cpp
This commit is contained in:
rusefi 2020-09-09 18:23:04 -04:00
commit 41cecd15eb
2 changed files with 11 additions and 3 deletions

View File

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

View File

@ -32,7 +32,8 @@ extern WaveChart waveChart;
EnginePins enginePins;
static Logging* logger;
static const pin_output_mode_e DEFAULT_OUTPUT = OM_DEFAULT;
static pin_output_mode_e DEFAULT_OUTPUT = OM_DEFAULT;
pin_output_mode_e INVERTED_OUTPUT = OM_INVERTED;
static const char *sparkNames[] = { "Coil 1", "Coil 2", "Coil 3", "Coil 4", "Coil 5", "Coil 6", "Coil 7", "Coil 8",
"Coil 9", "Coil 10", "Coil 11", "Coil 12"};
@ -498,13 +499,19 @@ void OutputPin::unregisterOutput(brain_pin_e oldPin) {
// by reducing stack requirement
ioportid_t criticalErrorLedPort;
ioportmask_t criticalErrorLedPin;
uint8_t criticalErrorLedState;
#ifndef LED_ERROR_BRAIN_PIN_MODE
#define LED_ERROR_BRAIN_PIN_MODE DEFAULT_OUTPUT
#endif /* LED_ERROR_BRAIN_PIN_MODE */
void initPrimaryPins(Logging *sharedLogger) {
logger = sharedLogger;
#if EFI_PROD_CODE
enginePins.errorLedPin.initPin("led: CRITICAL status", LED_CRITICAL_ERROR_BRAIN_PIN);
enginePins.errorLedPin.initPin("led: CRITICAL status", LED_CRITICAL_ERROR_BRAIN_PIN, &(LED_ERROR_BRAIN_PIN_MODE));
criticalErrorLedPort = getHwPort("CRITICAL", LED_CRITICAL_ERROR_BRAIN_PIN);
criticalErrorLedPin = getHwPin("CRITICAL", LED_CRITICAL_ERROR_BRAIN_PIN);
criticalErrorLedState = (LED_ERROR_BRAIN_PIN_MODE == INVERTED_OUTPUT) ? 0 : 1;
#endif /* EFI_PROD_CODE */
}