source: rtems/c/src/lib/libbsp/m32r/m32rsim/console/console-io.c @ 6279149

4.115
Last change on this file since 6279149 was 6279149, checked in by Joel Sherrill <joel.sherrill@…>, on Oct 8, 2014 at 9:04:56 PM

Add console-polled.h and update all BSPs that should use it.

The file console-polled.h provides the prototypes for the three
required methods when implementing a single port polled console
driver. This paradigm is common on simulators and simple hardware.

+ Updated the BSPs Makefile.am to make console-polled.h available.
+ Regenerated the BSPs preinstall.sm.
+ Updated console support files to include <bsp/console-polled.h>.
+ Updated console support files to make printk() support method static.

  • Property mode set to 100644
File size: 1.1 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2011.
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 <bsp/console-polled.h>
12#include <rtems/libio.h>
13#include <stdlib.h>
14#include <assert.h>
15#include <reent.h>
16
17/*
18 *  console_initialize_hardware
19 *
20 *  This routine initializes the console hardware.
21 *
22 */
23
24void console_initialize_hardware(void)
25{
26  return;
27}
28
29/*
30 *  console_outbyte_polled
31 *
32 *  This routine transmits a character using polling.
33 */
34void console_outbyte_polled(
35  int  port,
36  char ch
37)
38{
39  TRAP0(SYS_write, 1, &ch, 1);
40}
41
42/*
43 *  console_inbyte_nonblocking
44 *
45 *  This routine polls for a character.
46 */
47
48int console_inbyte_nonblocking(
49  int port
50)
51{
52  return -1;
53}
54
55#include <rtems/bspIo.h>
56
57static void console_output_char(char c) { console_outbyte_polled( 0, c ); }
58
59BSP_output_char_function_type           BSP_output_char = console_output_char;
60BSP_polling_getchar_function_type       BSP_poll_char = NULL;
Note: See TracBrowser for help on using the repository browser.