mirror of https://github.com/rusefi/rusefi-1.git
This commit is contained in:
parent
6b1edd9e29
commit
50bf018fe9
|
@ -26,6 +26,7 @@
|
||||||
|
|
||||||
#define VVT_NAME "VVT"
|
#define VVT_NAME "VVT"
|
||||||
|
|
||||||
|
// we use this value in case of noise on trigger input lines
|
||||||
#define NOISY_RPM -1
|
#define NOISY_RPM -1
|
||||||
#define UNREALISTIC_RPM 30000
|
#define UNREALISTIC_RPM 30000
|
||||||
|
|
||||||
|
|
|
@ -181,6 +181,9 @@ float TriggerStateWithRunningStatistics::calculateInstantRpm(int *prevIndex, efi
|
||||||
*/
|
*/
|
||||||
angle_t currentAngle = TRIGGER_SHAPE(eventAngles[current_index]);
|
angle_t currentAngle = TRIGGER_SHAPE(eventAngles[current_index]);
|
||||||
// todo: make this '90' depend on cylinder count or trigger shape?
|
// todo: make this '90' depend on cylinder count or trigger shape?
|
||||||
|
if (cisnan(currentAngle)) {
|
||||||
|
return NOISY_RPM;
|
||||||
|
}
|
||||||
angle_t previousAngle = currentAngle - 90;
|
angle_t previousAngle = currentAngle - 90;
|
||||||
fixAngle(previousAngle, "prevAngle", CUSTOM_ERR_6560);
|
fixAngle(previousAngle, "prevAngle", CUSTOM_ERR_6560);
|
||||||
// todo: prevIndex should be pre-calculated
|
// todo: prevIndex should be pre-calculated
|
||||||
|
|
Loading…
Reference in New Issue