mirror of https://github.com/rusefi/rusefi.git
use timer instead of home spun time math
This commit is contained in:
parent
b6a3d4f977
commit
6d010189e3
|
@ -70,10 +70,9 @@ public:
|
|||
*/
|
||||
angle_t sparkAngle = NAN;
|
||||
floatms_t sparkDwell = 0;
|
||||
/**
|
||||
* this timestamp allows us to measure actual dwell time
|
||||
*/
|
||||
uint32_t actualStartOfDwellNt = 0;
|
||||
|
||||
// this timer allows us to measure actual dwell time
|
||||
Timer actualDwellTimer;
|
||||
|
||||
float dwellAngle = 0;
|
||||
|
||||
|
|
|
@ -208,11 +208,12 @@ void fireSparkAndPrepareNextSchedule(IgnitionEvent *event) {
|
|||
#if !EFI_UNIT_TEST
|
||||
if (engineConfiguration->debugMode == DBG_DWELL_METRIC) {
|
||||
#if EFI_TUNER_STUDIO
|
||||
uint32_t actualDwellDurationNt = getTimeNowLowerNt() - event->actualStartOfDwellNt;
|
||||
float actualDwellMs = event->actualDwellTimer.getElapsedSeconds(nowNt) * 1e3;
|
||||
|
||||
/**
|
||||
* ratio of desired dwell duration to actual dwell duration gives us some idea of how good is input trigger jitter
|
||||
*/
|
||||
float ratio = NT2US(actualDwellDurationNt) / 1000.0 / event->sparkDwell;
|
||||
float ratio = actualDwellMs / event->sparkDwell;
|
||||
|
||||
// todo: smarted solution for index to field mapping
|
||||
switch (event->cylinderIndex) {
|
||||
|
|
Loading…
Reference in New Issue