From 0cf08d448821ac7030231b0c6a5c343681d1aa04 Mon Sep 17 00:00:00 2001 From: rusEfi Date: Tue, 18 Aug 2015 15:03:44 -0400 Subject: [PATCH] auto-sync --- .../controllers/algo/engine_configuration.cpp | 2 ++ .../engine_configuration_generated_structures.h | 16 ++++++++++++---- firmware/controllers/algo/rusefi_generated.h | 12 ++++++++---- firmware/controllers/controllers.mk | 1 + firmware/controllers/flash_main.h | 2 +- firmware/controllers/tachometer.cpp | 16 ++++++++++++++++ firmware/controllers/tachometer.h | 15 +++++++++++++++ firmware/integration/rusefi_config.txt | 6 ++++-- 8 files changed, 59 insertions(+), 11 deletions(-) create mode 100644 firmware/controllers/tachometer.cpp create mode 100644 firmware/controllers/tachometer.h diff --git a/firmware/controllers/algo/engine_configuration.cpp b/firmware/controllers/algo/engine_configuration.cpp index 19bdfef1cb..b450092f4a 100644 --- a/firmware/controllers/algo/engine_configuration.cpp +++ b/firmware/controllers/algo/engine_configuration.cpp @@ -195,6 +195,8 @@ void prepareVoidConfiguration(engine_configuration_s *activeConfiguration) { boardConfiguration->etbDirectionPin2 = GPIO_UNASSIGNED; boardConfiguration->o2heaterPin = GPIO_UNASSIGNED; + boardConfiguration->tachOutputPin = GPIO_UNASSIGNED; + boardConfiguration->malfunctionIndicatorPin = GPIO_UNASSIGNED; boardConfiguration->malfunctionIndicatorPinMode = OM_DEFAULT; diff --git a/firmware/controllers/algo/engine_configuration_generated_structures.h b/firmware/controllers/algo/engine_configuration_generated_structures.h index 7d77e9f412..16630059ec 100644 --- a/firmware/controllers/algo/engine_configuration_generated_structures.h +++ b/firmware/controllers/algo/engine_configuration_generated_structures.h @@ -1,4 +1,4 @@ -// this section was generated by config_definition.jar on Tue Aug 18 12:48:49 EDT 2015 +// this section was generated by config_definition.jar on Tue Aug 18 13:54:22 EDT 2015 // begin #include "rusefi_types.h" typedef struct { @@ -453,7 +453,11 @@ typedef struct { /** * offset 288 */ - float unusedADC[2]; + brain_pin_e tachOutputPin; + /** + * offset 292 + */ + pin_output_mode_e tachOutputPinMode; /** * offset 296 */ @@ -1246,7 +1250,11 @@ typedef struct { /** * offset 1824 */ - int unused3[83]; + float tachPulseDuractionMs; + /** + * offset 1828 + */ + int unused3[82]; /** * offset 2156 */ @@ -1457,4 +1465,4 @@ typedef struct { } persistent_config_s; // end -// this section was generated by config_definition.jar on Tue Aug 18 12:48:49 EDT 2015 +// this section was generated by config_definition.jar on Tue Aug 18 13:54:22 EDT 2015 diff --git a/firmware/controllers/algo/rusefi_generated.h b/firmware/controllers/algo/rusefi_generated.h index 3464e63ee5..2213839ea5 100644 --- a/firmware/controllers/algo/rusefi_generated.h +++ b/firmware/controllers/algo/rusefi_generated.h @@ -319,8 +319,10 @@ #define etbDT_offset 904 #define etbDT_offset_hex 388 #define hip9011CsPinMode_offset 908 -#define unusedADC_offset 912 -#define unusedADC_offset_hex 390 +#define tachOutputPin_offset 912 +#define tachOutputPin_offset_hex 390 +#define tachOutputPinMode_offset 916 +#define tachOutputPinMode_offset_hex 394 #define triggerInputPins1_offset 920 #define triggerInputPins1_offset_hex 398 #define triggerInputPins2_offset 924 @@ -649,8 +651,10 @@ #define crankingTpsCoef_offset 1760 #define crankingTpsBins_offset 1792 #define crankingTpsBins_offset_hex 700 -#define unused3_offset 1824 -#define unused3_offset_hex 720 +#define tachPulseDuractionMs_offset 1824 +#define tachPulseDuractionMs_offset_hex 720 +#define unused3_offset 1828 +#define unused3_offset_hex 724 #define targetVBatt_offset 2156 #define alternatorOffAboveTps_offset 2160 #define alternatorOffAboveTps_offset_hex 870 diff --git a/firmware/controllers/controllers.mk b/firmware/controllers/controllers.mk index b30e03fed4..83abd27cae 100644 --- a/firmware/controllers/controllers.mk +++ b/firmware/controllers/controllers.mk @@ -13,4 +13,5 @@ CONTROLLERS_SRC_CPP = $(PROJECT_DIR)/controllers/settings.cpp \ $(PROJECT_DIR)/controllers/malfunction_indicator.cpp \ $(PROJECT_DIR)/controllers/alternatorController.cpp \ $(PROJECT_DIR)/controllers/lcd_controller.cpp \ + $(PROJECT_DIR)/controllers/tachometer.cpp \ $(PROJECT_DIR)/controllers/engine_controller.cpp diff --git a/firmware/controllers/flash_main.h b/firmware/controllers/flash_main.h index 914b5e0297..cffcd79a4e 100644 --- a/firmware/controllers/flash_main.h +++ b/firmware/controllers/flash_main.h @@ -11,7 +11,7 @@ #include "engine.h" -#define FLASH_DATA_VERSION 8400 +#define FLASH_DATA_VERSION 8500 void readFromFlash(void); void initFlash(Logging *sharedLogger); diff --git a/firmware/controllers/tachometer.cpp b/firmware/controllers/tachometer.cpp new file mode 100644 index 0000000000..38c913fb9a --- /dev/null +++ b/firmware/controllers/tachometer.cpp @@ -0,0 +1,16 @@ +/* + * @file tachometer.cpp + * + * @date Aug 18, 2015 + * @author Andrey Belomutskiy, (c) 2012-2015 + */ + +#include "tachometer.h" + +EXTERN_ENGINE; + +void initTachometer(void) { + if (boardConfiguration->tachOutputPin == GPIO_UNASSIGNED) + return; + +} diff --git a/firmware/controllers/tachometer.h b/firmware/controllers/tachometer.h new file mode 100644 index 0000000000..928db05042 --- /dev/null +++ b/firmware/controllers/tachometer.h @@ -0,0 +1,15 @@ +/* + * @file tachometer.h + * + * @date Aug 18, 2015 + * @author Andrey Belomutskiy, (c) 2012-2015 + */ + +#ifndef CONTROLLERS_TACHOMETER_H_ +#define CONTROLLERS_TACHOMETER_H_ + +#include "engine.h" + +void initTachometer(void); + +#endif /* CONTROLLERS_TACHOMETER_H_ */ diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index ff8b57e37c..730d83852d 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -371,7 +371,8 @@ float etbIFactor; ego_sensor_e afr_type;AFR, WBO, EGO - whatever you like to call it; int etbDT; pin_output_mode_e hip9011CsPinMode; - float[2] unusedADC; + brain_pin_e tachOutputPin; + pin_output_mode_e tachOutputPinMode; brain_input_pin_e[3 iterate] triggerInputPins; brain_pin_e mainRelayPin; @@ -569,7 +570,8 @@ baro_corr_table_t baroCorrTable; float[CRANKING_CURVE_SIZE] crankingTpsCoef;;"%", 1, 0, 0.0, 700.0, 2 float[CRANKING_CURVE_SIZE] crankingTpsBins;;"%", 1, 0, 0.0, 100.0, 2 - int[83] unused3; + float tachPulseDuractionMs; + int[82] unused3; float targetVBatt;;"Volts", 1, 0, 0,30, 1 float alternatorOffAboveTps;Turn off alternator output above specified TPS;"%", 1, 0, 0, 200, 2