Skip to content

Commit 00c463e

Browse files
committed
Revert timerHandle variable name back to just timer
1 parent 9809f2f commit 00c463e

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/components/timer/Timer.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using namespace Pinetime::Controllers;
44

55
Timer::Timer(void* const timerData, TimerCallbackFunction_t timerCallbackFunction) {
6-
timerHandle = xTimerCreate("Timer", 1, pdFALSE, timerData, timerCallbackFunction);
6+
timer = xTimerCreate("Timer", 1, pdFALSE, timerData, timerCallbackFunction);
77
}
88

99
void Timer::StartTimer(std::chrono::milliseconds duration) {
@@ -19,25 +19,25 @@ void Timer::StartTimer(std::chrono::milliseconds duration) {
1919
leftoverSeconds = 60;
2020
timerOverflowIntervals--;
2121
}
22-
xTimerChangePeriod(timerHandle, pdMS_TO_TICKS((leftoverMinutes * 60 * 1000) + (leftoverSeconds * 1000)), 0);
22+
xTimerChangePeriod(timer, pdMS_TO_TICKS((leftoverMinutes * 60 * 1000) + (leftoverSeconds * 1000)), 0);
2323
} else {
24-
xTimerChangePeriod(timerHandle, pdMS_TO_TICKS(duration.count()), 0);
24+
xTimerChangePeriod(timer, pdMS_TO_TICKS(duration.count()), 0);
2525
}
26-
xTimerStart(timerHandle, 0);
26+
xTimerStart(timer, 0);
2727
}
2828

2929
std::chrono::milliseconds Timer::GetTimeRemaining() {
3030
if (IsRunning()) {
31-
TickType_t remainingTime = xTimerGetExpiryTime(timerHandle) - xTaskGetTickCount();
31+
TickType_t remainingTime = xTimerGetExpiryTime(timer) - xTaskGetTickCount();
3232
return std::chrono::milliseconds((remainingTime * 1000 / configTICK_RATE_HZ) + (timerOverflowIntervals * maxTimerMS));
3333
}
3434
return std::chrono::milliseconds(0);
3535
}
3636

3737
void Timer::StopTimer() {
38-
xTimerStop(timerHandle, 0);
38+
xTimerStop(timer, 0);
3939
}
4040

4141
bool Timer::IsRunning() {
42-
return (xTimerIsTimerActive(timerHandle) == pdTRUE);
42+
return (xTimerIsTimerActive(timer) == pdTRUE);
4343
}

src/components/timer/Timer.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace Pinetime {
2121

2222
uint8_t timerOverflowIntervals = 0;
2323

24-
TimerHandle_t timerHandle;
24+
TimerHandle_t timer;
2525

2626
const uint32_t maxTimerMS = 3'600'000; // 1 hour
2727
private:

0 commit comments

Comments
 (0)