Fixes per Riksu9000's feedback
This commit is contained in:
@@ -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() {
|
||||
|
@@ -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();
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user