summaryrefslogtreecommitdiff
path: root/src/systemtask/SystemTask.h
diff options
context:
space:
mode:
authorJF002 <JF002@users.noreply.github.com>2021-09-12 18:22:04 +0200
committerGitHub <noreply@github.com>2021-09-12 18:22:04 +0200
commitf0329298ac4171e1c117bbf4ae2394f2b9769348 (patch)
tree7807daa81cb5bafc1f90f86a62bfe4f4c5505fbe /src/systemtask/SystemTask.h
parent977321cf6457eefed7fe0cea0fb9b94c2fddf7fd (diff)
parent21d37d1e234b217b3e71dc65eb19db197ee21bad (diff)
Merge pull request #580 from Riksu9000/timer_battery_reading
Make battery reading periodic
Diffstat (limited to 'src/systemtask/SystemTask.h')
-rw-r--r--src/systemtask/SystemTask.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/systemtask/SystemTask.h b/src/systemtask/SystemTask.h
index 0266ba8a..1a3b86c4 100644
--- a/src/systemtask/SystemTask.h
+++ b/src/systemtask/SystemTask.h
@@ -136,13 +136,15 @@ namespace Pinetime {
uint8_t bleDiscoveryTimer = 0;
TimerHandle_t dimTimer;
TimerHandle_t idleTimer;
+ TimerHandle_t measureBatteryTimer;
+ bool sendBatteryNotification = false;
bool doNotGoToSleep = false;
void GoToRunning();
void UpdateMotion();
bool stepCounterMustBeReset = false;
- static constexpr TickType_t batteryNotificationPeriod = 1000 * 60 * 10; // 1 tick ~= 1ms. 1ms * 60 * 10 = 10 minutes
- TickType_t batteryNotificationTick = 0;
+ static constexpr TickType_t batteryMeasurementPeriod = pdMS_TO_TICKS(10 * 60 * 1000);
+ TickType_t lastBatteryNotificationTime = 0;
#if configUSE_TRACE_FACILITY == 1
SystemMonitor<FreeRtosMonitor> monitor;