source: rtems/c/src/lib/libbsp/m32c/m32cbsp/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.2 KB
Line 
1/*
2 *  This file contains the hardware specific portions of the TTY driver
3 *  for the serial ports on the m32c simulator in gdb.
4 */
5
6/*
7 *  COPYRIGHT (c) 1989-2008.
8 *  On-Line Applications Research Corporation (OAR).
9 *
10 *  The license and distribution terms for this file may be
11 *  found in the file LICENSE in this distribution or at
12 *  http://www.rtems.org/license/LICENSE.
13 */
14
15#include <bsp.h>
16#include <bsp/console-polled.h>
17#include <rtems/libio.h>
18#include <stdlib.h>
19#include <assert.h>
20
21/*
22 *  console_initialize_hardware
23 *
24 *  This routine initializes the console hardware.
25 *
26 */
27
28void console_initialize_hardware(void)
29{
30  return;
31}
32
33/*
34 *  console_outbyte_polled
35 *
36 *  This routine transmits a character using polling.
37 */
38ssize_t sys_write(int fd, const void *buf, size_t count);
39void console_outbyte_polled(
40  int  port,
41  char ch
42)
43{
44  sys_write( 2, &ch, 1 );
45}
46
47/*
48 *  console_inbyte_nonblocking
49 *
50 *  This routine polls for a character.
51 */
52
53int console_inbyte_nonblocking(
54  int port
55)
56{
57  return -1;
58}
59
60#include <rtems/bspIo.h>
61
62static void M32CsimBSP_output_char(char c) { console_outbyte_polled( 0, c ); }
63
64BSP_output_char_function_type       BSP_output_char = M32CsimBSP_output_char;
65BSP_polling_getchar_function_type   BSP_poll_char = NULL;
Note: See TracBrowser for help on using the repository browser.