Changeset 31f90a2 in rtems
- Timestamp:
- 07/06/18 11:52:22 (5 years ago)
- Branches:
- 5, master
- Children:
- 1a19239
- Parents:
- bca36d9
- git-author:
- Sebastian Huber <sebastian.huber@…> (07/06/18 11:52:22)
- git-committer:
- Sebastian Huber <sebastian.huber@…> (07/06/18 12:27:29)
- Location:
- bsps/riscv/riscv
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
bsps/riscv/riscv/console/console-config.c
rbca36d9 r31f90a2 32 32 static struct { 33 33 rtems_termios_device_context *context; 34 void (*write_polled)( 35 rtems_termios_device_context *base, 36 const char *buf, 37 size_t len 38 ); 39 int (*poll_char)(rtems_termios_device_context *base); 34 void (*putchar)(rtems_termios_device_context *base, char c); 35 int (*getchar)(rtems_termios_device_context *base); 40 36 } riscv_console; 41 37 42 38 static void riscv_output_char(char c) 43 39 { 44 (*riscv_console. write_polled)(riscv_console.context, &c, 1);40 (*riscv_console.putchar)(riscv_console.context, c); 45 41 } 46 42 … … 77 73 78 74 riscv_console.context = &htif_console_instance.base; 79 riscv_console. write_polled = htif_console_write_polled;80 riscv_console. poll_char = htif_console_poll_char;75 riscv_console.putchar = htif_console_putchar; 76 riscv_console.getchar = htif_console_getchar; 81 77 }; 82 78 #endif -
bsps/riscv/riscv/console/htif.c
rbca36d9 r31f90a2 74 74 } 75 75 76 int htif_console_ poll_char(rtems_termios_device_context *base)76 int htif_console_getchar(rtems_termios_device_context *base) 77 77 { 78 78 __check_fromhost(); … … 86 86 } 87 87 88 void htif_console_write_polled( 88 void htif_console_putchar(rtems_termios_device_context *base, char c) 89 { 90 __set_tohost(1, 1, c); 91 } 92 93 static void htif_console_write_polled( 89 94 rtems_termios_device_context *base, 90 95 const char *buf, … … 95 100 96 101 for (i = 0; i < len; ++i) { 97 __set_tohost(1, 1, buf[i]);102 htif_console_putchar(base, buf[i]); 98 103 } 99 104 } … … 128 133 .first_open = htif_console_first_open, 129 134 .write = htif_console_write_polled, 130 .poll_read = htif_console_ poll_char,135 .poll_read = htif_console_getchar, 131 136 .mode = TERMIOS_POLLED 132 137 }; -
bsps/riscv/riscv/include/dev/serial/htif.h
rbca36d9 r31f90a2 42 42 ); 43 43 44 void htif_console_write_polled( 45 rtems_termios_device_context *base, 46 const char *buf, 47 size_t len 48 ); 44 void htif_console_putchar(rtems_termios_device_context *base, char c); 49 45 50 int htif_console_ poll_char(rtems_termios_device_context *base);46 int htif_console_getchar(rtems_termios_device_context *base); 51 47 52 48 const rtems_termios_device_handler htif_console_handler;
Note: See TracChangeset
for help on using the changeset viewer.