Browse Source

fix(display): Initialize display on queue as well.

xmkb
Peter Johanson 3 years ago committed by Julia Luna
parent
commit
244ea96181
Signed by: xenua
GPG Key ID: 6A0C04FA9A7D7582
  1. 26
      app/src/display/main.c

26
app/src/display/main.c

@ -85,26 +85,20 @@ static void stop_display_updates() {
int zmk_display_is_initialized() { return initialized; } int zmk_display_is_initialized() { return initialized; }
int zmk_display_init() { void initialize_display(struct k_work *work) {
LOG_DBG(""); LOG_DBG("");
display = device_get_binding(ZMK_DISPLAY_NAME); display = device_get_binding(ZMK_DISPLAY_NAME);
if (display == NULL) { if (display == NULL) {
LOG_ERR("Failed to find display device"); LOG_ERR("Failed to find display device");
return -EINVAL; return;
} }
#if IS_ENABLED(CONFIG_ZMK_DISPLAY_WORK_QUEUE_DEDICATED)
k_work_queue_start(&display_work_q, display_work_stack_area,
K_THREAD_STACK_SIZEOF(display_work_stack_area),
CONFIG_ZMK_DISPLAY_DEDICATED_THREAD_PRIORITY, NULL);
#endif
screen = zmk_display_status_screen(); screen = zmk_display_status_screen();
if (screen == NULL) { if (screen == NULL) {
LOG_ERR("No status screen provided"); LOG_ERR("No status screen provided");
return 0; return;
} }
lv_scr_load(screen); lv_scr_load(screen);
@ -112,6 +106,20 @@ int zmk_display_init() {
start_display_updates(); start_display_updates();
initialized = true; initialized = true;
}
K_WORK_DEFINE(init_work, initialize_display);
int zmk_display_init() {
LOG_DBG("");
#if IS_ENABLED(CONFIG_ZMK_DISPLAY_WORK_QUEUE_DEDICATED)
k_work_queue_start(&display_work_q, display_work_stack_area,
K_THREAD_STACK_SIZEOF(display_work_stack_area),
CONFIG_ZMK_DISPLAY_DEDICATED_THREAD_PRIORITY, NULL);
#endif
k_work_submit_to_queue(zmk_display_work_q(), &init_work);
LOG_DBG(""); LOG_DBG("");
return 0; return 0;

Loading…
Cancel
Save