rusefi-1/firmware/hw_layer/cdm_ion_sense.h

42 lines
889 B
C
Raw Normal View History

2018-12-31 13:00:41 -08:00
/*
2019-05-05 15:53:34 -07:00
* @file cdm_ion_sense.h
2018-12-31 13:00:41 -08:00
*
2019-05-05 15:53:34 -07:00
* @date Dec 31, 2018
2020-01-07 21:02:40 -08:00
* @author Andrey Belomutskiy, (c) 2012-2020
2018-12-31 13:00:41 -08:00
*/
#ifndef HW_LAYER_CDM_ION_SENSE_H_
#define HW_LAYER_CDM_ION_SENSE_H_
#include "global.h"
2019-01-04 20:47:39 -08:00
class CdmState {
public:
CdmState();
2019-05-05 15:53:34 -07:00
int totalCdmEvents = 0;
int accumilatingAtRevolution = -1;
2019-01-04 20:47:39 -08:00
/**
* accumulated value for engine cycle which is not over yet
*/
2019-05-05 15:53:34 -07:00
int accumulatingCurrentValue;
2019-01-04 20:47:39 -08:00
/**
* event counter for previous complete engine cycle
*/
2019-05-05 15:53:34 -07:00
int currentValue = 0;
int currentValueAtIndex = -1;
2019-01-04 20:47:39 -08:00
void onNewSignal(int currentRevolution);
2019-05-05 15:53:34 -07:00
void applyAccumulatedData(int currentRevolution);
int getValue(int currentRevolution);
2019-01-04 20:47:39 -08:00
};
2019-01-03 20:51:29 -08:00
#if EFI_TUNER_STUDIO
#include "tunerstudio_configuration.h"
2018-12-31 13:00:41 -08:00
void ionPostState(TunerStudioOutputChannels *tsOutputChannels);
2019-01-03 20:51:29 -08:00
#endif
2018-12-31 13:00:41 -08:00
2019-01-04 20:47:39 -08:00
void cdmIonInit(void);
2019-05-05 15:53:34 -07:00
int getCurrentCdmValue(int currentRevolution);
2019-01-04 20:47:39 -08:00
2018-12-31 13:00:41 -08:00
#endif /* HW_LAYER_CDM_ION_SENSE_H_ */