aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/stopwatch
diff options
context:
space:
mode:
authorcodingjourney <coding@journey.sk>2024-11-30 22:23:31 +0100
committerJF <JF002@users.noreply.github.com>2025-11-04 21:25:31 +0100
commit487205ef6a8e81fe887a1fcd72fee9c4de33c81f (patch)
treed462c262287256b297bf7f06ba57ce55ff4164cf /src/components/stopwatch
parent4de9fc9b88c1e3fc9ced4931d446386374161d61 (diff)
length of lap list adapting to available space
Diffstat (limited to 'src/components/stopwatch')
-rw-r--r--src/components/stopwatch/StopWatchController.cpp2
-rw-r--r--src/components/stopwatch/StopWatchController.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/components/stopwatch/StopWatchController.cpp b/src/components/stopwatch/StopWatchController.cpp
index 64261055..4979ee68 100644
--- a/src/components/stopwatch/StopWatchController.cpp
+++ b/src/components/stopwatch/StopWatchController.cpp
@@ -33,9 +33,9 @@ void StopWatchController::Clear() {
void StopWatchController::AddLapToHistory() {
TickType_t lapEnd = GetElapsedTime();
+ history--;
history[0].timeSinceStart = lapEnd;
history[0].number = ++maxLapNumber % lapNumberBoundary;
- history--;
}
int StopWatchController::GetMaxLapNumber() {
diff --git a/src/components/stopwatch/StopWatchController.h b/src/components/stopwatch/StopWatchController.h
index 6aaec2b2..210cbeaa 100644
--- a/src/components/stopwatch/StopWatchController.h
+++ b/src/components/stopwatch/StopWatchController.h
@@ -56,7 +56,7 @@ namespace Pinetime {
TickType_t timeElapsedPreviously;
// Maximum number of stored laps
- static constexpr int histSize = 2;
+ static constexpr int histSize = 4;
// Value at which lap numbers wrap around to zero
static constexpr int lapNumberBoundary = 1000;
// Lap storage