Changeset d31c3ea in mainline for uspace/srv/hid/output/ctl/serial.c
- Timestamp:
- 2024-10-01T11:13:28Z (3 months ago)
- Branches:
- master
- Children:
- 6907f26
- Parents:
- 357d9dd
- git-author:
- Jiri Svoboda <jiri@…> (2024-09-30 19:13:18)
- git-committer:
- Jiri Svoboda <jiri@…> (2024-10-01 11:13:28)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/output/ctl/serial.c
r357d9dd rd31c3ea 44 44 #define SERIAL_COLS 80 45 45 #define SERIAL_ROWS 24 46 47 static serial_putuchar_t serial_putuchar_fn; 48 static serial_control_puts_t serial_control_puts_fn; 49 static serial_flush_t serial_flush_fn; 50 51 static void serial_vt_putuchar(void *, char32_t); 52 static void serial_vt_control_puts(void *, const char *); 53 static void serial_vt_flush(void *); 54 55 static vt100_cb_t serial_vt_cb = { 56 .putuchar = serial_vt_putuchar, 57 .control_puts = serial_vt_control_puts, 58 .flush = serial_vt_flush 59 }; 46 60 47 61 /** Draw the character at the specified position. … … 124 138 }; 125 139 126 errno_t serial_init( vt100_putuchar_t putuchar_fn,127 vt100_control_puts_t control_puts_fn, vt100_flush_t flush_fn)140 errno_t serial_init(serial_putuchar_t putuchar_fn, 141 serial_control_puts_t control_puts_fn, serial_flush_t flush_fn) 128 142 { 129 143 char_attrs_t attrs; 130 vt100_t *vt100 = 131 vt100_create(NULL, SERIAL_COLS, SERIAL_ROWS, putuchar_fn, 132 control_puts_fn, flush_fn); 144 vt100_t *vt100; 145 146 serial_putuchar_fn = putuchar_fn; 147 serial_control_puts_fn = control_puts_fn; 148 serial_flush_fn = flush_fn; 149 150 vt100 = vt100_create(NULL, SERIAL_COLS, SERIAL_ROWS, &serial_vt_cb); 133 151 if (vt100 == NULL) 134 152 return ENOMEM; … … 150 168 } 151 169 170 static void serial_vt_putuchar(void *arg, char32_t c) 171 { 172 (void)arg; 173 serial_putuchar_fn(c); 174 } 175 176 static void serial_vt_control_puts(void *arg, const char *str) 177 { 178 (void)arg; 179 serial_control_puts_fn(str); 180 } 181 182 static void serial_vt_flush(void *arg) 183 { 184 (void)arg; 185 serial_flush_fn(); 186 } 187 152 188 /** @} 153 189 */
Note:
See TracChangeset
for help on using the changeset viewer.