From 7352839d1ed1b44b888dcc107da5892dc0e26ce4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Ple=C3=9F?= Date: Fri, 14 Jun 2013 15:03:36 +0200 Subject: [PATCH] removed unnecessary uart1 code --- display/software/displayboard/src/uart.c | 185 ----------------------- 1 file changed, 185 deletions(-) diff --git a/display/software/displayboard/src/uart.c b/display/software/displayboard/src/uart.c index 728c627..c29ef62 100644 --- a/display/software/displayboard/src/uart.c +++ b/display/software/displayboard/src/uart.c @@ -477,188 +477,3 @@ void uart_puts_p(const char *progmem_s ) }/* uart_puts_p */ - -/* - * these functions are only for ATmegas with two USART - */ -#if defined( ATMEGA_USART1 ) - -ISR(UART1_RECEIVE_INTERRUPT) -/************************************************************************* -Function: UART1 Receive Complete interrupt -Purpose: called when the UART1 has received a character -**************************************************************************/ -{ - unsigned char tmphead; - unsigned char data; - unsigned char usr; - unsigned char lastRxError; - - - /* read UART status register and UART data register */ - usr = UART1_STATUS; - data = UART1_DATA; - - /* */ - lastRxError = (usr & (_BV(FE1)|_BV(DOR1)) ); - - /* calculate buffer index */ - tmphead = ( UART1_RxHead + 1) & UART_RX_BUFFER_MASK; - - if ( tmphead == UART1_RxTail ) { - /* error: receive buffer overflow */ - lastRxError = UART_BUFFER_OVERFLOW >> 8; - }else{ - /* store new index */ - UART1_RxHead = tmphead; - /* store received data in buffer */ - UART1_RxBuf[tmphead] = data; - } - UART1_LastRxError |= lastRxError; -} - - -ISR(UART1_TRANSMIT_INTERRUPT) -/************************************************************************* -Function: UART1 Data Register Empty interrupt -Purpose: called when the UART1 is ready to transmit the next byte -**************************************************************************/ -{ - unsigned char tmptail; - - - if ( UART1_TxHead != UART1_TxTail) { - /* calculate and store new buffer index */ - tmptail = (UART1_TxTail + 1) & UART_TX_BUFFER_MASK; - UART1_TxTail = tmptail; - /* get one byte from buffer and write it to UART */ - UART1_DATA = UART1_TxBuf[tmptail]; /* start transmission */ - }else{ - /* tx buffer empty, disable UDRE interrupt */ - UART1_CONTROL &= ~_BV(UART1_UDRIE); - } -} - - -/************************************************************************* -Function: uart1_init() -Purpose: initialize UART1 and set baudrate -Input: baudrate using macro UART_BAUD_SELECT() -Returns: none -**************************************************************************/ -void uart1_init(unsigned int baudrate) -{ - UART1_TxHead = 0; - UART1_TxTail = 0; - UART1_RxHead = 0; - UART1_RxTail = 0; - - - /* Set baud rate */ - if ( baudrate & 0x8000 ) - { - UART1_STATUS = (1<>8); - UBRR1L = (unsigned char) baudrate; - - /* Enable USART receiver and transmitter and receive complete interrupt */ - UART1_CONTROL = _BV(RXCIE1)|(1<