Skip to content

Commit

Permalink
Update clock_app.c
Browse files Browse the repository at this point in the history
  • Loading branch information
RogueMaster committed Aug 17, 2022
1 parent 125a7e1 commit 967f2ce
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion applications/clock_app/clock_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ static void clock_render_callback(Canvas* const canvas, void* ctx) {
char strings[3][20];
state->timerTempSecs = state->timerSecs;
FuriHalRtcDateTime datetime;
furi_hal_rtc_get_datetime(&datetime);
if(state->timerStarted) state->timerTempSecs = state->timerSecs + (int) ((furi_hal_rtc_datetime_to_timestamp(&datetime) - state->timerStartTime));
int curMin = (state->timerTempSecs / 60);
int curSec = state->timerTempSecs - (curMin * 60);
Expand Down Expand Up @@ -346,6 +347,7 @@ int32_t clock_app(void* p) {
// Main loop
PluginEvent event;
FuriHalRtcDateTime datetime;
furi_hal_rtc_get_datetime(&datetime);
for(bool processing = true; processing;) {
FuriStatus event_status = furi_message_queue_get(event_queue, &event, 100);
ClockState* plugin_state = (ClockState*)acquire_mutex_block(&state_mutex);
Expand Down Expand Up @@ -397,7 +399,7 @@ int32_t clock_app(void* p) {
}
}
} else if(event.type == EventTypeTick) {
furi_hal_rtc_get_datetime(datetime);
furi_hal_rtc_get_datetime(&datetime);
}
} else {
FURI_LOG_D(TAG, "osMessageQueue: event timeout");
Expand Down

0 comments on commit 967f2ce

Please sign in to comment.