forked from Imagelibrary/rtems
2008-08-18 Joel Sherrill <joel.sherrill@OARcorp.com>
* Makefile.am, console/console.c: Split debug IO code into separate file. * console/debugio.c: New file.
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
2008-08-18 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||
|
||||
* Makefile.am, console/console.c: Split debug IO code into separate
|
||||
file.
|
||||
* console/debugio.c: New file.
|
||||
|
||||
2008-06-19 Matthew Riek <matthew.riek@ibiscomputer.com.au>
|
||||
|
||||
* startup/cfinit.c, startup/init52235.c: Missed the last patch.
|
||||
|
||||
@@ -35,6 +35,7 @@ startup_SOURCES = startup/bspclean.c ../../shared/bsppredriverhook.c \
|
||||
../../shared/gnatinstallhandler.c
|
||||
clock_SOURCES = clock/clock.c
|
||||
console_SOURCES = console/console.c
|
||||
debugio_SOURCES = console/debugio.c
|
||||
timer_SOURCES = timer/timer.c
|
||||
|
||||
#if HAS_NETWORKING
|
||||
@@ -48,7 +49,7 @@ timer_SOURCES = timer/timer.c
|
||||
|
||||
noinst_LIBRARIES = libbsp.a
|
||||
libbsp_a_SOURCES = $(startup_SOURCES) $(clock_SOURCES) $(console_SOURCES) \
|
||||
$(timer_SOURCES)
|
||||
$(debugio_SOURCES) $(timer_SOURCES)
|
||||
|
||||
libbsp_a_LIBADD = \
|
||||
../../../libcpu/@RTEMS_CPU@/shared/cache.rel \
|
||||
|
||||
@@ -25,23 +25,6 @@
|
||||
static int IntUartPollWrite(int minor, const char *buf, int len);
|
||||
static int IntUartInterruptWrite(int minor, const char *buf, int len);
|
||||
|
||||
static void _BSP_null_char(char c)
|
||||
{
|
||||
int level;
|
||||
|
||||
if (c == '\n')
|
||||
_BSP_null_char('\r');
|
||||
rtems_interrupt_disable(level);
|
||||
while ((MCF_UART_USR(CONSOLE_PORT) & MCF_UART_USR_TXRDY) == 0)
|
||||
continue;
|
||||
MCF_UART_UTB(CONSOLE_PORT) = c;
|
||||
while ((MCF_UART_USR(CONSOLE_PORT) & MCF_UART_USR_TXRDY) == 0)
|
||||
continue;
|
||||
rtems_interrupt_enable(level);
|
||||
}
|
||||
|
||||
BSP_output_char_function_type BSP_output_char = _BSP_null_char;
|
||||
|
||||
#define MAX_UART_INFO 3
|
||||
#define RX_BUFFER_SIZE 512
|
||||
|
||||
@@ -670,24 +653,3 @@ rtems_device_driver console_control(rtems_device_major_number major,
|
||||
{
|
||||
return (rtems_termios_ioctl(arg));
|
||||
}
|
||||
int DEBUG_OUTCHAR(int c)
|
||||
{
|
||||
if (c == '\n')
|
||||
DEBUG_OUTCHAR('\r');
|
||||
_BSP_null_char(c);
|
||||
return c;
|
||||
}
|
||||
void DEBUG_OUTSTR(const char *msg)
|
||||
{
|
||||
while (*msg)
|
||||
DEBUG_OUTCHAR(*msg++);
|
||||
}
|
||||
void DEBUG_OUTNUM(int i)
|
||||
{
|
||||
int n;
|
||||
static const char map[] = "0123456789ABCDEF";
|
||||
|
||||
DEBUG_OUTCHAR(' ');
|
||||
for (n = 28; n >= 0; n -= 4)
|
||||
DEBUG_OUTCHAR(map[(i >> n) & 0xF]);
|
||||
}
|
||||
|
||||
32
c/src/lib/libbsp/m68k/mcf52235/console/debugio.c
Normal file
32
c/src/lib/libbsp/m68k/mcf52235/console/debugio.c
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Multi UART console serial I/O.
|
||||
*
|
||||
* TO DO: Add DMA input/output
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
#include <rtems/libio.h>
|
||||
#include <rtems/termiostypes.h>
|
||||
#include <termios.h>
|
||||
#include <bsp.h>
|
||||
#include <malloc.h>
|
||||
#include <rtems/mw_uid.h>
|
||||
|
||||
#include <rtems/bspIo.h>
|
||||
|
||||
static void _BSP_null_char(char c)
|
||||
{
|
||||
int level;
|
||||
|
||||
rtems_interrupt_disable(level);
|
||||
while ((MCF_UART_USR(CONSOLE_PORT) & MCF_UART_USR_TXRDY) == 0)
|
||||
continue;
|
||||
MCF_UART_UTB(CONSOLE_PORT) = c;
|
||||
while ((MCF_UART_USR(CONSOLE_PORT) & MCF_UART_USR_TXRDY) == 0)
|
||||
continue;
|
||||
rtems_interrupt_enable(level);
|
||||
}
|
||||
|
||||
BSP_output_char_function_type BSP_output_char = _BSP_null_char;
|
||||
|
||||
Reference in New Issue
Block a user