dead pwm tester
This commit is contained in:
parent
a7bce6aea5
commit
5b57b65ecd
|
@ -147,22 +147,6 @@ void setFrankensoConfiguration() {
|
|||
|
||||
setAlgorithm(LM_SPEED_DENSITY);
|
||||
|
||||
#if EFI_PWM_TESTER
|
||||
engineConfiguration->injectionPins[4] = Gpio::C8; // #5
|
||||
engineConfiguration->injectionPins[5] = Gpio::D10; // #6
|
||||
engineConfiguration->injectionPins[6] = Gpio::D9;
|
||||
engineConfiguration->injectionPins[7] = Gpio::D11;
|
||||
engineConfiguration->injectionPins[8] = Gpio::D0;
|
||||
engineConfiguration->injectionPins[9] = Gpio::B11;
|
||||
engineConfiguration->injectionPins[10] = Gpio::C7;
|
||||
engineConfiguration->injectionPins[11] = Gpio::E4;
|
||||
|
||||
/**
|
||||
* We want to initialize all outputs for test
|
||||
*/
|
||||
engineConfiguration->cylindersCount = 12;
|
||||
|
||||
#else /* EFI_PWM_TESTER */
|
||||
engineConfiguration->injectionPins[4] = Gpio::Unassigned;
|
||||
engineConfiguration->injectionPins[5] = Gpio::Unassigned;
|
||||
engineConfiguration->injectionPins[6] = Gpio::Unassigned;
|
||||
|
@ -177,7 +161,6 @@ void setFrankensoConfiguration() {
|
|||
engineConfiguration->ignitionPins[2] = Gpio::C9;
|
||||
// set_ignition_pin 4 PE10
|
||||
engineConfiguration->ignitionPins[3] = Gpio::E10;
|
||||
#endif /* EFI_PWM_TESTER */
|
||||
|
||||
// todo: 8.2 or 10k?
|
||||
engineConfiguration->vbattDividerCoeff = ((float) (10 + 33)) / 10 * 2;
|
||||
|
|
|
@ -86,8 +86,6 @@
|
|||
#define EFI_TEXT_LOGGING TRUE
|
||||
#endif
|
||||
|
||||
#define EFI_PWM_TESTER FALSE
|
||||
|
||||
#define EFI_ACTIVE_CONFIGURATION_IN_FLASH FALSE
|
||||
|
||||
#ifndef EFI_MC33816
|
||||
|
|
|
@ -1,94 +0,0 @@
|
|||
/**
|
||||
* @file PwmTester.cpp
|
||||
* This is a tool to measure rusEfi PWM generation quality
|
||||
*
|
||||
* @date Apr 29, 2014
|
||||
* @author Andrey Belomutskiy, (c) 2012-2020
|
||||
*/
|
||||
|
||||
#include "pch.h"
|
||||
|
||||
#if EFI_PWM_TESTER
|
||||
|
||||
#include "pwm_tester.h"
|
||||
|
||||
static SimplePwm pwmTest[5];
|
||||
|
||||
extern OutputPin warningLedPin;
|
||||
|
||||
static void startPwmTest(int freq) {
|
||||
efiPrintf("running pwm test @%d", freq);
|
||||
|
||||
engine->isRunningPwmTest = true;
|
||||
|
||||
// PD13 pin is initialized elsewhere already
|
||||
startSimplePwm(&pwmTest[0], "tester", &warningLedPin, 10, 0.5f);
|
||||
/**
|
||||
* See custom_engine.cpp for pinout
|
||||
*/
|
||||
// currently this is PB9 by default - see engineConfiguration->injectionPins
|
||||
startSimplePwm(&pwmTest[1], "tester", &enginePins.injectors[0], freq / 1.3333333333, 0.5f);
|
||||
// currently this is PE2 by default
|
||||
startSimplePwm(&pwmTest[2], "tester", &enginePins.injectors[1], freq / 1000, 0.5f);
|
||||
// currently this is PB8 by default
|
||||
startSimplePwm(&pwmTest[3], "tester", &enginePins.injectors[2], freq, 0.5);
|
||||
// currently this is PB7 by default
|
||||
startSimplePwm(&pwmTest[4], "tester", &enginePins.injectors[3], freq / 33.33333333333, 0.5);
|
||||
|
||||
}
|
||||
|
||||
static scheduling_s ioTest;
|
||||
|
||||
static OutputSignal outSignals[8];
|
||||
|
||||
static void testCallback(void *arg) {
|
||||
|
||||
/**
|
||||
* 0.1ms from now please squirt for 1.6ms
|
||||
*/
|
||||
float delayMs = 0.1;
|
||||
float durationMs = 1.6;
|
||||
|
||||
efitimeus_t nowUs = getTimeNowUs();
|
||||
|
||||
scheduleOutput(&outSignals[0], nowUs, delayMs, durationMs);
|
||||
scheduleOutput(&outSignals[1], nowUs, delayMs, durationMs);
|
||||
scheduleOutput(&outSignals[2], nowUs, delayMs, durationMs);
|
||||
scheduleOutput(&outSignals[3], nowUs, delayMs, durationMs);
|
||||
|
||||
scheduleOutput(&outSignals[4], nowUs, delayMs, durationMs);
|
||||
scheduleOutput(&outSignals[5], nowUs, delayMs, durationMs);
|
||||
scheduleOutput(&outSignals[6], nowUs, delayMs, durationMs);
|
||||
scheduleOutput(&outSignals[7], nowUs, delayMs, durationMs);
|
||||
|
||||
/**
|
||||
* this would re-schedule another callback in 2ms from now
|
||||
*/
|
||||
engine->executor.scheduleForLater("test", &ioTest, MS2US(2), testCallback);
|
||||
}
|
||||
|
||||
void initPwmTester() {
|
||||
initLogging(&logger, "pwm test");
|
||||
addConsoleActionI("pwmtest", startPwmTest);
|
||||
startPwmTest(1000);
|
||||
|
||||
/**
|
||||
* injector channels #4-#8 are used for individual squirt test
|
||||
*/
|
||||
// todo: yet, it's some horrible code duplication
|
||||
outSignals[0].output = &enginePins.injectors[4];
|
||||
outSignals[1].output = &enginePins.injectors[5];
|
||||
outSignals[2].output = &enginePins.injectors[6];
|
||||
outSignals[3].output = &enginePins.injectors[7];
|
||||
outSignals[4].output = &enginePins.injectors[8];
|
||||
outSignals[5].output = &enginePins.injectors[9];
|
||||
outSignals[6].output = &enginePins.injectors[10];
|
||||
outSignals[7].output = &enginePins.injectors[11];
|
||||
|
||||
/**
|
||||
* this would schedule a callback in 2ms from now
|
||||
*/
|
||||
engine->executor.scheduleForLater("test", &ioTest, MS2US(2), testCallback);
|
||||
}
|
||||
|
||||
#endif
|
|
@ -1,10 +0,0 @@
|
|||
/**
|
||||
* @file pwm_tester.h
|
||||
*
|
||||
* @date Apr 29, 2014
|
||||
* @author Andrey Belomutskiy, (c) 2012-2020
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
void initPwmTester();
|
|
@ -21,7 +21,6 @@ CONTROLLERS_SRC_CPP = \
|
|||
$(CONTROLLERS_DIR)/actuators/idle_thread.cpp \
|
||||
$(CONTROLLERS_DIR)/actuators/ignition_controller.cpp \
|
||||
$(CONTROLLERS_DIR)/actuators/main_relay.cpp \
|
||||
$(CONTROLLERS_DIR)/actuators/pwm_tester.cpp \
|
||||
$(CONTROLLERS_DIR)/actuators/vvt.cpp \
|
||||
$(CONTROLLERS_DIR)/actuators/gppwm_channel_reader.cpp \
|
||||
$(CONTROLLERS_DIR)/actuators/gppwm/gppwm_channel.cpp \
|
||||
|
|
|
@ -92,10 +92,6 @@
|
|||
#include "mpu_util.h"
|
||||
#endif /* EFI_UNIT_TEST */
|
||||
|
||||
#if EFI_PROD_CODE
|
||||
#include "pwm_tester.h"
|
||||
#endif /* EFI_PROD_CODE */
|
||||
|
||||
#if !EFI_UNIT_TEST
|
||||
|
||||
/**
|
||||
|
@ -738,11 +734,6 @@ void initRealHardwareEngineController() {
|
|||
engineStateBlinkingTask.start();
|
||||
|
||||
initVrThresholdPwm();
|
||||
|
||||
#if EFI_PWM_TESTER
|
||||
initPwmTester();
|
||||
#endif /* EFI_PWM_TESTER */
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -171,7 +171,6 @@
|
|||
#define EFI_RTC FALSE
|
||||
#define EFI_MALFUNCTION_INDICATOR FALSE
|
||||
#define EFI_LOGIC_ANALYZER FALSE
|
||||
#define EFI_PWM_TESTER FALSE
|
||||
#define TRIGGER_EXTREME_LOGGING FALSE
|
||||
#define SPARK_EXTREME_LOGGING FALSE
|
||||
#define DEBUG_PWM FALSE
|
||||
|
|
Loading…
Reference in New Issue