Desktop: fix crash on autolock after restart in locked state (#3643)

* Desktop: fix crash on autolock after restart in locked state
* Desktop: switch to clock model to fix condition race in desktop lock.
This commit is contained in:
あく
2024-05-11 00:01:33 +09:00
committed by GitHub
parent 7414e6d4df
commit b12d43b765
2 changed files with 26 additions and 13 deletions

View File

@@ -35,6 +35,12 @@ typedef enum {
DesktopViewIdTotal,
} DesktopViewId;
typedef struct {
uint8_t hour;
uint8_t minute;
bool format_12; // 1 - 12 hour, 0 - 24H
} DesktopClock;
struct Desktop {
// Scene
FuriThread* scene_thread;
@@ -75,11 +81,10 @@ struct Desktop {
FuriPubSub* status_pubsub;
uint8_t time_hour;
uint8_t time_minute;
bool time_format_12 : 1; // 1 - 12 hour, 0 - 24H
DesktopClock clock;
bool in_transition : 1;
bool locked : 1;
FuriSemaphore* animation_semaphore;
};