more dead

This commit is contained in:
Matthew Kennedy 2023-02-21 11:54:24 -08:00
parent 78f4aea3c3
commit 959f14fae6
13 changed files with 1 additions and 184 deletions

View File

@ -17,7 +17,6 @@
#include "speed_density.h"
#include "advance_map.h"
#include "aux_valves.h"
#include "map_averaging.h"
#include "perf_trace.h"
#include "backup_ram.h"

View File

@ -13,7 +13,6 @@
#include "speed_density.h"
#include "fuel_math.h"
#include "advance_map.h"
#include "aux_valves.h"
#include "closed_loop_fuel.h"
#include "launch_control.h"
#include "injector_model.h"
@ -124,8 +123,6 @@ void EngineState::periodicFastCallback() {
engine->fuelComputer.running.timeSinceCrankingInSecs = crankingTimer.getElapsedSeconds(nowNt);
recalculateAuxValveTiming();
int rpm = Sensor::getOrZero(SensorType::Rpm);
engine->ignitionState.sparkDwell = engine->ignitionState.getSparkDwell(rpm);
engine->ignitionState.dwellAngle = cisnan(rpm) ? NAN : engine->ignitionState.sparkDwell / getOneDegreeTimeMs(rpm);

View File

@ -623,7 +623,6 @@ static void setDefaultEngineConfiguration() {
// https://github.com/rusefi/rusefi/issues/4030
engineConfiguration->mapErrorDetectionTooHigh = 410;
engineConfiguration->isEngineControlEnabled = true;
#endif // EFI_ENGINE_CONTROL
#include "default_script.lua"
}

View File

@ -1777,7 +1777,7 @@ typedef enum {
CUSTOM_TOO_LONG_CRANKING_FUEL_INJECTION = 6054,
CUSTOM_INTERPOLATE_NAN = 6055,
ERROR_HISTO_NAME = 6056,
CUSTOM_AUX_OUT_OF_ORDER = 6057,
CUSTOM_6057 = 6057,
CUSTOM_OBD_HIGH_FREQUENCY = 6058,
CUSTOM_OBD_59 = 6059,

View File

@ -39,7 +39,6 @@ CONTROLLERS_SRC_CPP = \
$(CONTROLLERS_DIR)/engine_cycle/knock_controller.cpp \
$(CONTROLLERS_DIR)/engine_cycle/main_trigger_callback.cpp \
$(CONTROLLERS_DIR)/engine_cycle/prime_injection.cpp \
$(CONTROLLERS_DIR)/engine_cycle/aux_valves.cpp \
$(CONTROLLERS_DIR)/engine_cycle/fuel_schedule.cpp \
$(CONTROLLERS_DIR)/flash_main.cpp \
$(CONTROLLERS_DIR)/bench_test.cpp \

View File

@ -41,7 +41,6 @@
#include "alternator_controller.h"
#include "fuel_math.h"
#include "spark_logic.h"
#include "aux_valves.h"
#include "accelerometer.h"
#include "vvt.h"
#include "boost_control.h"
@ -472,12 +471,6 @@ void commonInitEngineController() {
engine->rpmCalculator.Register();
#endif /* EFI_UNIT_TEST */
#if (EFI_ENGINE_CONTROL && EFI_SHAFT_POSITION_INPUT) || EFI_SIMULATOR || EFI_UNIT_TEST
if (engineConfiguration->isEngineControlEnabled) {
initAuxValves();
}
#endif /* EFI_ENGINE_CONTROL */
initTachometer();
}

View File

@ -1,100 +0,0 @@
/*
* @file aux_valves.cpp
*
*
* Here we have two auxilary digital on/off outputs which would open once per each 360 degrees of engine crank revolution.
* The second valve is 180 degrees after the first one.
*
* Valve open and close angles are taken from scriptCurve1 and scriptCurve2 tables respectively, the position depend on TPS input.
*
* https://github.com/rusefi/rusefi/issues/490
*
* @date Nov 25, 2017
* @author Andrey Belomutskiy, (c) 2012-2020
*/
#include "pch.h"
#include "aux_valves.h"
#include "trigger_central.h"
#include "spark_logic.h"
static void plainPinTurnOff(NamedOutputPin *output) {
output->setLow();
}
static void scheduleOpen(AuxActor *current) {
engine->module<TriggerScheduler>()->schedule(&current->open,
current->extra + engine->engineState.auxValveStart,
{ auxPlainPinTurnOn, current }
);
}
void auxPlainPinTurnOn(AuxActor *current) {
NamedOutputPin *output = &enginePins.auxValve[current->valveIndex];
output->setHigh();
scheduleOpen(current);
angle_t duration = engine->engineState.auxValveEnd - engine->engineState.auxValveStart;
fixAngle(duration, "duration", CUSTOM_ERR_6557);
engine->module<TriggerScheduler>()->schedule(&current->close,
current->extra + engine->engineState.auxValveEnd,
{ plainPinTurnOff, output }
);
}
void initAuxValves() {
if (!isBrainPinValid(engineConfiguration->auxValves[0])) {
return;
}
if (!Sensor::hasSensor(SensorType::DriverThrottleIntent)) {
firmwareError(CUSTOM_OBD_91, "No TPS for Aux Valves");
return;
}
recalculateAuxValveTiming();
for (int valveIndex = 0; valveIndex < AUX_DIGITAL_VALVE_COUNT; valveIndex++) {
for (int phaseIndex = 0; phaseIndex < 2; phaseIndex++) {
AuxActor *actor = &engine->auxValves[valveIndex][phaseIndex];
actor->phaseIndex = phaseIndex;
actor->valveIndex = valveIndex;
actor->extra = phaseIndex * 360 + valveIndex * 180;
scheduleOpen(actor);
}
}
}
void recalculateAuxValveTiming() {
if (!isBrainPinValid(engineConfiguration->auxValves[0])) {
return;
}
auto tps = Sensor::get(SensorType::DriverThrottleIntent);
if (!tps) {
// error should be already reported by now
return;
}
engine->engineState.auxValveStart = interpolate2d(tps.Value,
config->scriptCurve1Bins,
config->scriptCurve1);
engine->engineState.auxValveEnd = interpolate2d(tps.Value,
config->scriptCurve2Bins,
config->scriptCurve2);
if (engine->engineState.auxValveStart >= engine->engineState.auxValveEnd) {
// this is a fatal error to make this really visible
firmwareError(CUSTOM_AUX_OUT_OF_ORDER, "out of order at %.2f %.2f %.2f", tps,
engine->engineState.auxValveStart,
engine->engineState.auxValveEnd);
}
}

View File

@ -1,12 +0,0 @@
/*
* @file aux_valves.h
*
* @date Nov 25, 2017
* @author Andrey Belomutskiy, (c) 2012-2020
*/
#pragma once
void initAuxValves();
void recalculateAuxValveTiming();
void auxPlainPinTurnOn(AuxActor *current);

View File

@ -504,8 +504,6 @@ static void enableOrDisable(const char *param, bool isEnabled) {
disableTriggerStimulator();
}
#endif // EFI_EMULATE_POSITION_SENSORS
} else if (strEqualCaseInsensitive(param, "engine_control")) {
engineConfiguration->isEngineControlEnabled = isEnabled;
} else if (strEqualCaseInsensitive(param, "map_avg")) {
engineConfiguration->isMapAveragingEnabled = isEnabled;
} else if (strEqualCaseInsensitive(param, "logic_analyzer")) {

View File

@ -726,7 +726,6 @@ bit is_enabled_spi_2
bit is_enabled_spi_3
bit isSdCardEnabled;enable sd/disable sd
bit rusefiVerbose29b,"29 bit","11 bit";Use 11 bit (standard) or 29 bit (extended) IDs for rusEFI verbose CAN format.
bit isEngineControlEnabled
bit isVerboseAlternator
bit verboseQuad
bit useStepperIdle;This setting should only be used if you have a stepper motor idle valve and a stepper motor driver installed.

View File

@ -24,17 +24,6 @@ public class GccMapReaderTest {
assertEquals(0x18, r.get(0).getSize());
}
@Test
public void testMultiLine() {
List<GccMapReader.Record> r = GccMapReader.process(Arrays.asList(
GccMapReader.START_OF_DATA_TAG,
" .bss._ZL12turnOffEvent",
"0x1fff9db8 0x60 build_kinetis/obj/aux_valves.o"), BSS);
assertNotNull(r);
assertEquals(1, r.size());
assertEquals(0x60, r.get(0).getSize());
}
@Test
public void testThreeLine() {
List<GccMapReader.Record> r = GccMapReader.process(Arrays.asList(

View File

@ -1,43 +0,0 @@
/*
* @file test_aux_valves.cpp
*
* @date: Nov 23, 2019
* @author Andrey Belomutskiy, (c) 2012-2020
*/
#include "pch.h"
#include "aux_valves.h"
TEST(Actuators, AuxValves) {
Sensor::setMockValue(SensorType::DriverThrottleIntent, 0);
EngineTestHelper eth(NISSAN_PRIMERA);
// Engine must be "spinning" for scheduleByAngle to work
engine->rpmCalculator.setRpmValue(1000);
eth.assertTriggerEvent("a0", 0, &engine->auxValves[0][0].open, (void*)&auxPlainPinTurnOn, 0);
eth.assertTriggerEvent("a1", 1, &engine->auxValves[0][1].open, (void*)&auxPlainPinTurnOn, 360);
eth.assertTriggerEvent("a2", 2, &engine->auxValves[1][0].open, (void*)&auxPlainPinTurnOn, 180);
eth.assertTriggerEvent("a3", 3, &engine->auxValves[1][1].open, (void*)&auxPlainPinTurnOn, 540);
// Execute the first one, ensure scheduling for the "close" event happens
engine->module<TriggerScheduler>()->scheduleEventsUntilNextTriggerTooth(1000, 0, 0, 1);
// Old head should now be missing - we just ran it
eth.assertTriggerEvent("a1", 0, &engine->auxValves[0][1].open, (void*)&auxPlainPinTurnOn, 360);
eth.assertTriggerEvent("a2", 1, &engine->auxValves[1][0].open, (void*)&auxPlainPinTurnOn, 180);
eth.assertTriggerEvent("a3", 2, &engine->auxValves[1][1].open, (void*)&auxPlainPinTurnOn, 540);
// Execute the action it put on the regular scheduler
eth.executeUntil(999999);
eth.assertTriggerEvent("a1", 0, &engine->auxValves[0][1].open, (void*)&auxPlainPinTurnOn, 360);
eth.assertTriggerEvent("a2", 1, &engine->auxValves[1][0].open, (void*)&auxPlainPinTurnOn, 180);
eth.assertTriggerEvent("a3", 2, &engine->auxValves[1][1].open, (void*)&auxPlainPinTurnOn, 540);
// same event is back at the end of the list
eth.assertTriggerEvent("a0", 3, &engine->auxValves[0][0].open, (void*)&auxPlainPinTurnOn, 0);
// PLUS the turn off event!
eth.assertTriggerEvent("off", 4, &engine->auxValves[0][0].close, nullptr, 30);
}

View File

@ -101,7 +101,6 @@ TESTS_SRC_CPP = \
tests/sensor/test_frequency_sensor.cpp \
tests/sensor/test_turbocharger_speed_converter.cpp \
tests/sensor/test_vehicle_speed_converter.cpp \
tests/actuators/test_aux_valves.cpp \
tests/actuators/test_antilag.cpp \
tests/actuators/test_boost.cpp \
tests/actuators/test_dc_motor.cpp \