mirror of https://github.com/rusefi/rusefi-1.git
parent
f7282966d2
commit
4d1d2672ce
|
@ -135,20 +135,13 @@ percent_t getTpsValue(int index, float adc DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||||
return maxF(0, minF(100, result));
|
return maxF(0, minF(100, result));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Return voltage on TPS AND channel
|
|
||||||
* */
|
|
||||||
float getTPSVoltage(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|
||||||
return getVoltageDivided("tps", engineConfiguration->tps1_1AdcChannel PASS_ENGINE_PARAMETER_SUFFIX);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Return TPS ADC readings.
|
* Return TPS ADC readings.
|
||||||
* We need ADC value because TunerStudio has a nice TPS configuration wizard, and this wizard
|
* We need ADC value because TunerStudio has a nice TPS configuration wizard, and this wizard
|
||||||
* wants a TPS value.
|
* wants a TPS value.
|
||||||
* @param index [0, ETB_COUNT)
|
* @param index [0, ETB_COUNT)
|
||||||
*/
|
*/
|
||||||
float getTPS10bitAdc(int index DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
static float getTPS10bitAdc(int index DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||||
#if !EFI_PROD_CODE
|
#if !EFI_PROD_CODE
|
||||||
if (engine->mockTpsAdcValue != MOCK_UNDEFINED) {
|
if (engine->mockTpsAdcValue != MOCK_UNDEFINED) {
|
||||||
return engine->mockTpsAdcValue;
|
return engine->mockTpsAdcValue;
|
||||||
|
@ -234,7 +227,7 @@ percent_t getPedalPosition(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
return maxF(0, minF(100, result));
|
return maxF(0, minF(100, result));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool hasTpsSensor(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
static bool hasTpsSensor(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
return engineConfiguration->tps1_1AdcChannel != EFI_ADC_NONE;
|
return engineConfiguration->tps1_1AdcChannel != EFI_ADC_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -257,14 +250,6 @@ percent_t getTPS(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
return getTPSWithIndex(0 PASS_ENGINE_PARAMETER_SUFFIX);
|
return getTPSWithIndex(0 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setBosch0280750009(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|
||||||
// see http://rusefi.com/wiki/index.php?title=Vehicle:VW_Passat_2002_1.8
|
|
||||||
engineConfiguration->tpsMin = 159;
|
|
||||||
engineConfiguration->tpsMax = 957;
|
|
||||||
|
|
||||||
// todo: add 2nd TPS sensor calibration
|
|
||||||
}
|
|
||||||
|
|
||||||
int convertVoltageTo10bitADC(float voltage) {
|
int convertVoltageTo10bitADC(float voltage) {
|
||||||
// divided by 2 because of voltage divider, then converted into 10bit ADC value (TunerStudio format)
|
// divided by 2 because of voltage divider, then converted into 10bit ADC value (TunerStudio format)
|
||||||
return (int) (voltage * TPS_TS_CONVERSION);
|
return (int) (voltage * TPS_TS_CONVERSION);
|
||||||
|
|
|
@ -24,13 +24,9 @@ percent_t getPedalPosition(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||||
*/
|
*/
|
||||||
percent_t getTPS(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
percent_t getTPS(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||||
percent_t getTPSWithIndex(int index DECLARE_ENGINE_PARAMETER_SUFFIX);
|
percent_t getTPSWithIndex(int index DECLARE_ENGINE_PARAMETER_SUFFIX);
|
||||||
bool hasTpsSensor(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
|
||||||
int convertVoltageTo10bitADC(float voltage);
|
int convertVoltageTo10bitADC(float voltage);
|
||||||
float getTPS10bitAdc(int index DECLARE_ENGINE_PARAMETER_SUFFIX);
|
|
||||||
bool hasSecondThrottleBody(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
bool hasSecondThrottleBody(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||||
float getTPSVoltage(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
|
||||||
percent_t getTpsValue(int index, float adc DECLARE_ENGINE_PARAMETER_SUFFIX);
|
percent_t getTpsValue(int index, float adc DECLARE_ENGINE_PARAMETER_SUFFIX);
|
||||||
void setBosch0280750009(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
|
||||||
void setMockTpsAdc(percent_t tpsPosition DECLARE_ENGINE_PARAMETER_SUFFIX);
|
void setMockTpsAdc(percent_t tpsPosition DECLARE_ENGINE_PARAMETER_SUFFIX);
|
||||||
void setMockTpsValue(percent_t tpsPosition DECLARE_ENGINE_PARAMETER_SUFFIX);
|
void setMockTpsValue(percent_t tpsPosition DECLARE_ENGINE_PARAMETER_SUFFIX);
|
||||||
void setMockThrottlePedalPosition(percent_t value DECLARE_ENGINE_PARAMETER_SUFFIX);
|
void setMockThrottlePedalPosition(percent_t value DECLARE_ENGINE_PARAMETER_SUFFIX);
|
||||||
|
|
Loading…
Reference in New Issue