source: rtems/c/src/lib/libbsp/sparc/leon3/console/debugputs.c @ 55cb7c9

4.104.114.84.95
Last change on this file since 55cb7c9 was 55cb7c9, checked in by Joel Sherrill <joel.sherrill@…>, on 05/09/07 at 17:49:58

2007-05-09 Joel Sherrill <joel.sherrill@…>

  • console/debugputs.c, include/bsp.h, leon_smc91111/leon_smc91111.c, startup/bspstart.c, startup/spurious.c: Remove debug print methods that are redundant with prntk and replace their use with printk.
  • Property mode set to 100644
File size: 1.4 KB
Line 
1/*
2 *  This file contains the TTY driver for the serial ports on the LEON.
3 *
4 *  This driver uses the termios pseudo driver.
5 *
6 *  COPYRIGHT (c) 1989-1999.
7 *  On-Line Applications Research Corporation (OAR).
8 *
9 *  Modified for LEON3 BSP.
10 *  COPYRIGHT (c) 2004.
11 *  Gaisler Research.
12 *
13 *  The license and distribution terms for this file may be
14 *  found in the file LICENSE in this distribution or at
15 *  http://www.rtems.com/license/LICENSE.
16 *
17 *  $Id$
18 */
19
20#include <bsp.h>
21#include <rtems/libio.h>
22#include <stdlib.h>
23#include <assert.h>
24
25/*
26 *  console_outbyte_polled
27 *
28 *  This routine transmits a character using polling.
29 */
30
31void console_outbyte_polled(
32  int  port,
33  unsigned char ch
34)
35{
36  if ((port >= 0) && (port <= CONFIGURE_NUMBER_OF_TERMIOS_PORTS))
37  {
38    while ( (LEON3_Console_Uart[port]->status & LEON_REG_UART_STATUS_THE) == 0 );
39    LEON3_Console_Uart[port]->data = (unsigned int) ch;
40  }
41}
42
43/*
44 *  console_inbyte_nonblocking
45 *
46 *  This routine polls for a character.
47 */
48
49int console_inbyte_nonblocking( int port )
50{
51
52  if ((port >=0) && (port < CONFIGURE_NUMBER_OF_TERMIOS_PORTS))
53  {
54
55      if (LEON3_Console_Uart[port]->status & LEON_REG_UART_STATUS_ERR) {
56        LEON3_Console_Uart[port]->status = ~LEON_REG_UART_STATUS_ERR;
57      }
58
59      if ((LEON3_Console_Uart[port]->status & LEON_REG_UART_STATUS_DR) == 0)
60         return -1;
61      return (int) LEON3_Console_Uart[port]->data;
62  }
63
64  else
65  {
66      assert( 0 );
67  }
68
69  return -1;
70}
Note: See TracBrowser for help on using the repository browser.