"sensor chart" for aux fast analog input
This commit is contained in:
parent
b7f689d811
commit
6555e4b305
|
@ -819,6 +819,6 @@ int getRusEfiVersion(void) {
|
|||
if (initBootloader() != 0)
|
||||
return 123;
|
||||
#endif /* EFI_BOOTLOADER_INCLUDE_CODE */
|
||||
return 20191130;
|
||||
return 20191202;
|
||||
}
|
||||
#endif /* EFI_UNIT_TEST */
|
||||
|
|
|
@ -2,15 +2,12 @@
|
|||
* @file sensor_chart.h
|
||||
*
|
||||
* @date Dec 20, 2013
|
||||
* @author Andrey Belomutskiy, (c) 2012-2017
|
||||
* @author Andrey Belomutskiy, (c) 2012-2019
|
||||
*/
|
||||
|
||||
#ifndef SENSOR_CHART_H_
|
||||
#define SENSOR_CHART_H_
|
||||
#pragma once
|
||||
|
||||
#include "global.h"
|
||||
|
||||
void scAddData(float angle, float value);
|
||||
void initSensorChart(void);
|
||||
|
||||
#endif /* SENSOR_CHART_H_ */
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include "accelerometer.h"
|
||||
#include "eficonsole.h"
|
||||
#include "console_io.h"
|
||||
#include "sensor_chart.h"
|
||||
|
||||
#include "mpu_util.h"
|
||||
//#include "usb_msd.h"
|
||||
|
@ -188,8 +189,6 @@ static int fastMapSampleIndex;
|
|||
static int hipSampleIndex;
|
||||
static int tpsSampleIndex;
|
||||
|
||||
extern int tpsFastAdc;
|
||||
|
||||
#if HAL_USE_ADC
|
||||
extern AdcDevice fastAdc;
|
||||
|
||||
|
@ -216,6 +215,11 @@ void adc_callback_fast(ADCDriver *adcp, adcsample_t *buffer, size_t n) {
|
|||
*/
|
||||
efiAssertVoid(CUSTOM_ERR_6676, getCurrentRemainingStack() > 128, "lowstck#9b");
|
||||
|
||||
if (ENGINE(sensorChartMode) == SC_AUX_FAST1) {
|
||||
float voltage = getAdcValue("fAux1", engineConfiguration->bc.auxFastSensor1_adcChannel);
|
||||
scAddData(getCrankshaftAngleNt(getTimeNowNt() PASS_ENGINE_PARAMETER_SUFFIX), voltage);
|
||||
}
|
||||
|
||||
#if EFI_MAP_AVERAGING
|
||||
mapAveragingAdcCallback(fastAdc.samples[fastMapSampleIndex]);
|
||||
#endif /* EFI_MAP_AVERAGING */
|
||||
|
@ -242,6 +246,7 @@ static void calcFastAdcIndexes(void) {
|
|||
} else {
|
||||
tpsSampleIndex = TPS_IS_SLOW;
|
||||
}
|
||||
|
||||
#endif/* HAL_USE_ADC */
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue