Chimes option
This commit is contained in:
@@ -75,6 +75,22 @@ void DateTime::UpdateTime(uint32_t systickCounter) {
|
||||
minute = time.minutes().count();
|
||||
second = time.seconds().count();
|
||||
|
||||
if(minute == 0 and not isHourAlreadyNotified) {
|
||||
isHourAlreadyNotified = true;
|
||||
if(systemTask != nullptr)
|
||||
systemTask->PushMessage(System::Messages::OnNewHour);
|
||||
} else if (minute != 0) {
|
||||
isHourAlreadyNotified = false;
|
||||
}
|
||||
|
||||
if((minute == 0 or minute == 30) and not isHalfHourAlreadyNotified) {
|
||||
isHalfHourAlreadyNotified = true;
|
||||
if(systemTask != nullptr)
|
||||
systemTask->PushMessage(System::Messages::OnNewHalfHour);
|
||||
} else if (minute != 0 and minute != 30) {
|
||||
isHalfHourAlreadyNotified = false;
|
||||
}
|
||||
|
||||
// Notify new day to SystemTask
|
||||
if (hour == 0 and not isMidnightAlreadyNotified) {
|
||||
isMidnightAlreadyNotified = true;
|
||||
|
@@ -86,6 +86,8 @@ namespace Pinetime {
|
||||
std::chrono::seconds uptime {0};
|
||||
|
||||
bool isMidnightAlreadyNotified = false;
|
||||
bool isHourAlreadyNotified = true;
|
||||
bool isHalfHourAlreadyNotified = true;
|
||||
System::SystemTask* systemTask = nullptr;
|
||||
};
|
||||
}
|
||||
|
@@ -41,6 +41,16 @@ namespace Pinetime {
|
||||
return settings.clockFace;
|
||||
};
|
||||
|
||||
void SetChimesState(uint8_t state) {
|
||||
if (state != settings.chimesState) {
|
||||
settingsChanged = true;
|
||||
}
|
||||
settings.chimesState = state;
|
||||
};
|
||||
uint8_t GetChimesState() const {
|
||||
return settings.chimesState;
|
||||
};
|
||||
|
||||
void SetPTSColorTime(Colors colorTime) {
|
||||
if (colorTime != settings.PTS.ColorTime)
|
||||
settingsChanged = true;
|
||||
@@ -173,6 +183,7 @@ namespace Pinetime {
|
||||
Notification notificationStatus = Notification::ON;
|
||||
|
||||
uint8_t clockFace = 0;
|
||||
uint8_t chimesState = 0;
|
||||
|
||||
PineTimeStyle PTS;
|
||||
|
||||
|
Reference in New Issue
Block a user