URL
https://opencores.org/ocsvn/or1k/or1k/trunk
Subversion Repositories or1k
Compare Revisions
- This comparison shows the changes necessary to convert path
/
- from Rev 1395 to Rev 1396
- ↔ Reverse comparison
Rev 1395 → Rev 1396
/trunk/or1ksim/peripheral/16450.c
56,24 → 56,24
before a single character is transmitted or received. */ |
static unsigned long char_clks(int dll, int dlh, int lcr) |
{ |
float bauds_per_char = 1.; |
unsigned int bauds_per_char = 2; |
unsigned long char_clks = ((dlh << 8) + dll); |
|
if (lcr & UART_LCR_PARITY) |
bauds_per_char = bauds_per_char + 1.; |
bauds_per_char += 2; |
|
/* stop bits 1 or two */ |
if (lcr & UART_LCR_STOP) |
bauds_per_char = bauds_per_char + 2.; |
bauds_per_char += 4; |
else |
if ((lcr & 0x3) != 0) |
bauds_per_char = bauds_per_char + 1.; |
bauds_per_char += 2; |
else |
bauds_per_char = bauds_per_char + 1.5; |
bauds_per_char += 3; |
|
bauds_per_char = bauds_per_char + (5. + (lcr & 0x3)); |
bauds_per_char += 10 + ((lcr & 0x3) << 1); |
|
return char_clks * bauds_per_char; |
return (char_clks * bauds_per_char) >> 1; |
} |
|
/* Set a specific UART register with value. */ |