mc1322x: build fixes for uart2

This commit is contained in:
Mariano Alvira 2011-07-08 19:38:31 -04:00
parent e2d74fa0a5
commit e80f9eb4b5
8 changed files with 124 additions and 51 deletions

View file

@ -28,7 +28,7 @@
* SUCH DAMAGE.
*
* This file is part of libmc1322x: see http://mc1322x.devl.org
* for details.
* for details.
*
*
*/
@ -48,13 +48,13 @@ void uart1_isr(void) {
#if UART1_RX_BUFFERSIZE > 32
if (*UART1_USTAT & ( 1 << 6)) { //receive interrupt
while( *UART1_URXCON != 0 ) { //flush the hardware fifo into the software buffer
while( *UART1_URXCON != 0 ) { //flush the hardware fifo into the software buffer
uint32_t u1_rx_tail_next;
u1_rx_tail_next = u1_rx_tail+1;
u1_rx_tail_next = u1_rx_tail+1;
if (u1_rx_tail_next >= sizeof(u1_rx_buf))
u1_rx_tail_next = 0;
if (u1_rx_head != u1_rx_tail_next) {
u1_rx_buf[u1_rx_tail]= *UART1_UDATA;
u1_rx_buf[u1_rx_tail]= *UART1_UDATA;
u1_rx_tail = u1_rx_tail_next;
}
}
@ -62,7 +62,7 @@ void uart1_isr(void) {
}
#endif
while( *UART1_UTXCON != 0 ) {
while( *UART1_UTXCON != 0 ) {
if (u1_tx_head == u1_tx_tail) {
#if UART1_RX_BUFFERSIZE > 32
*UART1_UCON |= (1 << 13); /*disable tx interrupt */
@ -73,7 +73,7 @@ void uart1_isr(void) {
}
*UART1_UDATA = u1_tx_buf[u1_tx_tail];
u1_tx_tail++;
u1_tx_tail++;
if (u1_tx_tail >= sizeof(u1_tx_buf))
u1_tx_tail = 0;
}
@ -81,7 +81,7 @@ void uart1_isr(void) {
void uart1_putc(char c) {
/* disable UART1 since */
/* UART1 isr modifies u1_tx_head and u1_tx_tail */
/* UART1 isr modifies u1_tx_head and u1_tx_tail */
#if UART1_RX_BUFFERSIZE > 32
*UART1_UCON |= (1 << 13); /*disable tx interrupt */
#else