Changeset c2015b44 in rtems


Ignore:
Timestamp:
03/14/13 10:54:31 (9 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, 5, master
Children:
6d9ab345
Parents:
df3f022
git-author:
Sebastian Huber <sebastian.huber@…> (03/14/13 10:54:31)
git-committer:
Sebastian Huber <sebastian.huber@…> (03/14/13 11:14:44)
Message:

bsp/edb7312: Improve output char

The output char function used by printk() is now independent of the
console driver initialization.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/arm/edb7312/console/uart.c

    rdf3f022 rc2015b44  
    102102}
    103103
     104static ssize_t uart_do_write(
     105    volatile uint32_t *uartdr,
     106    const char *buf,
     107    size_t len,
     108    volatile uint32_t *sysflg
     109)
     110{
     111    size_t i;
     112
     113    for (i = 0; i < len; i++) {
     114        /* Wait for fifo to have room */
     115        while ((*sysflg & EP7312_UART_UTXFF1) != 0) {
     116            continue;
     117        }
     118
     119        *uartdr = buf[i];
     120    }
     121
     122    return len;
     123}
     124
    104125static ssize_t uart_write(int minor, const char *buf, size_t len)
    105126{
    106127    volatile uint32_t   *data_reg;
    107128    volatile uint32_t   *ctrl_reg2;
    108     size_t i;
    109     char c;
    110129
    111130    data_reg  = (uint32_t *)Console_Port_Tbl[minor]->ulDataPort;
    112131    ctrl_reg2 = (uint32_t *)Console_Port_Tbl[minor]->ulCtrlPort2;
    113132
    114     for (i = 0; i < len; i++) {
    115         /* Wait for fifo to have room */
    116         while ((*ctrl_reg2 & EP7312_UART_UTXFF1) != 0) {
    117             continue;
    118         }
    119 
    120         c = (char) buf[i];
    121         *data_reg = c;
    122     }
    123 
    124     return len;
     133    return uart_do_write(data_reg, buf, len, ctrl_reg2);
    125134}
    126135
     
    148157static void _BSP_null_char(char c)
    149158{
    150   uart_write_polled(0, c);
     159  uart_do_write(EP7312_UARTDR1, &c, 1, EP7312_SYSFLG1);
    151160}
    152161
Note: See TracChangeset for help on using the changeset viewer.