Changeset 34 in XOpenSparcT1 for trunk/sw/uart.c
- Timestamp:
- 04/08/11 11:08:37 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sw/uart.c
r33 r34 3 3 const long UART_BASE_ADR[1] = {0x800000FFF0C2C000}; 4 4 const int UART_BAUDS[1] = {0}; 5 const int BAUD_RATE =100000; 5 6 const int IN_CLK =50000000; 6 7 … … 59 60 long allone=0xffffffffffffffff; 60 61 int divisor; 61 float float_divisor;62 //float float_divisor; 62 63 /* Reset receiver and transmiter */ 63 64 REG8( UART_FCR ) = UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT | UART_FCR_TRIGGER_14; … … 73 74 74 75 /* 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 79 81 REG8(UART_BASE_ADR[core] + UART_LCR) |= UART_LCR_DLAB; 80 82 REG8(UART_BASE_ADR[core] + UART_DLL) = divisor & 0x000000ff;
Note: See TracChangeset
for help on using the changeset viewer.