Changeset 34 in XOpenSparcT1 for trunk/sw/uart.c


Ignore:
Timestamp:
04/08/11 11:08:37 (14 years ago)
Author:
pntsvt00
Message:

versione pre-pre-alpha

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sw/uart.c

    r33 r34  
    33const long UART_BASE_ADR[1] = {0x800000FFF0C2C000}; 
    44const int UART_BAUDS[1] = {0}; 
     5const int BAUD_RATE =100000; 
    56const int IN_CLK =50000000; 
    67 
     
    5960        long allone=0xffffffffffffffff; 
    6061        int divisor; 
    61         float float_divisor; 
     62        //float float_divisor; 
    6263        /* Reset receiver and transmiter */ 
    6364        REG8( UART_FCR ) = UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT | UART_FCR_TRIGGER_14; 
     
    7374         
    7475        /* Set baud rate */ 
    75         float_divisor = (float) IN_CLK/(16 * UART_BAUDS[core]); 
    76         float_divisor += 0.50f; // Ensure round up 
    77         divisor = (int) float_divisor; 
    78          
     76        //float_divisor = (float) IN_CLK/(16 * UART_BAUDS[core]); 
     77        //float_divisor += 0.50f; // Ensure round up 
     78        //divisor = (int) float_divisor; 
     79        divisor = BAUD_RATE; 
     80 
    7981        REG8(UART_BASE_ADR[core] + UART_LCR) |= UART_LCR_DLAB; 
    8082        REG8(UART_BASE_ADR[core] + UART_DLL) = divisor & 0x000000ff; 
Note: See TracChangeset for help on using the changeset viewer.