From e21f6a7f414d1f832e8fddfeaab3b9de05aa3459 Mon Sep 17 00:00:00 2001 From: Jean-François Milants Date: Sun, 11 Jul 2021 16:55:06 +0200 Subject: Notify battery level every 10 minutes when connected to a BLE host. Refactor battery percent : only use uint8_t to store the battery % remaining. --- src/systemtask/SystemTask.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/systemtask/SystemTask.h') diff --git a/src/systemtask/SystemTask.h b/src/systemtask/SystemTask.h index bfb97264..f8cf6370 100644 --- a/src/systemtask/SystemTask.h +++ b/src/systemtask/SystemTask.h @@ -135,6 +135,8 @@ namespace Pinetime { 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; #if configUSE_TRACE_FACILITY == 1 SystemMonitor monitor; -- cgit v1.2.3