4.115
Line | |
---|
1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * This file contains a stub for the required printk support. |
---|
5 | */ |
---|
6 | |
---|
7 | /* |
---|
8 | * COPYRIGHT (c) 1989-2012. |
---|
9 | * On-Line Applications Research Corporation (OAR). |
---|
10 | * |
---|
11 | * The license and distribution terms for this file may be |
---|
12 | * found in the file LICENSE in this distribution or at |
---|
13 | * http://www.rtems.com/license/LICENSE. |
---|
14 | */ |
---|
15 | |
---|
16 | #include <rtems.h> |
---|
17 | #include <bsp.h> |
---|
18 | #include <libchip/serial.h> |
---|
19 | #include <libchip/ns16550.h> |
---|
20 | |
---|
21 | rtems_device_minor_number BSPPrintkPort = 0; |
---|
22 | |
---|
23 | void BSP_com_outch(char ch); |
---|
24 | int BSP_com_inch( void ); |
---|
25 | |
---|
26 | /* |
---|
27 | * Following assume all are ns16650 |
---|
28 | */ |
---|
29 | void BSP_com_outch(char ch) |
---|
30 | { |
---|
31 | console_tbl *cptr; |
---|
32 | |
---|
33 | cptr = &Console_Configuration_Ports[BSPPrintkPort]; |
---|
34 | |
---|
35 | return ns16550_outch_polled( cptr, ch ); |
---|
36 | } |
---|
37 | |
---|
38 | int BSP_com_inch( void ) |
---|
39 | { |
---|
40 | int result; |
---|
41 | console_tbl *cptr; |
---|
42 | |
---|
43 | cptr = &Console_Configuration_Ports[BSPPrintkPort]; |
---|
44 | |
---|
45 | do { |
---|
46 | result = ns16550_inch_polled( cptr ); |
---|
47 | } while (result == -1); |
---|
48 | |
---|
49 | return result; |
---|
50 | } |
---|
51 | |
---|
52 | BSP_output_char_function_type BSP_output_char = BSP_com_outch; |
---|
53 | BSP_polling_getchar_function_type BSP_poll_char = BSP_com_inch; |
---|
Note: See
TracBrowser
for help on using the repository browser.