diff options
author | Peter Johanson <peter@peterjohanson.com> | 2021-08-12 03:44:38 +0000 |
---|---|---|
committer | Pete Johanson <peter@peterjohanson.com> | 2021-09-25 17:17:04 -0400 |
commit | 2128b2b55f85a6190194d83696f7419eb53c6642 (patch) | |
tree | 9ed0a99a5646d6e1b911be6dc3dca1ac58832fdb /app/src/display/main.c | |
parent | 063d98e3dfa8e0089aa0039b24489d29b062cf5e (diff) |
refactor(display): Output/layer/battery thread safety.
* Submit widget updates to display queue.
* Use mutex to control access to shared state for widgets.
Diffstat (limited to 'app/src/display/main.c')
-rw-r--r-- | app/src/display/main.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/src/display/main.c b/app/src/display/main.c index 95b607e..57fab2b 100644 --- a/app/src/display/main.c +++ b/app/src/display/main.c @@ -22,6 +22,7 @@ LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL); #define ZMK_DISPLAY_NAME CONFIG_LVGL_DISPLAY_DEV_NAME static const struct device *display; +static bool initialized = false; static lv_obj_t *screen; @@ -82,6 +83,8 @@ static void stop_display_updates() { k_timer_stop(&display_timer); } +int zmk_display_is_initialized() { return initialized; } + int zmk_display_init() { LOG_DBG(""); @@ -108,6 +111,8 @@ int zmk_display_init() { start_display_updates(); + initialized = true; + LOG_DBG(""); return 0; } |