fix #490
This commit is contained in:
parent
becb389462
commit
2974ff66e2
|
@ -432,6 +432,10 @@ static void printInfo(systime_t nowSeconds) {
|
|||
|
||||
printOutPin(enginePins.injectors[i].name, boardConfiguration->injectionPins[i]);
|
||||
}
|
||||
for (int i = 0; i < AUX_DIGITAL_VALVE_COUNT;i++) {
|
||||
printOutPin(enginePins.auxValve[i].name, engineConfiguration->auxValves[i]);
|
||||
}
|
||||
|
||||
#endif /* EFI_PROD_CODE */
|
||||
|
||||
}
|
||||
|
|
|
@ -607,7 +607,11 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|||
setTableBin2(engineConfiguration->cltTimingExtra, CLT_TIMING_CURVE_SIZE, 0, 0, 1);
|
||||
|
||||
setTableBin2(engineConfiguration->fsioCurve1Bins, FSIO_CURVE_16, 0, 100, 1);
|
||||
setTableBin2(engineConfiguration->fsioCurve1, FSIO_CURVE_16, 0, 100, 1);
|
||||
|
||||
setTableBin2(engineConfiguration->fsioCurve2Bins, FSIO_CURVE_16, 0, 100, 1);
|
||||
setTableBin2(engineConfiguration->fsioCurve2, FSIO_CURVE_16, 30, 170, 1);
|
||||
|
||||
setTableBin2(engineConfiguration->fsioCurve3Bins, FSIO_CURVE_8, 0, 100, 1);
|
||||
setTableBin2(engineConfiguration->fsioCurve4Bins, FSIO_CURVE_8, 0, 100, 1);
|
||||
|
||||
|
|
|
@ -1,6 +1,14 @@
|
|||
/*
|
||||
* 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 fsioCurve1 and fsioCurve2 tables respectively, the position depend on TPS input.
|
||||
*
|
||||
* https://github.com/rusefi/rusefi/issues/490
|
||||
*
|
||||
* @date Nov 25, 2017
|
||||
* @author Andrey Belomutskiy, (c) 2012-2017
|
||||
*/
|
||||
|
@ -15,9 +23,14 @@ EXTERN_ENGINE
|
|||
static scheduling_s turnOnEvent[AUX_DIGITAL_VALVE_COUNT][2];
|
||||
static scheduling_s turnOffEvent[AUX_DIGITAL_VALVE_COUNT][2];
|
||||
|
||||
static void turnOn(void *arg) {
|
||||
|
||||
static void turnOn(NamedOutputPin *output) {
|
||||
output->setHigh();
|
||||
}
|
||||
|
||||
static void turnOff(NamedOutputPin *output) {
|
||||
output->setLow();
|
||||
}
|
||||
|
||||
static void auxValveTriggerCallback(trigger_event_e ckpSignalType,
|
||||
uint32_t index DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
#if EFI_PROD_CODE || EFI_SIMULATOR || defined(__DOXYGEN__)
|
||||
|
@ -25,8 +38,28 @@ static void auxValveTriggerCallback(trigger_event_e ckpSignalType,
|
|||
return;
|
||||
}
|
||||
int rpm = ENGINE(rpmCalculator.rpmValue);
|
||||
if (!isValidRpm(rpm)) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (int valveIndex = 0; valveIndex < AUX_DIGITAL_VALVE_COUNT;
|
||||
valveIndex++) {
|
||||
|
||||
NamedOutputPin *output = &enginePins.auxValve[valveIndex];
|
||||
|
||||
for (int phaseIndex = 0; phaseIndex < 2; phaseIndex++) {
|
||||
float extra = phaseIndex * 360 + valveIndex * 180;
|
||||
scheduleByAngle(rpm, &turnOnEvent[valveIndex][phaseIndex],
|
||||
extra + engine->engineState.auxValveStart,
|
||||
(schfunc_t) &turnOn, output, &engine->rpmCalculator);
|
||||
|
||||
scheduleByAngle(rpm, &turnOffEvent[valveIndex][phaseIndex],
|
||||
extra + engine->engineState.auxValveEnd,
|
||||
(schfunc_t) &turnOff, output, &engine->rpmCalculator);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
scheduleByAngle(rpm, &turnOnEvent[0][0], engine->engineState.auxValveStart, (schfunc_t)&turnOn, NULL, &engine->rpmCalculator);
|
||||
#endif /* EFI_PROD_CODE || EFI_SIMULATOR */
|
||||
}
|
||||
|
||||
|
@ -45,10 +78,12 @@ void updateAuxValves(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|||
}
|
||||
|
||||
float x = getTPS(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
engine->engineState.auxValveStart = interpolate2d("aux", x, engineConfiguration->fsioCurve1Bins,
|
||||
engine->engineState.auxValveStart = interpolate2d("aux", x,
|
||||
engineConfiguration->fsioCurve1Bins,
|
||||
engineConfiguration->fsioCurve1, FSIO_CURVE_16);
|
||||
|
||||
engine->engineState.auxValveEnd = interpolate2d("aux", x, engineConfiguration->fsioCurve2Bins,
|
||||
engine->engineState.auxValveEnd = interpolate2d("aux", x,
|
||||
engineConfiguration->fsioCurve2Bins,
|
||||
engineConfiguration->fsioCurve2, FSIO_CURVE_16);
|
||||
}
|
||||
|
||||
|
|
|
@ -192,7 +192,7 @@ void doSlowAdc(void) {
|
|||
adcStartConversionI(&ADC_SLOW_DEVICE, &adcgrpcfgSlow, slowAdc.samples, ADC_BUF_DEPTH_SLOW);
|
||||
chSysUnlockFromISR()
|
||||
;
|
||||
#endif
|
||||
#endif /* EFI_INTERNAL_ADC */
|
||||
}
|
||||
|
||||
static void pwmpcb_slow(PWMDriver *pwmp) {
|
||||
|
@ -225,7 +225,7 @@ static void pwmpcb_fast(PWMDriver *pwmp) {
|
|||
chSysUnlockFromISR()
|
||||
;
|
||||
fastAdc.conversionCount++;
|
||||
#endif
|
||||
#endif /* EFI_INTERNAL_ADC */
|
||||
}
|
||||
|
||||
float getMCUInternalTemperature(void) {
|
||||
|
@ -242,11 +242,11 @@ int getInternalAdcValue(const char *msg, adc_channel_e hwChannel) {
|
|||
warning(CUSTOM_OBD_ANALOG_INPUT_NOT_CONFIGURED, "ADC: %s input is not configured", msg);
|
||||
return -1;
|
||||
}
|
||||
#if EFI_ENABLE_MOCK_ADC || EFI_SIMULATOR
|
||||
#if EFI_ENABLE_MOCK_ADC
|
||||
if (engine->engineState.mockAdcState.hasMockAdc[hwChannel])
|
||||
return engine->engineState.mockAdcState.getMockAdcValue(hwChannel);
|
||||
|
||||
#endif
|
||||
#endif /* EFI_ENABLE_MOCK_ADC */
|
||||
|
||||
|
||||
if (adcHwChannelEnabled[hwChannel] == ADC_FAST) {
|
||||
|
|
|
@ -260,5 +260,5 @@ int getRusEfiVersion(void) {
|
|||
if (initBootloader() != 0)
|
||||
return 123;
|
||||
#endif /* EFI_BOOTLOADER_INCLUDE_CODE */
|
||||
return 20171126;
|
||||
return 20171127;
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ enable2ndByteCanID = false
|
|||
|
||||
; see PAGE_0_SIZE in C source code
|
||||
; CONFIG_DEFINITION_START
|
||||
; this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Mon Nov 27 17:50:24 EST 2017
|
||||
; this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Mon Nov 27 21:35:56 EST 2017
|
||||
|
||||
pageSize = 20000
|
||||
page = 1
|
||||
|
@ -1079,14 +1079,14 @@ fileVersion = { 20171101 }
|
|||
curve = fsioCurve1, "FSIO Curve #1"
|
||||
columnLabel = "X", "Y"
|
||||
xAxis = 0, 128, 10
|
||||
yAxis = -5, 5, 10
|
||||
yAxis = -155, 150, 10
|
||||
xBins = fsioCurve1Bins
|
||||
yBins = fsioCurve1
|
||||
|
||||
curve = fsioCurve2, "FSIO Curve #2"
|
||||
columnLabel = "X", "Y"
|
||||
xAxis = 0, 128, 10
|
||||
yAxis = -5, 5, 10
|
||||
yAxis = -150, 150, 10
|
||||
xBins = fsioCurve2Bins
|
||||
yBins = fsioCurve2
|
||||
|
||||
|
@ -2077,6 +2077,24 @@ cmd_stop_engine = "w\x00\x99\x00\x00"
|
|||
field = "FSIO dig inp #7", fsioDigitalInputs7
|
||||
field = "FSIO dig inp #8", fsioDigitalInputs8
|
||||
field = "FSIO dig inp #9", fsioDigitalInputs9
|
||||
field = "output #1", fsioOutputPins1
|
||||
field = "output #2", fsioOutputPins2
|
||||
field = "output #3", fsioOutputPins3
|
||||
field = "output #4", fsioOutputPins4
|
||||
field = "output #5", fsioOutputPins5
|
||||
field = "output #6", fsioOutputPins6
|
||||
field = "output #7", fsioOutputPins7
|
||||
field = "output #8", fsioOutputPins8
|
||||
field = "output #9", fsioOutputPins9
|
||||
field = "output #10", fsioOutputPins10
|
||||
field = "output #11", fsioOutputPins11
|
||||
field = "output #12", fsioOutputPins12
|
||||
field = "output #13", fsioOutputPins13
|
||||
field = "output #14", fsioOutputPins14
|
||||
field = "output #15", fsioOutputPins15
|
||||
field = "output #16", fsioOutputPins16
|
||||
field = "aux valve #1", auxValves1
|
||||
field = "aux valve #2", auxValves2
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -299,14 +299,14 @@ fileVersion = { 20171101 }
|
|||
curve = fsioCurve1, "FSIO Curve #1"
|
||||
columnLabel = "X", "Y"
|
||||
xAxis = 0, 128, 10
|
||||
yAxis = -5, 5, 10
|
||||
yAxis = -155, 150, 10
|
||||
xBins = fsioCurve1Bins
|
||||
yBins = fsioCurve1
|
||||
|
||||
curve = fsioCurve2, "FSIO Curve #2"
|
||||
columnLabel = "X", "Y"
|
||||
xAxis = 0, 128, 10
|
||||
yAxis = -5, 5, 10
|
||||
yAxis = -150, 150, 10
|
||||
xBins = fsioCurve2Bins
|
||||
yBins = fsioCurve2
|
||||
|
||||
|
@ -1297,6 +1297,24 @@ cmd_stop_engine = "w\x00\x99\x00\x00"
|
|||
field = "FSIO dig inp #7", fsioDigitalInputs7
|
||||
field = "FSIO dig inp #8", fsioDigitalInputs8
|
||||
field = "FSIO dig inp #9", fsioDigitalInputs9
|
||||
field = "output #1", fsioOutputPins1
|
||||
field = "output #2", fsioOutputPins2
|
||||
field = "output #3", fsioOutputPins3
|
||||
field = "output #4", fsioOutputPins4
|
||||
field = "output #5", fsioOutputPins5
|
||||
field = "output #6", fsioOutputPins6
|
||||
field = "output #7", fsioOutputPins7
|
||||
field = "output #8", fsioOutputPins8
|
||||
field = "output #9", fsioOutputPins9
|
||||
field = "output #10", fsioOutputPins10
|
||||
field = "output #11", fsioOutputPins11
|
||||
field = "output #12", fsioOutputPins12
|
||||
field = "output #13", fsioOutputPins13
|
||||
field = "output #14", fsioOutputPins14
|
||||
field = "output #15", fsioOutputPins15
|
||||
field = "output #16", fsioOutputPins16
|
||||
field = "aux valve #1", auxValves1
|
||||
field = "aux valve #2", auxValves2
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue