Skip to content

Commit f38cdc1

Browse files
committed
Force reset of HR calc on CPR
1 parent 10326c7 commit f38cdc1

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

src/simmgrCommon.cpp

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -631,9 +631,6 @@ int hrLogReportLoops = 0;
631631
static void
632632
hrcheck_handler(int sig, siginfo_t *si, void *uc)
633633
{
634-
#if 0
635-
simmgr_shm->status.cardiac.avg_rate = simmgr_shm->status.cardiac.rate;
636-
#else
637634
int now; // Current msec time
638635
int prev;
639636
int beats;
@@ -654,7 +651,19 @@ hrcheck_handler(int sig, siginfo_t *si, void *uc)
654651

655652
now = msec_time_update();
656653

657-
if ( hrLogLastNatural != simmgr_shm->status.cardiac.pulseCount )
654+
if ( simmgr_shm->status.cpr.running )
655+
{
656+
hrLogLastNatural = simmgr_shm->status.cardiac.pulseCount;
657+
hrLogLastVPC = simmgr_shm->status.cardiac.pulseCountVpc;
658+
simmgr_shm->status.cardiac.avg_rate = 0;
659+
firstTime = now - 30000;
660+
for ( i = 0 ; i < HR_LOG_LEN ; i++ )
661+
{
662+
hrLog[i] = firstTime;
663+
}
664+
return;
665+
}
666+
else if ( hrLogLastNatural != simmgr_shm->status.cardiac.pulseCount )
658667
{
659668
hrLogLastNatural = simmgr_shm->status.cardiac.pulseCount;
660669
newBeat = 1;
@@ -766,7 +775,6 @@ hrcheck_handler(int sig, siginfo_t *si, void *uc)
766775
simmgr_shm->status.cardiac.avg_rate = round(avg_rate );
767776
}
768777
}
769-
#endif
770778
}
771779
/*
772780
* msec_timer_update

0 commit comments

Comments
 (0)