Timer App (#355)
* built timer app * Style improvements * making sure buttons stay hidden when the app is reopened and reappear after the timer runs out * more sensible calculations of time deltas. eliminated that mysterious scaling factor * changing the timer icon
This commit is contained in:
parent
8c3b250dbf
commit
13e3463276
16 changed files with 385 additions and 22 deletions
|
|
@ -56,6 +56,7 @@ SystemTask::SystemTask(Drivers::SpiMaster& spi,
|
|||
heartRateController {*this},
|
||||
bleController {bleController},
|
||||
dateTimeController {*this},
|
||||
timerController {*this},
|
||||
watchdog {},
|
||||
watchdogView {watchdog},
|
||||
motorController {motorController},
|
||||
|
|
@ -83,6 +84,8 @@ void SystemTask::Work() {
|
|||
NRF_LOG_INFO("Last reset reason : %s", Pinetime::Drivers::Watchdog::ResetReasonToString(watchdog.ResetReason()));
|
||||
APP_GPIOTE_INIT(2);
|
||||
|
||||
app_timer_init();
|
||||
|
||||
spi.Init();
|
||||
spiNorFlash.Init();
|
||||
spiNorFlash.Wakeup();
|
||||
|
|
@ -96,6 +99,7 @@ void SystemTask::Work() {
|
|||
batteryController.Init();
|
||||
motorController.Init();
|
||||
motionSensor.SoftReset();
|
||||
timerController.Init();
|
||||
|
||||
// Reset the TWI device because the motion sensor chip most probably crashed it...
|
||||
twiMaster.Sleep();
|
||||
|
|
@ -116,7 +120,8 @@ void SystemTask::Work() {
|
|||
heartRateController,
|
||||
settingsController,
|
||||
motorController,
|
||||
motionController);
|
||||
motionController,
|
||||
timerController);
|
||||
displayApp->Start();
|
||||
|
||||
displayApp->PushMessage(Pinetime::Applications::Display::Messages::UpdateBatteryLevel);
|
||||
|
|
@ -233,11 +238,19 @@ void SystemTask::Work() {
|
|||
displayApp->PushMessage(Pinetime::Applications::Display::Messages::UpdateDateTime);
|
||||
break;
|
||||
case Messages::OnNewNotification:
|
||||
if (isSleeping && !isWakingUp)
|
||||
if (isSleeping && !isWakingUp) {
|
||||
GoToRunning();
|
||||
}
|
||||
motorController.SetDuration(35);
|
||||
displayApp->PushMessage(Pinetime::Applications::Display::Messages::NewNotification);
|
||||
break;
|
||||
case Messages::OnTimerDone:
|
||||
if (isSleeping && !isWakingUp) {
|
||||
GoToRunning();
|
||||
}
|
||||
motorController.SetDuration(35);
|
||||
displayApp->PushMessage(Pinetime::Applications::Display::Messages::TimerDone);
|
||||
break;
|
||||
case Messages::BleConnected:
|
||||
ReloadIdleTimer();
|
||||
isBleDiscoveryTimerRunning = true;
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
#include "components/ble/NimbleController.h"
|
||||
#include "components/ble/NotificationManager.h"
|
||||
#include "components/motor/MotorController.h"
|
||||
#include "components/timer/TimerController.h"
|
||||
#ifdef PINETIME_IS_RECOVERY
|
||||
#include "displayapp/DisplayAppRecovery.h"
|
||||
#include "displayapp/DummyLittleVgl.h"
|
||||
|
|
@ -45,6 +46,7 @@ namespace Pinetime {
|
|||
TouchWakeUp,
|
||||
OnNewTime,
|
||||
OnNewNotification,
|
||||
OnTimerDone,
|
||||
OnNewCall,
|
||||
BleConnected,
|
||||
UpdateTimeOut,
|
||||
|
|
@ -100,6 +102,7 @@ namespace Pinetime {
|
|||
|
||||
Pinetime::Controllers::Ble& bleController;
|
||||
Pinetime::Controllers::DateTime dateTimeController;
|
||||
Pinetime::Controllers::TimerController timerController;
|
||||
QueueHandle_t systemTasksMsgQueue;
|
||||
std::atomic<bool> isSleeping {false};
|
||||
std::atomic<bool> isGoingToSleep {false};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue