diff options
author | Perry Hung <iperry@alum.mit.edu> | 2010-03-31 21:29:29 -0400 |
---|---|---|
committer | Perry Hung <iperry@alum.mit.edu> | 2010-03-31 21:29:29 -0400 |
commit | 25c7ba0ed78aea0a368bc178dd720a845dd515ac (patch) | |
tree | 86be2502247dc0dd831191ae219a62875daad97c /libmaple/usart.c | |
parent | 4e51e057bb5a8d6b3475d2202af8a2a2caf9ba7b (diff) | |
download | librambutan-25c7ba0ed78aea0a368bc178dd720a845dd515ac.tar.gz librambutan-25c7ba0ed78aea0a368bc178dd720a845dd515ac.zip |
Removed inttypes.h
Removed inttypes.h from libmaple. Will have another pass through to use
the standard libmaple types, but will come in another commit.
Diffstat (limited to 'libmaple/usart.c')
-rw-r--r-- | libmaple/usart.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libmaple/usart.c b/libmaple/usart.c index 545f64a..ec3d31b 100644 --- a/libmaple/usart.c +++ b/libmaple/usart.c @@ -78,20 +78,20 @@ typedef struct usart_port { void USART1_IRQHandler(void) { /* Read the data */ - ring_buf1.buf[ring_buf1.tail++] = (uint8_t)(((usart_port*)(USART1_BASE))->DR); + ring_buf1.buf[ring_buf1.tail++] = (uint8)(((usart_port*)(USART1_BASE))->DR); ring_buf1.tail %= USART_RECV_BUF_SIZE; } /* Don't overrun your buffer, seriously */ void USART2_IRQHandler(void) { /* Read the data */ - ring_buf2.buf[ring_buf2.tail++] = (uint8_t)(((usart_port*)(USART2_BASE))->DR); + ring_buf2.buf[ring_buf2.tail++] = (uint8)(((usart_port*)(USART2_BASE))->DR); ring_buf2.tail %= USART_RECV_BUF_SIZE; } /* Don't overrun your buffer, seriously */ void USART3_IRQHandler(void) { /* Read the data */ - ring_buf3.buf[ring_buf3.tail++] = (uint8_t)(((usart_port*)(USART3_BASE))->DR); + ring_buf3.buf[ring_buf3.tail++] = (uint8)(((usart_port*)(USART3_BASE))->DR); ring_buf3.tail %= USART_RECV_BUF_SIZE; } @@ -156,7 +156,7 @@ void usart_init(uint8 usart_num, uint32 baud) { fractional_part = integer_part - (100 * (tmp >> 4)); tmp |= (((fractional_part * 16) + 50) / 100) & ((uint8)0x0F); - port->BRR = (uint16_t)tmp; + port->BRR = (uint16)tmp; port->CR1 = USART_TE | // transmitter enable USART_RE | // receiver enable |