MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / rt_hw_console_init

Function rt_hw_console_init

bsp/x86/drivers/console.c:279–309  ·  view source on GitHub ↗

* This function initializes console * */

Source from the content-addressed store, hash-verified

277 *
278 */
279int rt_hw_console_init(void)
280{
281 rt_cga_init();
282 rt_serial_init();
283 init_keyboard();
284
285 /* install keyboard isr */
286 rt_hw_interrupt_install(INTKEYBOARD, rt_console_isr, RT_NULL, "kbd");
287 rt_hw_interrupt_umask(INTKEYBOARD);
288
289 rt_hw_interrupt_install(INTUART0_RX, rt_console_isr, RT_NULL, "COM1");
290 rt_hw_interrupt_umask(INTUART0_RX);
291
292 console_device.type = RT_Device_Class_Char;
293 console_device.rx_indicate = RT_NULL;
294 console_device.tx_complete = RT_NULL;
295 console_device.init = rt_console_init;
296 console_device.open = rt_console_open;
297 console_device.close = rt_console_close;
298 console_device.read = rt_console_read;
299 console_device.write = rt_console_write;
300 console_device.control = rt_console_control;
301 console_device.user_data = RT_NULL;
302
303 /* register a character device */
304 rt_device_register(&console_device,
305 "console",
306 RT_DEVICE_FLAG_RDWR | RT_DEVICE_FLAG_INT_RX | RT_DEVICE_FLAG_STREAM);
307
308 return 0;
309}
310INIT_DEVICE_EXPORT(rt_hw_console_init);
311
312/**

Callers 1

rt_hw_board_initFunction · 0.70

Calls 6

rt_cga_initFunction · 0.85
init_keyboardFunction · 0.85
rt_device_registerFunction · 0.85
rt_serial_initFunction · 0.70
rt_hw_interrupt_installFunction · 0.50
rt_hw_interrupt_umaskFunction · 0.50

Tested by

no test coverage detected