trigger signal debug pins - logic level output #2959
test driven development is still amazing
This commit is contained in:
parent
74e5eb8bb7
commit
03bb3e3ace
|
@ -90,7 +90,7 @@ void setFordAspireEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
|
|||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
engineConfiguration->trigger.type = TT_FORD_ASPIRE;
|
||||
|
||||
// todo #2959 engineConfiguration->triggerInputDebugPins[0] = GPIOC_15;
|
||||
engineConfiguration->triggerInputDebugPins[0] = GPIOC_15;
|
||||
|
||||
engineConfiguration->injectionPins[4] = GPIO_UNASSIGNED;
|
||||
engineConfiguration->injectionPins[5] = GPIO_UNASSIGNED;
|
||||
|
|
|
@ -175,12 +175,12 @@ void turnOnTriggerInputPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|||
void stopTriggerDebugPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
for (int i = 0; i < TRIGGER_INPUT_PIN_COUNT; i++) {
|
||||
if (isConfigurationChanged(triggerInputDebugPins[i])) {
|
||||
efiSetPadUnused(CONFIG(triggerInputDebugPins[i]) PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
efiSetPadUnused(activeConfiguration.triggerInputDebugPins[i] PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < CAM_INPUTS_COUNT; i++) {
|
||||
if (isConfigurationChanged(camInputsDebug[i])) {
|
||||
efiSetPadUnused(CONFIG(camInputsDebug[i]) PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
efiSetPadUnused(activeConfiguration.camInputsDebug[i] PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -114,6 +114,7 @@ EngineTestHelper::EngineTestHelper(engine_type_e engineType, configuration_callb
|
|||
memset(mockPinStates, 0, sizeof(mockPinStates));
|
||||
|
||||
initHardware(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
rememberCurrentConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
}
|
||||
|
||||
EngineTestHelper::~EngineTestHelper() {
|
||||
|
|
|
@ -8,9 +8,30 @@
|
|||
#include "engine_test_helper.h"
|
||||
#include "settings.h"
|
||||
|
||||
extern engine_configuration_s & activeConfiguration;
|
||||
|
||||
TEST(misc, changeEngineType) {
|
||||
/**
|
||||
* this configuration has triggerInputDebugPins defined
|
||||
*/
|
||||
WITH_ENGINE_TEST_HELPER (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 PASS_ENGINE_PARAMETER_SUFFIX));
|
||||
|
||||
// above we have asserted that triggerInputDebugPins is in fact used
|
||||
// now let's change into engine type without triggerInputDebugPins and assert shut down
|
||||
|
||||
setEngineType((int)CITROEN_TU3JP PASS_ENGINE_PARAMETER_SUFFIX);
|
||||
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 PASS_ENGINE_PARAMETER_SUFFIX));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue