diff options
author | iperry <iperry@749a229e-a60e-11de-b98f-4500b42dc123> | 2010-01-10 13:22:52 +0000 |
---|---|---|
committer | iperry <iperry@749a229e-a60e-11de-b98f-4500b42dc123> | 2010-01-10 13:22:52 +0000 |
commit | f1598e62ac2cdd4a6077aed6ca200743a4de59e5 (patch) | |
tree | e74a17764c8d726610e458f6ac2564f27c7e160b /src/lib | |
parent | c7163bee3581d3ef28dd2fc2ca81219dc52ad45e (diff) | |
download | librambutan-f1598e62ac2cdd4a6077aed6ca200743a4de59e5.tar.gz librambutan-f1598e62ac2cdd4a6077aed6ca200743a4de59e5.zip |
enabled serial3
git-svn-id: https://leaflabs.googlecode.com/svn/trunk/library@109 749a229e-a60e-11de-b98f-4500b42dc123
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/usart.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/usart.c b/src/lib/usart.c index a06690e..76685fd 100644 --- a/src/lib/usart.c +++ b/src/lib/usart.c @@ -83,7 +83,12 @@ void USART2_IRQHandler(void) { ring_buf2.buf[ring_buf2.tail++] = (uint8_t)(((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_buf2.tail++] = (uint8_t)(((usart_port*)(USART3_BASE))->DR); + ring_buf3.tail %= USART_RECV_BUF_SIZE; +} /** * @brief Enable a USART in single buffer transmission mode, multibuffer @@ -124,6 +129,7 @@ void usart_init(uint8 usart_num, uint32 baud) { port = (usart_port*)USART3_BASE; ring_buf = &ring_buf3; clk_speed = USART3_CLK; + RCC_APB1PeriphClockCmd(RCC_APB1Periph_USART3, ENABLE); break; default: /* should never get here */ |