summaryrefslogtreecommitdiff
path: root/utils/Timer.cc
diff options
context:
space:
mode:
authorchatty1993-12-22 12:24:41 +0000
committerchatty1993-12-22 12:24:41 +0000
commit6467209d75c96a4a959177b562f408f1b59f4125 (patch)
tree7f6e57c6124bb0c06d981e716725f5d6de90656c /utils/Timer.cc
parentcdf8de1c026efbe1f1b521c7fae5b9b284e1ba50 (diff)
downloadivy-league-6467209d75c96a4a959177b562f408f1b59f4125.zip
ivy-league-6467209d75c96a4a959177b562f408f1b59f4125.tar.gz
ivy-league-6467209d75c96a4a959177b562f408f1b59f4125.tar.bz2
ivy-league-6467209d75c96a4a959177b562f408f1b59f4125.tar.xz
Added ChangeNbPulses
Diffstat (limited to 'utils/Timer.cc')
-rw-r--r--utils/Timer.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/utils/Timer.cc b/utils/Timer.cc
index 0d63bcc..def04c1 100644
--- a/utils/Timer.cc
+++ b/utils/Timer.cc
@@ -183,7 +183,7 @@ timing scheme.}
CcuCoreTimer :: CcuCoreTimer (Millisecond period, int pulses, CcuTimerSet* s)
: MySet (s),
StatusFlag (Active),
- Period (period),
+ Period (period > 0 ? period : 10),
PulsesLeft (pulses)
{
}
@@ -210,6 +210,18 @@ CcuCoreTimer :: ChangePeriod (Millisecond period)
}
/*?
+Change the number of times a timer will go off before stopping. If
+the timer is stopped, it is not restarted.
+?*/
+void
+CcuCoreTimer :: ChangeNbPulses (int nb)
+{
+ CcuSignalBlocker b (SigAlrm);
+ PulsesLeft = nb;
+}
+
+
+/*?
Stop this timer if it was running, then start it with its current period.
This function can be used to reset a timer to the beginning of a period.
?*/