summaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/components')
-rw-r--r--src/components/alarm/AlarmController.cpp6
-rw-r--r--src/components/alarm/AlarmController.h8
-rw-r--r--src/components/motor/MotorController.cpp6
-rw-r--r--src/components/motor/MotorController.h1
4 files changed, 7 insertions, 14 deletions
diff --git a/src/components/alarm/AlarmController.cpp b/src/components/alarm/AlarmController.cpp
index 2532a4a1..67ca05a9 100644
--- a/src/components/alarm/AlarmController.cpp
+++ b/src/components/alarm/AlarmController.cpp
@@ -43,11 +43,9 @@ void AlarmController::Init(System::SystemTask* systemTask) {
this->systemTask = systemTask;
}
-void AlarmController::SetAlarm(uint8_t alarmHr, uint8_t alarmMin) {
+void AlarmController::SetAlarmTime(uint8_t alarmHr, uint8_t alarmMin) {
hours = alarmHr;
minutes = alarmMin;
- state = AlarmState::Set;
- ScheduleAlarm();
}
void AlarmController::ScheduleAlarm() {
@@ -84,6 +82,8 @@ void AlarmController::ScheduleAlarm() {
alarmTime = std::chrono::system_clock::from_time_t(std::mktime(tmAlarmTime));
auto mSecToAlarm = std::chrono::duration_cast<std::chrono::milliseconds>(alarmTime - now).count();
app_timer_start(alarmAppTimer, APP_TIMER_TICKS(mSecToAlarm), this);
+
+ state = AlarmState::Set;
}
uint32_t AlarmController::SecondsToAlarm() {
diff --git a/src/components/alarm/AlarmController.h b/src/components/alarm/AlarmController.h
index 7c43b89e..bf85d431 100644
--- a/src/components/alarm/AlarmController.h
+++ b/src/components/alarm/AlarmController.h
@@ -31,7 +31,8 @@ namespace Pinetime {
AlarmController(Controllers::DateTime& dateTimeController);
void Init(System::SystemTask* systemTask);
- void SetAlarm(uint8_t alarmHr, uint8_t alarmMin);
+ void SetAlarmTime(uint8_t alarmHr, uint8_t alarmMin);
+ void ScheduleAlarm();
void DisableAlarm();
void SetOffAlarmNow();
uint32_t SecondsToAlarm();
@@ -57,12 +58,11 @@ namespace Pinetime {
private:
Controllers::DateTime& dateTimeController;
System::SystemTask* systemTask = nullptr;
- uint8_t hours;
- uint8_t minutes;
+ uint8_t hours = 7;
+ uint8_t minutes = 0;
std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds> alarmTime;
AlarmState state = AlarmState::Not_Set;
RecurType recurrence = RecurType::None;
- void ScheduleAlarm();
};
}
}
diff --git a/src/components/motor/MotorController.cpp b/src/components/motor/MotorController.cpp
index 5ade19e4..b25e6bc8 100644
--- a/src/components/motor/MotorController.cpp
+++ b/src/components/motor/MotorController.cpp
@@ -42,12 +42,6 @@ void MotorController::StartRinging() {
app_timer_start(longVibTimer, APP_TIMER_TICKS(1000), this);
}
-// This function is the same as StartRinging(), but will ring even if notifications are turned off in Settings
-void MotorController::StartRingingDisregardSettings() {
- Ring(this);
- app_timer_start(longVibTimer, APP_TIMER_TICKS(1000), this);
-}
-
void MotorController::StopRinging() {
app_timer_stop(longVibTimer);
nrf_gpio_pin_set(pinMotor);
diff --git a/src/components/motor/MotorController.h b/src/components/motor/MotorController.h
index d3b96b07..d2c9fe5f 100644
--- a/src/components/motor/MotorController.h
+++ b/src/components/motor/MotorController.h
@@ -15,7 +15,6 @@ namespace Pinetime {
void RunForDuration(uint8_t motorDuration);
void StartRinging();
static void StopRinging();
- void StartRingingDisregardSettings();
private:
static void Ring(void* p_context);