learning C++
This commit is contained in:
parent
f71ac2d11d
commit
86a0d67d70
|
@ -39,7 +39,7 @@ public:
|
|||
int fakeAdcValues[MOCK_ADC_SIZE];
|
||||
|
||||
void setMockVoltage(int hwChannel, float voltage);
|
||||
int getMockAdcValue(int hwChannel);
|
||||
int getMockAdcValue(int hwChannel) const;
|
||||
};
|
||||
|
||||
#define MAX_INJECTION_OUTPUT_COUNT INJECTION_PIN_COUNT
|
||||
|
@ -67,8 +67,7 @@ class ThermistorMath {
|
|||
public:
|
||||
void setConfig(thermistor_conf_s *config);
|
||||
void prepareThermistorCurve(thermistor_conf_s *tc);
|
||||
bool isLinearSensor();
|
||||
float getKelvinTemperatureByResistance(float resistance);
|
||||
float getKelvinTemperatureByResistance(float resistance) const;
|
||||
float s_h_a = 0;
|
||||
float s_h_b = 0;
|
||||
float s_h_c = 0;
|
||||
|
@ -137,7 +136,7 @@ class WarningCodeState {
|
|||
public:
|
||||
WarningCodeState();
|
||||
void addWarningCode(obd_code_e code);
|
||||
bool isWarningNow(efitimesec_t now, bool forIndicator DECLARE_ENGINE_PARAMETER_SUFFIX);
|
||||
bool isWarningNow(efitimesec_t now, bool forIndicator DECLARE_ENGINE_PARAMETER_SUFFIX) const;
|
||||
void clear();
|
||||
int warningCounter;
|
||||
int lastErrorCode;
|
||||
|
|
|
@ -58,7 +58,7 @@ void WarningCodeState::addWarningCode(obd_code_e code) {
|
|||
/**
|
||||
* @param forIndicator if we want to retrieving value for TS indicator, this case a minimal period is applued
|
||||
*/
|
||||
bool WarningCodeState::isWarningNow(efitimesec_t now, bool forIndicator DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
bool WarningCodeState::isWarningNow(efitimesec_t now, bool forIndicator DECLARE_ENGINE_PARAMETER_SUFFIX) const {
|
||||
int period = forIndicator ? maxI(3, engineConfiguration->warningPeriod) : engineConfiguration->warningPeriod;
|
||||
return absI(now - timeOfPreviousWarning) < period;
|
||||
}
|
||||
|
@ -229,7 +229,7 @@ SensorsState::SensorsState() {
|
|||
reset();
|
||||
}
|
||||
|
||||
int MockAdcState::getMockAdcValue(int hwChannel) {
|
||||
int MockAdcState::getMockAdcValue(int hwChannel) const {
|
||||
return fakeAdcValues[hwChannel];
|
||||
}
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ float getVoutInVoltageDividor(float Vin, float r1, float r2) {
|
|||
return r2 * Vin / (r1 + r2);
|
||||
}
|
||||
|
||||
float ThermistorMath::getKelvinTemperatureByResistance(float resistance) {
|
||||
float ThermistorMath::getKelvinTemperatureByResistance(float resistance) const {
|
||||
if (resistance <= 0) {
|
||||
//warning("Invalid resistance in getKelvinTemperature=", resistance);
|
||||
return 0.0f;
|
||||
|
|
|
@ -120,7 +120,7 @@ efitime_t TriggerState::getTotalEventCounter() {
|
|||
return totalEventCountBase + currentCycle.current_index;
|
||||
}
|
||||
|
||||
int TriggerState::getTotalRevolutionCounter() {
|
||||
int TriggerState::getTotalRevolutionCounter() const {
|
||||
return totalRevolutionCounter;
|
||||
}
|
||||
|
||||
|
@ -263,7 +263,7 @@ void TriggerState::reset() {
|
|||
isFirstEvent = true;
|
||||
}
|
||||
|
||||
int TriggerState::getCurrentIndex() {
|
||||
int TriggerState::getCurrentIndex() const {
|
||||
return currentCycle.current_index;
|
||||
}
|
||||
|
||||
|
@ -271,7 +271,7 @@ void TriggerState::incrementTotalEventCounter() {
|
|||
totalRevolutionCounter++;
|
||||
}
|
||||
|
||||
bool TriggerState::isEvenRevolution() {
|
||||
bool TriggerState::isEvenRevolution() const {
|
||||
return totalRevolutionCounter & 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -50,12 +50,12 @@ public:
|
|||
/**
|
||||
* current trigger processing index, between zero and #size
|
||||
*/
|
||||
int getCurrentIndex();
|
||||
int getTotalRevolutionCounter();
|
||||
int getCurrentIndex() const;
|
||||
int getTotalRevolutionCounter() const;
|
||||
/**
|
||||
* this is important for crank-based virtual trigger and VVT magic
|
||||
*/
|
||||
bool isEvenRevolution();
|
||||
bool isEvenRevolution() const;
|
||||
void incrementTotalEventCounter();
|
||||
efitime_t getTotalEventCounter();
|
||||
efitime_t getStartOfRevolutionIndex();
|
||||
|
|
Loading…
Reference in New Issue