auto-sync

This commit is contained in:
rusEfi 2016-07-19 21:04:11 -04:00
parent 22c2715a6e
commit d5cdd33ac7
5 changed files with 13 additions and 8 deletions

View File

@ -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

View File

@ -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);

View File

@ -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));
}
}

View File

@ -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

View File

@ -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;