shared define for all LED pin mode

This commit is contained in:
Matthew Kennedy 2023-06-04 23:32:14 -07:00
parent 9ec7c7f12c
commit 75e57b1821
7 changed files with 10 additions and 32 deletions

View File

@ -4,10 +4,7 @@
BOARDCPPSRC += $(BOARDS_DIR)/hellen/hellen_common.cpp \
$(BOARDS_DIR)/hellen/hellen_board_id.cpp
DDEFS += -DLED_ERROR_BRAIN_PIN_MODE=OM_INVERTED
DDEFS += -DLED_RUNING_BRAIN_PIN_MODE=OM_INVERTED
DDEFS += -DLED_WARNING_BRAIN_PIN_MODE=OM_INVERTED
DDEFS += -DLED_COMMUNICATION_BRAIN_PIN_MODE=OM_INVERTED
DDEFS += -DLED_PIN_MODE=OM_INVERTED
# We are running on Hellen-One hardware!
DDEFS += -DHW_HELLEN=1

View File

@ -64,8 +64,6 @@
#undef LED_CRITICAL_ERROR_BRAIN_PIN
#define LED_CRITICAL_ERROR_BRAIN_PIN Gpio::A13
#undef LED_ERROR_BRAIN_PIN_MODE
#define LED_ERROR_BRAIN_PIN_MODE OM_DEFAULT
#undef CONSOLE_MODE_SWITCH_PORT
#undef CONFIG_RESET_SWITCH_PORT

View File

@ -12,14 +12,6 @@
#ifndef EFIFEATURES_SUBARUEG33_H_
#define EFIFEATURES_SUBARUEG33_H_
/* LEDs */
#undef LED_ERROR_BRAIN_PIN_MODE
#define LED_ERROR_BRAIN_PIN_MODE OM_DEFAULT
#undef LED_WARNING_BRAIN_PIN_MODE
#define LED_WARNING_BRAIN_PIN_MODE OM_DEFAULT
#undef LED_RUNING_BRAIN_PIN_MODE
#define LED_RUNING_BRAIN_PIN_MODE OM_DEFAULT
/* debug console */
#define TS_PRIMARY_UxART_PORT SD1

View File

@ -378,9 +378,6 @@
#ifndef LED_CRITICAL_ERROR_BRAIN_PIN
#define LED_CRITICAL_ERROR_BRAIN_PIN Gpio::D14
#endif
#ifndef LED_ERROR_BRAIN_PIN_MODE
#define LED_ERROR_BRAIN_PIN_MODE OM_DEFAULT
#endif
#ifndef CONFIG_RESET_SWITCH_PORT
// looks like this feature is not extremely popular, we can try living without it now :)

View File

@ -85,15 +85,9 @@ extern WaveChart waveChart;
#include "sensor_chart.h"
#ifndef LED_WARNING_BRAIN_PIN_MODE
#define LED_WARNING_BRAIN_PIN_MODE OM_DEFAULT
#endif
#ifndef LED_RUNING_BRAIN_PIN_MODE
#define LED_RUNING_BRAIN_PIN_MODE OM_DEFAULT
#endif
#ifndef LED_COMMUNICATION_BRAIN_PIN_MODE
#define LED_COMMUNICATION_BRAIN_PIN_MODE OM_DEFAULT
#endif
#define LED_WARNING_BRAIN_PIN_MODE LED_PIN_MODE
#define LED_RUNING_BRAIN_PIN_MODE LED_PIN_MODE
#define LED_COMMUNICATION_BRAIN_PIN_MODE LED_PIN_MODE
int warningEnabled = true;

View File

@ -682,16 +682,12 @@ ioportid_t criticalErrorLedPort;
ioportmask_t criticalErrorLedPin;
uint8_t criticalErrorLedState;
#ifndef LED_ERROR_BRAIN_PIN_MODE
#define LED_ERROR_BRAIN_PIN_MODE OM_DEFAULT
#endif /* LED_ERROR_BRAIN_PIN_MODE */
#if EFI_PROD_CODE
static void initErrorLed(Gpio led) {
enginePins.errorLedPin.initPin("led: CRITICAL status", led, (LED_ERROR_BRAIN_PIN_MODE));
enginePins.errorLedPin.initPin("led: CRITICAL status", led, (LED_PIN_MODE));
criticalErrorLedPort = getHwPort("CRITICAL", led);
criticalErrorLedPin = getHwPin("CRITICAL", led);
criticalErrorLedState = (LED_ERROR_BRAIN_PIN_MODE == OM_INVERTED) ? 0 : 1;
criticalErrorLedState = (LED_PIN_MODE == OM_INVERTED) ? 0 : 1;
}
#endif /* EFI_PROD_CODE */

View File

@ -164,3 +164,7 @@ void printSpiConfig(const char *msg, spi_device_e device);
brain_pin_e parseBrainPin(const char *str);
extern EnginePins enginePins;
#ifndef LED_PIN_MODE
#define LED_PIN_MODE OM_DEFAULT
#endif /* LED_PIN_MODE */