Ignore:
Timestamp:
Nov 30, 2009, 5:14:20 PM (9 years ago)
Author:
Ralf Corsepius <ralf.corsepius@…>
Branches:
4.10, 4.11, master
Children:
dbec22db
Parents:
05c1886
Message:

Whitespace removal.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libcpu/m68k/mcf5206/console/mcfuart.c

    r05c1886 r1857b00  
    2222#include "mcf5206/mcfuart.h"
    2323
    24 /* 
     24/*
    2525 * int_driven_uart -- mapping between interrupt vector number and
    2626 * UART descriptor structures
     
    3434static rtems_isr
    3535mcfuart_interrupt_handler(rtems_vector_number vec);
    36          
     36
    3737/*
    3838 * mcfuart_init --
     
    5757    if (uart == NULL)
    5858        return RTEMS_INVALID_ADDRESS;
    59    
     59
    6060    if ((chn <= 0) || (chn > MCF5206E_UART_CHANNELS))
    6161        return RTEMS_INVALID_NUMBER;
    62    
     62
    6363    uart->chn = chn;
    6464    uart->intvec = intvec;
    6565    uart->tty = tty;
    66    
     66
    6767    return RTEMS_SUCCESSFUL;
    6868}
     
    108108        default:      rate = 9600; break;
    109109    }
    110        
     110
    111111    div = SYSTEM_CLOCK_FREQUENCY / (rate * 32);
    112    
     112
    113113    *MCF5206E_UBG1(MBAR,uart->chn) = (uint8_t)((div >> 8) & 0xff);
    114114    *MCF5206E_UBG2(MBAR,uart->chn) = (uint8_t)(div & 0xff);
     
    137137    register uint32_t   chn;
    138138    rtems_status_code rc;
    139    
     139
    140140    if (uart == NULL)
    141141        return RTEMS_INVALID_ADDRESS;
    142    
     142
    143143    chn = uart->chn;
    144    
     144
    145145    /* Reset the receiver and transmitter */
    146146    *MCF5206E_UCR(MBAR,chn) = MCF5206E_UCR_MISC_RESET_RX;
    147147    *MCF5206E_UCR(MBAR,chn) = MCF5206E_UCR_MISC_RESET_TX;
    148    
     148
    149149    /*
    150150     * Program the vector number for a UART module interrupt, or
     
    171171        *MCF5206E_UIMR(MBAR,chn) = 0;
    172172    }
    173    
     173
    174174    /* Select the receiver and transmitter clock. */
    175175    mcfuart_set_baudrate(uart, B19200); /* dBUG defaults (unfortunately,
    176176                                           it is differ to termios default */
    177     *MCF5206E_UCSR(MBAR,chn) = 
     177    *MCF5206E_UCSR(MBAR,chn) =
    178178        MCF5206E_UCSR_RCS_TIMER | MCF5206E_UCSR_TCS_TIMER;
    179    
     179
    180180    /* Mode Registers 1,2 - set termios defaults (8N1) */
    181181    *MCF5206E_UCR(MBAR,chn) = MCF5206E_UCR_MISC_RESET_MR;
    182     *MCF5206E_UMR(MBAR,chn) = 
     182    *MCF5206E_UMR(MBAR,chn) =
    183183/*      MCF5206E_UMR1_RXRTS | */
    184184        MCF5206E_UMR1_PM_NO_PARITY |
     
    188188/*      MCF5206E_UMR2_TXCTS | */
    189189        MCF5206E_UMR2_SB_1;
    190    
     190
    191191    /* Enable Receiver and Transmitter */
    192192    *MCF5206E_UCR(MBAR,chn) = MCF5206E_UCR_MISC_RESET_ERR;
    193193    *MCF5206E_UCR(MBAR,chn) = MCF5206E_UCR_TC_ENABLE;
    194194    *MCF5206E_UCR(MBAR,chn) = MCF5206E_UCR_RC_ENABLE;
    195    
     195
    196196    return RTEMS_SUCCESSFUL;
    197197}
     
    213213{
    214214    rtems_status_code rc;
    215     *MCF5206E_UCR(MBAR,uart->chn) = 
     215    *MCF5206E_UCR(MBAR,uart->chn) =
    216216        MCF5206E_UCR_TC_DISABLE |
    217217        MCF5206E_UCR_RC_DISABLE;
     
    248248    speed_t baud;
    249249    uint8_t   umr1, umr2;
    250    
     250
    251251    baud = cfgetospeed(t);
    252252    umr1 = 0;
    253253    umr2 = MCF5206E_UMR2_CM_NORMAL;
    254    
     254
    255255    /* Set flow control */
    256256    if ((t->c_cflag & CRTSCTS) != 0)
     
    259259        umr2 |= MCF5206E_UMR2_TXCTS;
    260260    }
    261    
     261
    262262    /* Set character size */
    263263    switch (t->c_cflag & CSIZE)
     
    268268        case CS8: umr1 |= MCF5206E_UMR1_BC_8; break;
    269269    }
    270    
     270
    271271    /* Set number of stop bits */
    272272    if ((t->c_cflag & CSTOPB) != 0)
     
    292292        }
    293293    }
    294    
     294
    295295    /* Set parity mode */
    296296    if ((t->c_cflag & PARENB) != 0)
     
    309309        umr1 |= MCF5206E_UMR1_PM_NO_PARITY;
    310310    }
    311    
     311
    312312    rtems_interrupt_disable(level);
    313     *MCF5206E_UCR(MBAR,uart->chn) = 
     313    *MCF5206E_UCR(MBAR,uart->chn) =
    314314        MCF5206E_UCR_TC_DISABLE | MCF5206E_UCR_RC_DISABLE;
    315315    mcfuart_set_baudrate(uart, baud);
     
    319319    if ((t->c_cflag & CREAD) != 0)
    320320    {
    321         *MCF5206E_UCR(MBAR,uart->chn) = 
     321        *MCF5206E_UCR(MBAR,uart->chn) =
    322322            MCF5206E_UCR_TC_ENABLE | MCF5206E_UCR_RC_ENABLE;
    323323    }
     
    327327    }
    328328    rtems_interrupt_enable(level);
    329    
     329
    330330    return RTEMS_SUCCESSFUL;
    331331}
     
    424424    register int chn;
    425425    register int bp = 0;
    426    
     426
    427427    /* Find UART descriptor from vector number */
    428428    if (int_driven_uart[0].vec == vec)
     
    432432    else
    433433        return;
    434    
     434
    435435    chn = uart->chn;
    436    
     436
    437437    uisr = *MCF5206E_UISR(MBAR, chn);
    438438    if (uisr & MCF5206E_UISR_DB)
     
    440440        *MCF5206E_UCR(MBAR, chn) = MCF5206E_UCR_MISC_RESET_BRK;
    441441    }
    442    
     442
    443443    /* Receiving */
    444444    while (1)
     
    466466                buf[bp++] = *MCF5206E_URB(MBAR, chn);
    467467            }
    468            
     468
    469469            /* Reset error condition if any errors has been detected */
    470             if (usr & (MCF5206E_USR_RB | MCF5206E_USR_FE | 
     470            if (usr & (MCF5206E_USR_RB | MCF5206E_USR_FE |
    471471                       MCF5206E_USR_PE | MCF5206E_USR_OE))
    472472            {
     
    481481        }
    482482    }
    483    
     483
    484484    /* Transmitting */
    485485    while (1)
     
    526526    uart->tx_buf_len = len;
    527527    uart->tx_ptr = 0;
    528     *MCF5206E_UIMR(MBAR, uart->chn) = 
     528    *MCF5206E_UIMR(MBAR, uart->chn) =
    529529            MCF5206E_UIMR_FFULL | MCF5206E_UIMR_TXRDY;
    530530    while (((*MCF5206E_USR(MBAR,uart->chn) & MCF5206E_USR_TXRDY) != 0) &&
Note: See TracChangeset for help on using the changeset viewer.