Changeset 082feff in mainline
- Timestamp:
- 2023-10-10T18:37:44Z (14 months ago)
- Branches:
- master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c0efb2e
- Parents:
- f9ae472
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/gfxdemo/gfxdemo.c
rf9ae472 r082feff 68 68 }; 69 69 70 static void demo_kbd_event(kbd_event_t *); 71 70 72 static bool quit = false; 71 73 static FIBRIL_MUTEX_INITIALIZE(quit_lock); … … 74 76 static gfx_font_t *font; 75 77 static gfx_coord_t vpad; 78 static console_ctrl_t *con = NULL; 76 79 77 80 /** Determine if we are running in text mode. … … 93 96 static void demo_msleep(unsigned msec) 94 97 { 98 errno_t rc; 99 usec_t usec; 100 cons_event_t cevent; 101 95 102 fibril_mutex_lock(&quit_lock); 96 97 103 if (!quit) { 98 (void) fibril_condvar_wait_timeout(&quit_cv, &quit_lock, 99 (usec_t)msec * 1000); 100 } 101 104 if (con != NULL) { 105 usec = (usec_t)msec * 1000; 106 while (usec > 0 && !quit) { 107 rc = console_get_event_timeout(con, &cevent, &usec); 108 if (rc == EOK) { 109 if (cevent.type == CEV_KEY) { 110 fibril_mutex_unlock(&quit_lock); 111 demo_kbd_event(&cevent.ev.key); 112 fibril_mutex_lock(&quit_lock); 113 } 114 } 115 } 116 } else { 117 (void) fibril_condvar_wait_timeout(&quit_cv, &quit_lock, 118 (usec_t)msec * 1000); 119 } 120 } 102 121 fibril_mutex_unlock(&quit_lock); 103 122 } … … 1050 1069 static errno_t demo_console(void) 1051 1070 { 1052 console_ctrl_t *con = NULL;1053 1071 console_gc_t *cgc = NULL; 1054 1072 gfx_context_t *gc;
Note:
See TracChangeset
for help on using the changeset viewer.