require LEDs (#5643)

* require all boards to define LED functions (#272)

* require all boards to define LED functions

* f429 nucleo

* small can

* small can

* add to header

* LEDs

---------

Co-authored-by: Matthew Kennedy <matthewkennedy@outlook.com>
Co-authored-by: rusefillc <sdfsdfqsf2334234234>
This commit is contained in:
rusefillc 2023-11-03 12:56:59 -04:00 committed by GitHub
parent fea05d4d80
commit 3b6c9feea5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 155 additions and 18 deletions

View File

@ -112,7 +112,6 @@ jobs:
f407-discovery,
f429-discovery,
core8,
48way,
atlas,
tdg-pdm8,
at_start_f435,
@ -370,10 +369,10 @@ jobs:
ini-file: rusefi_core8.ini
skip-rate: 0
- build-target: 48way
folder: config/boards/48way
ini-file: rusefi_48way.ini
skip-rate: 95
# - build-target: 48way
# folder: config/boards/48way
# ini-file: rusefi_48way.ini
# skip-rate: 95
- build-target: atlas
folder: config/boards/atlas

View File

@ -8,5 +8,10 @@ Gpio getRunningLedPin() {
return Gpio::D14; /* LED3 - yellow */
}
Gpio getWarningLedPin() {
// this board has no warning led
return Gpio::Unassigned;
}
void setBoardConfigOverrides() {
}

View File

@ -1 +1,16 @@
#include "pch.h"
Gpio getCommsLedPin() {
// this board has no comms led
return Gpio::Unassigned;
}
Gpio getWarningLedPin() {
// this board has no warning led
return Gpio::Unassigned;
}
Gpio getRunningLedPin() {
// this board has no running led
return Gpio::Unassigned;
}

View File

@ -10,6 +10,20 @@
#include "pch.h"
#include "trigger_input.h"
Gpio getWarningLedPin() {
// this board has no warning led
return Gpio::Unassigned;
}
Gpio getRunningLedPin() {
return Gpio::Unassigned;
}
Gpio getCommsLedPin() {
// this board has no comms led
return Gpio::Unassigned;
}
void setBoardDefaultConfiguration() {
setCrankOperationMode();

View File

@ -9,6 +9,15 @@ void boardInit(void)
/* NOP */
}
Gpio getWarningLedPin() {
// this board has no warning led
return Gpio::Unassigned;
}
Gpio getCommsLedPin() {
return Gpio::Unassigned;
}
Gpio getRunningLedPin() {
// LD3 - green
return Gpio::G13;

View File

@ -27,6 +27,10 @@ static void setIgnitionPins() {
engineConfiguration->ignitionPins[3] = Gpio::E3;
}
Gpio getRunningLedPin() {
return Gpio::Unassigned;
}
Gpio getCommsLedPin() {
return Gpio::H10;
}

View File

@ -1,3 +1,14 @@
Gpio getCommsLedPin() {
return H64_LED2_BLUE;
}
Gpio getWarningLedPin() {
// this board has no warning led
return Gpio::Unassigned;
}
Gpio getRunningLedPin() {
// this board has no running led
return Gpio::Unassigned;
}

View File

@ -14,6 +14,20 @@ char __debugBuffer[80];
int __debugEnabled = 0;
#endif
Gpio getWarningLedPin() {
// this board has no warning led
return Gpio::Unassigned;
}
Gpio getRunningLedPin() {
return Gpio::Unassigned;
}
Gpio getCommsLedPin() {
// this board has no comms led
return Gpio::Unassigned;
}
void setBoardOverrides() {
engineConfiguration->useNoiselessTriggerDecoder = true;

View File

@ -8,6 +8,11 @@ Gpio getCommsLedPin() {
return Gpio::B7;
}
Gpio getWarningLedPin() {
// this board has no warning led
return Gpio::Unassigned;
}
Gpio getRunningLedPin() {
return Gpio::B0;
}

View File

@ -11,6 +11,11 @@ Gpio getRunningLedPin() {
return Gpio::B0;
}
Gpio getWarningLedPin() {
// this board has no warning led
return Gpio::Unassigned;
}
void preHalInit() {
efiSetPadMode("Ethernet", Gpio::A1, PAL_MODE_ALTERNATE(0xb));
efiSetPadMode("Ethernet", Gpio::A2, PAL_MODE_ALTERNATE(0xb));

View File

@ -10,6 +10,11 @@ Gpio getRunningLedPin() {
return Gpio::B0;
}
Gpio getWarningLedPin() {
// this board has no warning led
return Gpio::Unassigned;
}
void preHalInit() {
efiSetPadMode("Ethernet", Gpio::A1, PAL_MODE_ALTERNATE(0xb));
efiSetPadMode("Ethernet", Gpio::A2, PAL_MODE_ALTERNATE(0xb));

View File

@ -15,6 +15,15 @@ static bool is469 = true;
static bool is469 = false;
#endif
Gpio getCommsLedPin() {
// this board has no comms led
return Gpio::Unassigned;
}
Gpio getWarningLedPin() {
// this board has no warning led
return Gpio::Unassigned;
}
static void setPrometheusDefaults() {
engineConfiguration->useCicPidForIdle = true;
@ -195,7 +204,6 @@ void setBoardDefaultConfiguration() {
engineConfiguration->isSdCardEnabled = true;
}
Gpio getRunningLedPin() {
return Gpio::A13; //Gpio::A13; // yellow LED
}

View File

@ -18,6 +18,20 @@ static void setInjectorPins() {
engineConfiguration->injectionPinMode = OM_OPENDRAIN;
}
Gpio getWarningLedPin() {
// this board has no warning led
return Gpio::Unassigned;
}
Gpio getCommsLedPin() {
// this board has no comms led
return Gpio::Unassigned;
}
Gpio getRunningLedPin() {
return Gpio::Unassigned;
}
static void setIgnitionPins() {
engineConfiguration->ignitionPins[0] = Gpio::D13;
engineConfiguration->ignitionPins[1] = Gpio::D12;

View File

@ -19,6 +19,11 @@ Gpio getRunningLedPin() {
return Gpio::G8; /* LD3 - yellow */
}
Gpio getWarningLedPin() {
// this board has no warning led
return Gpio::Unassigned;
}
static void setSerialConfigurationOverrides() {
engineConfiguration->binarySerialTxPin = Gpio::E1;
engineConfiguration->binarySerialRxPin = Gpio::E0;

View File

@ -2,6 +2,21 @@
#include "protected_gpio.h"
Gpio getCommsLedPin() {
// this board has no comms led
return Gpio::Unassigned;
}
Gpio getWarningLedPin() {
// this board has no warning led
return Gpio::Unassigned;
}
Gpio getRunningLedPin() {
// this board has no running led
return Gpio::Unassigned;
}
void setBoardConfigOverrides() {
// No divider, just direct connected analog inputs (they're all internal, so why divide?)
engineConfiguration->analogInputDividerCoefficient = 1;

View File

@ -1,3 +1,5 @@
BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp
DDEFS += -DFIRMWARE_ID=\"t-b-g\"
DDEFS += -DSHORT_BOARD_NAME=t-b-g -DSTATIC_BOARD_ID=STATIC_BOARD_ID_TBG

View File

@ -0,0 +1,16 @@
#include "pch.h"
Gpio getCommsLedPin() {
// this board has no comms led
return Gpio::Unassigned;
}
Gpio getWarningLedPin() {
// this board has no warning led
return Gpio::Unassigned;
}
Gpio getRunningLedPin() {
// this board has no running led
return Gpio::Unassigned;
}

View File

@ -234,18 +234,6 @@ static systime_t timeOfPreviousReport = (systime_t) -1;
#endif /* EFI_LOGIC_ANALYZER */
}
__attribute__((weak)) Gpio getCommsLedPin() {
return Gpio::Unassigned;
}
__attribute__((weak)) Gpio getWarningLedPin() {
return Gpio::Unassigned;
}
__attribute__((weak)) Gpio getRunningLedPin() {
return Gpio::Unassigned;
}
static OutputPin* leds[] = { &enginePins.warningLedPin, &enginePins.runningLedPin,
&enginePins.errorLedPin, &enginePins.communicationLedPin, &enginePins.checkEnginePin };

View File

@ -70,6 +70,9 @@ void setBoardDefaultConfiguration();
void setBoardConfigOverrides();
void onBoardStandBy();
void boardOnConfigurationChange(engine_configuration_s *previousConfiguration);
Gpio getCommsLedPin();
Gpio getWarningLedPin();
Gpio getRunningLedPin();
#if !EFI_UNIT_TEST
extern persistent_config_container_s persistentState;