source: rtems/c/src/lib/libbsp/m68k/mcf5225x/console/debugio.c @ b2c02c74

4.11
Last change on this file since b2c02c74 was b2c02c74, checked in by Joel Sherrill <joel.sherrill@…>, on Aug 3, 2010 at 2:15:54 PM

2010-08-03 Joel Sherrill <joel.sherrilL@…>

  • console/debugio.c: Add BSP_poll_char.
  • Property mode set to 100644
File size: 977 bytes
Line 
1/*
2 *  Multi UART console serial I/O.
3 *
4 *  TO DO: Add DMA input/output
5 *
6 *  The license and distribution terms for this file may be
7 *  found in the file LICENSE in this distribution or at
8 *  http://www.rtems.com/license/LICENSE.
9 *
10 *  $Id$
11 */
12
13#include <stdio.h>
14#include <fcntl.h>
15#include <rtems/libio.h>
16#include <rtems/termiostypes.h>
17#include <termios.h>
18#include <bsp.h>
19#include <malloc.h>
20#include <rtems/mw_uid.h>
21
22#include <rtems/bspIo.h>
23
24static void _BSP_null_char(char c)
25{
26  rtems_interrupt_level level=UART0_IRQ_LEVEL;
27
28  if (c == '\n')
29        _BSP_null_char('\r');
30
31  rtems_interrupt_disable(level);
32  while ((MCF_UART_USR(CONSOLE_PORT) & MCF_UART_USR_TXRDY) == 0)
33    continue;
34  MCF_UART_UTB(CONSOLE_PORT) = c;
35  while ((MCF_UART_USR(CONSOLE_PORT) & MCF_UART_USR_TXRDY) == 0)
36    continue;
37  rtems_interrupt_enable(level);
38}
39
40BSP_output_char_function_type     BSP_output_char = _BSP_null_char;
41BSP_polling_getchar_function_type BSP_poll_char = NULL;
Note: See TracBrowser for help on using the repository browser.