From c56bb35a8d855fed16ca2aa9d8c3f878f1b58b5a Mon Sep 17 00:00:00 2001 From: rusEfi Date: Tue, 19 Jul 2016 21:04:11 -0400 Subject: [PATCH] auto-sync --- firmware/controllers/algo/rusefi_generated.h | 2 +- firmware/hw_layer/AdcConfiguration.h | 3 ++- firmware/hw_layer/adc_inputs.cpp | 10 +++++++--- firmware/integration/rusefi_config.txt | 2 +- java_console/models/src/com/rusefi/config/Fields.java | 4 ++-- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/firmware/controllers/algo/rusefi_generated.h b/firmware/controllers/algo/rusefi_generated.h index 7d838bac4e..6b08fd45e4 100644 --- a/firmware/controllers/algo/rusefi_generated.h +++ b/firmware/controllers/algo/rusefi_generated.h @@ -17,7 +17,7 @@ #define EGT_CHANNEL_COUNT 8 #define JOYSTICK_PIN_COUNT 5 #define DIGIPOT_COUNT 4 -#define HW_MAX_ADC_INDEX 16 +#define HW_MAX_ADC_INDEX 17 #define TRIGGER_SIMULATOR_PIN_COUNT 3 #define LOGIC_ANALYZER_CHANNEL_COUNT 4 #define LE_COMMAND_COUNT 16 diff --git a/firmware/hw_layer/AdcConfiguration.h b/firmware/hw_layer/AdcConfiguration.h index 9c500acafc..16f22f4cb1 100644 --- a/firmware/hw_layer/AdcConfiguration.h +++ b/firmware/hw_layer/AdcConfiguration.h @@ -12,7 +12,8 @@ class AdcDevice { public: AdcDevice(ADCConversionGroup* hwConfig); - void addChannel(adc_channel_e hwChannelIndex); + void enableChannel(adc_channel_e hwChannelIndex); + void enableChannelAndPin(adc_channel_e hwChannelIndex); adc_channel_e getAdcHardwareIndexByInternalIndex(int index); int internalAdcIndexByHardwareIndex[20]; bool isHwUsed(adc_channel_e hwChannel); diff --git a/firmware/hw_layer/adc_inputs.cpp b/firmware/hw_layer/adc_inputs.cpp index e33fd84702..f7e666c94c 100644 --- a/firmware/hw_layer/adc_inputs.cpp +++ b/firmware/hw_layer/adc_inputs.cpp @@ -411,7 +411,7 @@ bool AdcDevice::isHwUsed(adc_channel_e hwChannelIndex) { return false; } -void AdcDevice::addChannel(adc_channel_e hwChannel) { +void AdcDevice::enableChannel(adc_channel_e hwChannel) { int logicChannel = channelCount++; internalAdcIndexByHardwareIndex[hwChannel] = logicChannel; @@ -424,6 +424,10 @@ void AdcDevice::addChannel(adc_channel_e hwChannel) { hwConfig->sqr1 += (hwChannel) << (5 * (logicChannel - 12)); } // todo: support for more then 12 channels? not sure how needed it would be +} + +void AdcDevice::enableChannelAndPin(adc_channel_e hwChannel) { + enableChannel(hwChannel); initAdcHwChannel(hwChannel); } @@ -548,9 +552,9 @@ void initAdcInputs(bool boardTestMode) { * in board test mode all currently enabled ADC channels are running in slow mode */ if (mode == ADC_SLOW || (boardTestMode && mode == ADC_FAST)) { - slowAdc.addChannel((adc_channel_e) (ADC_CHANNEL_IN0 + adc)); + slowAdc.enableChannelAndPin((adc_channel_e) (ADC_CHANNEL_IN0 + adc)); } else if (mode == ADC_FAST) { - fastAdc.addChannel((adc_channel_e) (ADC_CHANNEL_IN0 + adc)); + fastAdc.enableChannelAndPin((adc_channel_e) (ADC_CHANNEL_IN0 + adc)); } } diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index 03b9a9363b..cb882d17c6 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -47,7 +47,7 @@ struct_no_prefix engine_configuration_s #define EGT_CHANNEL_COUNT 8 #define JOYSTICK_PIN_COUNT 5 #define DIGIPOT_COUNT 4 -#define HW_MAX_ADC_INDEX 16 +#define HW_MAX_ADC_INDEX 17 #define TRIGGER_SIMULATOR_PIN_COUNT 3 #define LOGIC_ANALYZER_CHANNEL_COUNT 4 #define LE_COMMAND_COUNT 16 diff --git a/java_console/models/src/com/rusefi/config/Fields.java b/java_console/models/src/com/rusefi/config/Fields.java index cc44c6b264..b363bc1520 100644 --- a/java_console/models/src/com/rusefi/config/Fields.java +++ b/java_console/models/src/com/rusefi/config/Fields.java @@ -1,6 +1,6 @@ package com.rusefi.config; -// this file was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Tue Jul 19 09:56:19 EDT 2016 +// this file was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Tue Jul 19 20:52:56 EDT 2016 public class Fields { public static final int LE_COMMAND_LENGTH = 200; public static final int FSIO_ADC_COUNT = 4; @@ -21,7 +21,7 @@ public class Fields { public static final int EGT_CHANNEL_COUNT = 8; public static final int JOYSTICK_PIN_COUNT = 5; public static final int DIGIPOT_COUNT = 4; - public static final int HW_MAX_ADC_INDEX = 16; + public static final int HW_MAX_ADC_INDEX = 17; public static final int TRIGGER_SIMULATOR_PIN_COUNT = 3; public static final int LOGIC_ANALYZER_CHANNEL_COUNT = 4; public static final int LE_COMMAND_COUNT = 16;