remove trigger input debug pins

This commit is contained in:
Matthew Kennedy 2024-08-28 02:06:02 -07:00
parent a7bb5f98fa
commit bd7f8f2bb6
11 changed files with 0 additions and 117 deletions

View File

@ -75,8 +75,6 @@ void setFordAspireEngineConfiguration() {
engineConfiguration->ignitionMode = IM_ONE_COIL;
engineConfiguration->trigger.type = trigger_type_e::TT_FORD_ASPIRE;
engineConfiguration->triggerInputDebugPins[0] = Gpio::C15;
engineConfiguration->injectionPins[4] = Gpio::Unassigned;
engineConfiguration->injectionPins[5] = Gpio::Unassigned;

View File

@ -31,9 +31,6 @@
WaveChart waveChart;
#endif /* EFI_ENGINE_SNIFFER */
static scheduling_s debugToggleScheduling;
#define DEBUG_PIN_DELAY US2NT(60)
#define TRIGGER_WAVEFORM(x) getTriggerCentral()->triggerShape.x
#if EFI_SHAFT_POSITION_INPUT
@ -130,22 +127,6 @@ angle_t TriggerCentral::syncAndReport(int divider, int remainder) {
return totalShift;
}
static void turnOffAllDebugFields(void *arg) {
(void)arg;
#if EFI_PROD_CODE
for (int index = 0; index < TRIGGER_INPUT_PIN_COUNT; index++) {
if (isBrainPinValid(engineConfiguration->triggerInputDebugPins[index])) {
writePad("trigger debug", engineConfiguration->triggerInputDebugPins[index], 0);
}
}
for (int index = 0; index < CAM_INPUTS_COUNT; index++) {
if (isBrainPinValid(engineConfiguration->camInputsDebug[index])) {
writePad("cam debug", engineConfiguration->camInputsDebug[index], 0);
}
}
#endif /* EFI_PROD_CODE */
}
static angle_t adjustCrankPhase(int camIndex) {
float maxSyncThreshold = engineConfiguration->maxCamPhaseResolveRpm;
if (maxSyncThreshold != 0 && Sensor::getOrZero(SensorType::Rpm) > maxSyncThreshold) {
@ -209,13 +190,6 @@ static angle_t wrapVvt(angle_t vvtPosition, int period) {
}
static void logVvtFront(bool isImportantFront, bool isRising, efitick_t nowNt, int index) {
if (isImportantFront && isBrainPinValid(engineConfiguration->camInputsDebug[index])) {
#if EFI_PROD_CODE
writePad("cam debug", engineConfiguration->camInputsDebug[index], 1);
#endif /* EFI_PROD_CODE */
getScheduler()->schedule("dbg_on", &debugToggleScheduling, nowNt + DEBUG_PIN_DELAY, &turnOffAllDebugFields);
}
// If we care about both edges OR displayLogicLevel is set, log every front exactly as it is
addEngineSnifferVvtEvent(index, isRising);
@ -429,13 +403,6 @@ void handleShaftSignal(int signalIndex, bool isRising, efitick_t timestamp) {
return;
}
if (engineConfiguration->triggerInputDebugPins[signalIndex] != Gpio::Unassigned) {
#if EFI_PROD_CODE
writePad("trigger debug", engineConfiguration->triggerInputDebugPins[signalIndex], 1);
#endif /* EFI_PROD_CODE */
getScheduler()->schedule("dbg_off", &debugToggleScheduling, timestamp + DEBUG_PIN_DELAY, &turnOffAllDebugFields);
}
uint32_t triggerHandlerEntryTime = getTimeNowLowerNt();
if (triggerReentrant > maxTriggerReentrant)
maxTriggerReentrant = triggerReentrant;

View File

@ -115,25 +115,6 @@ void turnOnTriggerInputPins() {
#endif /* (HAL_TRIGGER_USE_PAL == TRUE) */
void stopTriggerDebugPins() {
for (int i = 0; i < TRIGGER_INPUT_PIN_COUNT; i++) {
efiSetPadUnusedIfConfigurationChanged(triggerInputDebugPins[i]);
}
for (int i = 0; i < CAM_INPUTS_COUNT; i++) {
efiSetPadUnusedIfConfigurationChanged(camInputsDebug[i]);
}
}
void startTriggerDebugPins() {
for (int i = 0; i < TRIGGER_INPUT_PIN_COUNT; i++) {
efiSetPadModeIfConfigurationChanged("trigger debug", triggerInputDebugPins[i], PAL_MODE_OUTPUT_PUSHPULL);
}
for (int i = 0; i < CAM_INPUTS_COUNT; i++) {
efiSetPadModeIfConfigurationChanged("cam debug", camInputsDebug[i], PAL_MODE_OUTPUT_PUSHPULL);
}
}
void applyNewTriggerInputPins() {
if (hasFirmwareError()) {
return;

View File

@ -16,7 +16,4 @@ void applyNewTriggerInputPins();
void startTriggerInputPins();
void stopTriggerInputPins();
void stopTriggerDebugPins();
void startTriggerDebugPins();
void onTriggerChanged(efitick_t stamp, bool isPrimary, bool isRising);

View File

@ -250,10 +250,6 @@ void applyNewHardwareSettings() {
efiSetPadUnused(activeConfiguration.clutchUpPin);
}
#if EFI_SHAFT_POSITION_INPUT
stopTriggerDebugPins();
#endif // EFI_SHAFT_POSITION_INPUT
enginePins.unregisterPins();
#if EFI_PROD_CODE
@ -391,9 +387,6 @@ void stopHardware() {
void startHardware() {
#if EFI_SHAFT_POSITION_INPUT
validateTriggerInputs();
startTriggerDebugPins();
#endif // EFI_SHAFT_POSITION_INPUT
startPedalPins();

View File

@ -112,10 +112,6 @@ iomode_t getInputMode(pin_input_mode_e mode) {
}
}
void writePad(const char *msg, brain_pin_e pin, int bit) {
palWritePad(getHwPort(msg, pin), getHwPin(msg, pin), bit);
}
#else /* EFI_PROD_CODE */
// This has been made global so we don't need to worry about efiReadPin having access the object

View File

@ -39,8 +39,6 @@ EXTERNC iomode_t getInputMode(pin_input_mode_e mode);
#endif /* EFI_GPIO_HARDWARE */
void writePad(const char *msg, brain_pin_e pin, int bit);
#if ! EFI_PROD_CODE
#define BRAIN_PIN_COUNT (1 << 8 * sizeof(brain_pin_e))
extern bool mockPinStates[BRAIN_PIN_COUNT];

View File

@ -1001,7 +1001,6 @@ bit ALSActivateInverted
float turboSpeedSensorMultiplier;;"mult", 1, 0, 0, 7000, 3
Gpio[CAM_INPUTS_COUNT iterate] camInputsDebug;
int16_t acIdleRpmBump;Extra idle target speed when A/C is enabled. Some cars need the extra speed to keep the AC efficient while idling.;"RPM", 1, 0, 0, 1000, 0
int16_t warningPeriod;;"seconds", 1, 0, 0, 60, 0
@ -1026,7 +1025,6 @@ custom pin_mode_e 1 bits, U08, @OFFSET@, [0:6], @@pin_mode_e_enum@@
float wwaeTau;Length of time the deposited wall fuel takes to dissipate after the start of acceleration. ;"Seconds", 1, 0, 0, 3, 2
pid_s alternatorControl;
pid_s etb;
Gpio[TRIGGER_INPUT_PIN_COUNT iterate] triggerInputDebugPins;
int16_t airTaperRpmRange;RPM range above upper limit for extra air taper;"RPM", 1, 0, 0, 1500, 0
brain_input_pin_e turboSpeedSensorInputPin;
int16_t tps2Min;;"ADC", 1, 0, 0, 1023, 0

View File

@ -2889,14 +2889,6 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_
field = "Aux Temperature #2", auxTempSensor2_adcChannel
field = "Aux Fast Analog", auxFastSensor1_adcChannel
dialog = allTriggerDebug, "Trigger Debug"
field = "trigger 1 debug", triggerInputDebugPins1
field = "trigger 2 debug", triggerInputDebugPins2
field = "cam 1 debug", camInputsDebug1
field = "cam 2 debug", camInputsDebug2
field = "cam 3 debug", camInputsDebug3
field = "cam 4 debug", camInputsDebug4
dialog = allPinsMC33, "MC33816"
field = "Chip Select", mc33816_cs
field = rstb, mc33816_rstb
@ -2968,7 +2960,6 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_
dialog = allPins2_3
field = "Debug Trigger Sync", debugTriggerSync
panel = allTriggerDebug
panel = allPinsMC33
dialog = allPins1_3
@ -4512,7 +4503,6 @@ dialog = tcuControls, "Transmission Settings"
field = auxFrequencyFilter, auxFrequencyFilter
field = useBiQuadOnAuxSpeedSensors, useBiQuadOnAuxSpeedSensors
field = "TODO KS mode 4569", kickStartCranking
panel = allTriggerDebug
panel = harleyAcr
help = helpGeneral, "FOME General Help"

View File

@ -1,34 +0,0 @@
/*
* @file test_change_engine_type.cpp
*
* @date Jul 14, 2021
* @author Andrey Belomutskiy, (c) 2012-2021
*/
#include "pch.h"
TEST(misc, changeEngineType) {
/**
* this configuration has triggerInputDebugPins defined
*/
EngineTestHelper eth(engine_type_e::FORD_ASPIRE_1996);
brain_pin_e brainPin = engineConfiguration->triggerInputDebugPins[0];
ASSERT_TRUE(brainPin != Gpio::Unassigned);
ASSERT_TRUE(activeConfiguration.triggerInputDebugPins[0] != Gpio::Unassigned);
int pinIndex = brainPin_to_index(brainPin);
ASSERT_TRUE(nullptr != getBrainUsedPin(pinIndex));
// above we have asserted that triggerInputDebugPins is in fact used
// now let's change into engine type without triggerInputDebugPins and assert shut down
setEngineType(engine_type_e::CITROEN_TU3JP);
ASSERT_TRUE(activeConfiguration.triggerInputDebugPins[0] == Gpio::Unassigned);
ASSERT_TRUE(engineConfiguration->triggerInputDebugPins[0] == Gpio::Unassigned);
ASSERT_TRUE(engineConfiguration->triggerInputDebugPins[0] == Gpio::Unassigned);
ASSERT_TRUE(nullptr == getBrainUsedPin(pinIndex));
}

View File

@ -48,7 +48,6 @@ TESTS_SRC_CPP = \
tests/lua/test_lua_Leiderman_Khlystov.cpp \
tests/lua/test_can_filter.cpp \
tests/lua/test_lua_vin.cpp \
tests/test_change_engine_type.cpp \
tests/util/test_scaled_channel.cpp \
tests/util/test_timer.cpp \
tests/system/test_periodic_thread_controller.cpp \