diff --git a/firmware/config/engines/dodge_neon.cpp b/firmware/config/engines/dodge_neon.cpp index 0fe94bc532..51221d1793 100644 --- a/firmware/config/engines/dodge_neon.cpp +++ b/firmware/config/engines/dodge_neon.cpp @@ -288,16 +288,16 @@ void setDodgeNeonNGCEngineConfiguration(engine_configuration_s *engineConfigurat /** * Frankenso analog #1 PC2 ADC12 CLT * Frankenso analog #2 PC1 ADC11 IAT - * Frankenso analog #3 + * Frankenso analog #3 PA0 ADC0 * Frankenso analog #4 PC3 ADC13 - * Frankenso analog #5 - * Frankenso analog #6 + * Frankenso analog #5 PA2 ADC2 + * Frankenso analog #6 PA1 ADC1 * Frankenso analog #7 PA4 ADC4 WBO AFR - * Frankenso analog #8 - * Frankenso analog #9 + * Frankenso analog #8 PA3 ADC3 + * Frankenso analog #9 PA7 ADC7 * Frankenso analog #10 PA6 ADC6 MAP * Frankenso analog #11 PC5 ADC15 TPS - * Frankenso analog #12 VBatt + * Frankenso analog #12 PC4 ADC14 VBatt */ @@ -313,10 +313,20 @@ void setDodgeNeonNGCEngineConfiguration(engine_configuration_s *engineConfigurat engineConfiguration->map.sensor.hwChannel = EFI_ADC_6; boardConfiguration->adcHwChannelEnabled[0] = ADC_SLOW; // ADC0 - PA0 - boardConfiguration->adcHwChannelEnabled[1] = ADC_SLOW; + boardConfiguration->adcHwChannelEnabled[1] = ADC_SLOW; // just for test + boardConfiguration->adcHwChannelEnabled[2] = ADC_SLOW; // just for test + boardConfiguration->adcHwChannelEnabled[3] = ADC_SLOW; // just for test + boardConfiguration->adcHwChannelEnabled[4] = ADC_SLOW; + boardConfiguration->adcHwChannelEnabled[5] = ADC_OFF; boardConfiguration->adcHwChannelEnabled[6] = ADC_FAST; + boardConfiguration->adcHwChannelEnabled[7] = ADC_SLOW; // just for test + + boardConfiguration->adcHwChannelEnabled[8] = ADC_OFF; + boardConfiguration->adcHwChannelEnabled[9] = ADC_OFF; + boardConfiguration->adcHwChannelEnabled[10] = ADC_OFF; boardConfiguration->adcHwChannelEnabled[11] = ADC_SLOW; // IAT + boardConfiguration->adcHwChannelEnabled[12] = ADC_SLOW; // CLT boardConfiguration->adcHwChannelEnabled[13] = ADC_SLOW; // AFR boardConfiguration->adcHwChannelEnabled[14] = ADC_SLOW; // VBatt diff --git a/firmware/hw_layer/adc_inputs.cpp b/firmware/hw_layer/adc_inputs.cpp index 2f4f294511..f33588cad6 100644 --- a/firmware/hw_layer/adc_inputs.cpp +++ b/firmware/hw_layer/adc_inputs.cpp @@ -88,7 +88,10 @@ ADC_TwoSamplingDelay_20Cycles, // cr1 ADC_SMPR1_SMP_AN10(MY_SAMPLING_SLOW) | ADC_SMPR1_SMP_AN11(MY_SAMPLING_SLOW) | ADC_SMPR1_SMP_AN12(MY_SAMPLING_SLOW) | - ADC_SMPR1_SMP_AN13(MY_SAMPLING_SLOW), // sample times for channels 10...18 + ADC_SMPR1_SMP_AN13(MY_SAMPLING_SLOW) | + ADC_SMPR1_SMP_AN14(MY_SAMPLING_SLOW) | + ADC_SMPR1_SMP_AN15(MY_SAMPLING_SLOW) + , // sample times for channels 10...18 ADC_SMPR2_SMP_AN0(MY_SAMPLING_SLOW) | ADC_SMPR2_SMP_AN1(MY_SAMPLING_SLOW) | ADC_SMPR2_SMP_AN3(MY_SAMPLING_SLOW) | @@ -102,20 +105,8 @@ ADC_TwoSamplingDelay_20Cycles, // cr1 , // In this field must be specified the sample times for channels 0...9 0, // Conversion group sequence 13...16 + sequence length - - 0 -// | ADC_SQR2_SQ7_N(ADC_CHANNEL_IN12) /* PC2 - green */ -// | ADC_SQR2_SQ8_N(ADC_CHANNEL_IN13) /* PC3 - yellow maf? */ - - ,// Conversion group sequence 7...12 - 0 -// | ADC_SQR3_SQ1_N(ADC_CHANNEL_IN6) /* PA6 - white */ -// | ADC_SQR3_SQ2_N(ADC_CHANNEL_IN7) /* PA7 - blue */ -// | ADC_SQR3_SQ3_N(ADC_CHANNEL_IN14) /* PC4 - green */ -// | ADC_SQR3_SQ4_N(ADC_CHANNEL_IN15) /* PC5 - yellow */ -// | ADC_SQR3_SQ5_N(ADC_CHANNEL_IN8) /* PB0 - blue */ -// | ADC_SQR3_SQ6_N(ADC_CHANNEL_IN9) /* PB1 - white */ -// Conversion group sequence 1...6 + 0, // Conversion group sequence 7...12 + 0 // Conversion group sequence 1...6 }; AdcDevice slowAdc(&adcgrpcfgSlow); @@ -480,7 +471,10 @@ void initAdcInputs(bool boardTestMode) { for (int adc = 0; adc < HW_MAX_ADC_INDEX; adc++) { adc_channel_mode_e mode = boardConfiguration->adcHwChannelEnabled[adc]; - if (mode == ADC_SLOW) { + /** + * 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)); } else if (mode == ADC_FAST) { fastAdc.addChannel((adc_channel_e) (ADC_CHANNEL_IN0 + adc)); @@ -489,7 +483,7 @@ void initAdcInputs(bool boardTestMode) { slowAdc.init(); pwmStart(EFI_INTERNAL_SLOW_ADC_PWM, &pwmcfg_slow); - if (boardConfiguration->isFastAdcEnabled || boardTestMode) { + if (boardConfiguration->isFastAdcEnabled) { fastAdc.init(); /* * Initializes the PWM driver. diff --git a/firmware/hw_layer/board_test.cpp b/firmware/hw_layer/board_test.cpp index f70698a971..5f8801569c 100644 --- a/firmware/hw_layer/board_test.cpp +++ b/firmware/hw_layer/board_test.cpp @@ -40,7 +40,7 @@ static bool isTimeForNextStep(int copy) { extern AdcDevice slowAdc; extern AdcDevice fastAdc; -static void processAdcPin(AdcDevice *adc, int index, const char *prefix) { +static void processAdcPin(AdcDevice *adc, int index) { adc_channel_e hwIndex = adc->getAdcHardwareIndexByInternalIndex(index); GPIO_TypeDef* port = getAdcChannelPort(hwIndex); int pin = getAdcChannelPin(hwIndex); @@ -50,7 +50,7 @@ static void processAdcPin(AdcDevice *adc, int index, const char *prefix) { int c = 0; while (!isTimeForNextStep(copy)) { - print("%s ch%d hwIndex=%d %s%d\r\n", prefix, index, hwIndex, portname(port), pin); + print("ch%d hwIndex=%d %s%d\r\n", index, hwIndex, portname(port), pin); int adcValue = adc->getAdcValueByIndex(index); // print("ADC%d val= %d%s", hwIndex, value, DELIMETER); @@ -158,11 +158,13 @@ static void btInitOutputPins() { } static void blinkAllOutputPins() { + int msgCounter = 0; for (int k = 0; k < 6; k++) { for (int i = 0; i < pinsCount; i++) { currentPin = BLINK_PINS[i]; setCurrentPinValue(k % 2); } + print("blinking %d\r\n", msgCounter++); chThdSleepMilliseconds(250); } currentPin = GPIO_UNASSIGNED; @@ -176,6 +178,7 @@ static void blinkAllOutputPins() { currentPin = BLINK_PINS[i]; setCurrentPinValue(true); + print("blinking %d!\r\n", msgCounter++); chThdSleepMilliseconds(250); } } @@ -195,9 +198,11 @@ void initBoardTest(void) { // this code is ugly as hell, I had no time to think. Todo: refactor #if HAL_USE_ADC || defined(__DOXYGEN__) - processAdcPin(&fastAdc, 0, "fast"); + /** + * in board test mode all currently enabled ADC channels are running in slow mode + */ while (currentIndex < slowAdc.size()) { - processAdcPin(&slowAdc, currentIndex, "slow"); + processAdcPin(&slowAdc, currentIndex); currentIndex++; } #endif diff --git a/firmware/rusefi.cpp b/firmware/rusefi.cpp index e3f622efd1..c5464cc747 100644 --- a/firmware/rusefi.cpp +++ b/firmware/rusefi.cpp @@ -260,5 +260,5 @@ int getRusEfiVersion(void) { return 1; // this is here to make the compiler happy about the unused array if (UNUSED_CCM_SIZE == 0) return 1; // this is here to make the compiler happy about the unused array - return 20150125; + return 20150126; } diff --git a/firmware/svnversion.h b/firmware/svnversion.h index 16099bdfa9..5820bae8a3 100644 --- a/firmware/svnversion.h +++ b/firmware/svnversion.h @@ -1,5 +1,5 @@ // This file was generated by Version2Header -// Tue Jan 13 21:00:28 EST 2015 +// Mon Jan 26 21:23:28 EST 2015 #ifndef VCS_VERSION -#define VCS_VERSION "6353" +#define VCS_VERSION "6545" #endif