source: rtems/c/src/lib/libbsp/v850/gdbv850sim/console/console-io.c @ 8536b67

4.115
Last change on this file since 8536b67 was c499856, checked in by Chris Johns <chrisj@…>, on 03/20/14 at 21:10:47

Change all references of rtems.com to rtems.org.

  • Property mode set to 100644
File size: 1.1 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2012.
3 *  On-Line Applications Research Corporation (OAR).
4 *
5 *  The license and distribution terms for this file may be
6 *  found in the file LICENSE in this distribution or at
7 *  http://www.rtems.org/license/LICENSE.
8 */
9
10#include <bsp.h>
11#include <rtems/libio.h>
12#include <bsp/syscall.h>
13
14/*
15 *  console_initialize_hardware
16 *
17 *  This routine initializes the console hardware.
18 */
19void console_initialize_hardware(void)
20{
21}
22
23/*
24 *  console_outbyte_polled
25 *
26 *  This routine transmits a character using polling.
27 */
28void console_outbyte_polled(
29  int  port,
30  char ch
31)
32{
33  TRAP0(SYS_write, 1, &ch, 1);
34}
35
36/*
37 *  console_inbyte_nonblocking
38 *
39 *  This routine polls for a character.
40 */
41
42int console_inbyte_nonblocking(
43  int port
44)
45{
46  char ch;
47  int  rc;
48
49  rc = TRAP0 (SYS_read, 0, &ch, 1);
50
51  if ( rc != 1 )
52    return -1;
53  return ch;
54}
55
56#include <rtems/bspIo.h>
57
58void console_output_char(char c) { console_outbyte_polled( 0, c ); }
59
60BSP_output_char_function_type           BSP_output_char = console_output_char;
61BSP_polling_getchar_function_type       BSP_poll_char = NULL;
Note: See TracBrowser for help on using the repository browser.