ETB micro progress
This commit is contained in:
parent
f6c5f8764a
commit
67e8adf6f5
|
@ -36,6 +36,7 @@
|
|||
#include "settings.h"
|
||||
#include "idle_thread.h"
|
||||
#include "periodic_controller.h"
|
||||
#include "tps.h"
|
||||
|
||||
EXTERN_ENGINE
|
||||
;
|
||||
|
@ -250,8 +251,15 @@ static void handleCommandX14(uint16_t index) {
|
|||
// cmd_test_fuel_pump
|
||||
fuelPumpBench();
|
||||
return;
|
||||
case 2:
|
||||
grabTPSIsClosed();
|
||||
return;
|
||||
case 3:
|
||||
grabTPSIsWideOpen();
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// todo: this is probably a wrong place for this method now
|
||||
|
|
|
@ -5,8 +5,11 @@
|
|||
#include "tps.h"
|
||||
#include "interpolation.h"
|
||||
#include "analog_input.h"
|
||||
#if EFI_PROD_CODE
|
||||
#include "settings.h"
|
||||
#endif /* EFI_PROD_CODE */
|
||||
|
||||
EXTERN_ENGINE;
|
||||
EXTERN_ENGINE;
|
||||
|
||||
#if !EFI_PROD_CODE
|
||||
static int mockTps;
|
||||
|
@ -127,6 +130,20 @@ int getTPS12bitAdc(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|||
#endif /* EFI_PROD_CODE */
|
||||
}
|
||||
|
||||
void grabTPSIsClosed() {
|
||||
#if EFI_PROD_CODE
|
||||
engineConfiguration->tpsMin = getTPS10bitAdc();
|
||||
printTPSInfo();
|
||||
#endif /* EFI_PROD_CODE */
|
||||
}
|
||||
|
||||
void grabTPSIsWideOpen() {
|
||||
#if EFI_PROD_CODE
|
||||
engineConfiguration->tpsMax = getTPS10bitAdc();
|
||||
printTPSInfo();
|
||||
#endif /* EFI_PROD_CODE */
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Position on physical primary TPS
|
||||
*/
|
||||
|
|
|
@ -27,11 +27,14 @@ percent_t getTPS(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
|||
bool hasTpsSensor(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||
int convertVoltageTo10bitADC(float voltage);
|
||||
int getTPS12bitAdc(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||
#define getTPS10bitAdc() (getTPS12bitAdc() / TPS_TS_CONVERSION)
|
||||
float getTPSVoltage(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||
percent_t getTpsValue(int adc DECLARE_ENGINE_PARAMETER_SUFFIX);
|
||||
void setBosch0280750009(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||
void setMockTpsPosition(percent_t tpsPosition);
|
||||
void setMockPedalPosition(percent_t value);
|
||||
void grabTPSIsClosed();
|
||||
void grabTPSIsWideOpen();
|
||||
|
||||
typedef struct {
|
||||
efitimeus_t prevTime;
|
||||
|
|
|
@ -408,7 +408,7 @@ static void printThermistor(const char *msg, ThermistorConf *config, ThermistorM
|
|||
scheduleMsg(&logger, "==============================");
|
||||
}
|
||||
|
||||
static void printTPSInfo(void) {
|
||||
void printTPSInfo(void) {
|
||||
#if EFI_PROD_CODE && HAL_USE_ADC
|
||||
if (!hasTpsSensor()) {
|
||||
scheduleMsg(&logger, "NO TPS SENSOR");
|
||||
|
@ -419,7 +419,7 @@ static void printTPSInfo(void) {
|
|||
scheduleMsg(&logger, "tps min (closed) %d/max (full) %d v=%.2f @%s", engineConfiguration->tpsMin, engineConfiguration->tpsMax,
|
||||
getTPSVoltage(PASS_ENGINE_PARAMETER_SIGNATURE), getPinNameByAdcChannel("tps", engineConfiguration->tpsAdcChannel, pinNameBuffer));
|
||||
#endif /* EFI_PROD_CODE */
|
||||
scheduleMsg(&logger, "current 10bit=%d value=%.2f rate=%.2f", getTPS12bitAdc() / TPS_TS_CONVERSION, getTPS(PASS_ENGINE_PARAMETER_SIGNATURE),
|
||||
scheduleMsg(&logger, "current 10bit=%d value=%.2f rate=%.2f", getTPS10bitAdc(), getTPS(PASS_ENGINE_PARAMETER_SIGNATURE),
|
||||
getTpsRateOfChange());
|
||||
}
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ void printSpiState(Logging *logger, board_configuration_s *boardConfiguration);
|
|||
void printConfiguration(const engine_configuration_s *engineConfiguration);
|
||||
void scheduleStopEngine(void);
|
||||
void setCallFromPitStop(int durationMs);
|
||||
void printTPSInfo(void);
|
||||
void setEngineType(int value);
|
||||
/**
|
||||
* See also getEngine_type_e()
|
||||
|
|
Loading…
Reference in New Issue