aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/stopwatch/StopWatchController.h
diff options
context:
space:
mode:
authorcodingjourney <coding@journey.sk>2024-11-28 05:20:03 +0100
committerJF <JF002@users.noreply.github.com>2025-11-04 21:25:31 +0100
commit183337b6d3a3c3eb955a07551d04fb0990966516 (patch)
treecac40c5fee13ae566833de2a2b6f3e1b3f627826 /src/components/stopwatch/StopWatchController.h
parentf720a7fb3ce40880319ceba79eb00a9699dbc1ef (diff)
upper bound for elapsed time
Diffstat (limited to 'src/components/stopwatch/StopWatchController.h')
-rw-r--r--src/components/stopwatch/StopWatchController.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/components/stopwatch/StopWatchController.h b/src/components/stopwatch/StopWatchController.h
index 0791701c..6aaec2b2 100644
--- a/src/components/stopwatch/StopWatchController.h
+++ b/src/components/stopwatch/StopWatchController.h
@@ -46,6 +46,8 @@ namespace Pinetime {
bool IsPaused();
private:
+ // Time at which stopwatch wraps around to zero (1000 hours)
+ TickType_t elapsedTimeBoundary = configTICK_RATE_HZ * 60 * 60 * 1000;
// Current state of stopwatch
StopWatchStates currentState = StopWatchStates::Cleared;
// Start time of current duration
@@ -55,6 +57,7 @@ namespace Pinetime {
// Maximum number of stored laps
static constexpr int histSize = 2;
+ // Value at which lap numbers wrap around to zero
static constexpr int lapNumberBoundary = 1000;
// Lap storage
Utility::CircularBuffer<LapInfo, histSize> history;