source: rtems/c/src/lib/libbsp/or1k/generic_or1k/console/console-config.c @ 1bc0ad2

5
Last change on this file since 1bc0ad2 was 1bc0ad2, checked in by Sebastian Huber <sebastian.huber@…>, on 09/08/17 at 08:38:46

Simplify and unify BSP_output_char

The BSP_output_char should output a char and not mingle with high level
processing, e.g. '\n' to '\r\n' translation. Move this translation to
rtems_putc(). Remove it from all the BSP_output_char implementations.

Close #3122.

  • Property mode set to 100644
File size: 1.2 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup generic_or1k_uart
5 *
6 * @brief Console Configuration.
7 */
8
9/*
10 * Copyright (c) 2014-2015 Hesham ALMatary
11 *
12 *  The license and distribution terms for this file may be
13 *  found in the file LICENSE in this distribution or at
14 *  http://www.rtems.org/license/LICENSE
15 */
16
17#include <rtems/bspIo.h>
18
19#include <libchip/serial.h>
20
21#include <bspopts.h>
22#include <bsp/uart.h>
23#include <bsp/generic_or1k.h>
24
25console_tbl Console_Configuration_Ports [] = {
26    {
27      .sDeviceName = "/dev/ttyS0",
28      .deviceType = SERIAL_CUSTOM,
29      .pDeviceFns = &generic_or1k_uart_fns,
30      .deviceProbe = NULL,
31      .pDeviceFlow = NULL,
32      .ulCtrlPort1 = OR1K_BSP_UART_BASE,
33      .ulCtrlPort2 = 0,
34      .ulClock = OR1K_UART_DEFAULT_BAUD,
35      .ulIntVector = OR1K_BSP_UART_IRQ
36    }
37};
38
39#define PORT_COUNT \
40  (sizeof(Console_Configuration_Ports) \
41    / sizeof(Console_Configuration_Ports [0]))
42
43unsigned long Console_Configuration_Count = PORT_COUNT;
44
45static void output_char(char c)
46{
47  const console_fns *con =
48    Console_Configuration_Ports [Console_Port_Minor].pDeviceFns;
49
50  con->deviceWritePolled((int) Console_Port_Minor, c);
51}
52
53BSP_output_char_function_type BSP_output_char = output_char;
54
55BSP_polling_getchar_function_type BSP_poll_char = NULL;
Note: See TracBrowser for help on using the repository browser.