From c7943ada6b93b1d68a898bdfc4342a94dbe7cb65 Mon Sep 17 00:00:00 2001 From: rusEfi Date: Sat, 14 Feb 2015 14:04:21 -0600 Subject: [PATCH] auto-sync --- firmware/controllers/algo/engine_configuration.cpp | 2 +- firmware/controllers/sensors/tps.cpp | 4 ++++ firmware/controllers/settings.cpp | 5 +++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/firmware/controllers/algo/engine_configuration.cpp b/firmware/controllers/algo/engine_configuration.cpp index 4375e55f4a..54f5f30d7b 100644 --- a/firmware/controllers/algo/engine_configuration.cpp +++ b/firmware/controllers/algo/engine_configuration.cpp @@ -526,7 +526,7 @@ void setDefaultConfiguration(engine_configuration_s *engineConfiguration, board_ boardConfiguration->hip9011Gain = 1; boardConfiguration->isSdCardEnabled = true; - boardConfiguration->isFastAdcEnabled = false; + boardConfiguration->isFastAdcEnabled = true; boardConfiguration->isEngineControlEnabled = true; boardConfiguration->tunerStudioSerialSpeed = TS_DEFAULT_SPEED; diff --git a/firmware/controllers/sensors/tps.cpp b/firmware/controllers/sensors/tps.cpp index 311d48b1f2..c07e9f53ab 100644 --- a/firmware/controllers/sensors/tps.cpp +++ b/firmware/controllers/sensors/tps.cpp @@ -97,12 +97,16 @@ static float getPrimatyRawTPS(DECLARE_ENGINE_PARAMETER_F) { // todo: static float getSecondaryRawTPS +#define NO_TPS_MAGIC_VALUE 66.6 + /* * In case of dual TPS this function would return logical TPS position * * @return Current TPS position, percent of WOT. 0 means idle and 100 means Wide Open Throttle */ float getTPS(DECLARE_ENGINE_PARAMETER_F) { + if(!engineConfiguration->hasTpsSensor) + return NO_TPS_MAGIC_VALUE; // todo: if (config->isDualTps) // todo: blah blah // todo: if two TPS do not match - show OBD code via malfunction_central.c diff --git a/firmware/controllers/settings.cpp b/firmware/controllers/settings.cpp index 6115b1d872..d02608eb36 100644 --- a/firmware/controllers/settings.cpp +++ b/firmware/controllers/settings.cpp @@ -384,6 +384,11 @@ static void printMAPInfo(void) { static void printTPSInfo(void) { #if (EFI_PROD_CODE && HAL_USE_ADC) || defined(__DOXYGEN__) + if(!engineConfiguration->hasTpsSensor) { + scheduleMsg(&logger, "NO TPS SENSOR"); + return; + } + GPIO_TypeDef* port = getAdcChannelPort(engineConfiguration->tpsAdcChannel); int pin = getAdcChannelPin(engineConfiguration->tpsAdcChannel);