Initialize the transmit ringbuffer before enabling TX interrupt

This commit is contained in:
nifi 2009-09-08 10:39:49 +00:00
parent 1bede62d2a
commit c6f7ef84fe

View File

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)$Id: uart1.c,v 1.11 2009/03/02 22:01:26 adamdunkels Exp $
* @(#)$Id: uart1.c,v 1.12 2009/09/08 10:39:49 nifi Exp $
*/
/*
@ -39,7 +39,6 @@
#include "sys/energest.h"
#include "dev/uart1.h"
#include "dev/leds.h"
#include "dev/watchdog.h"
#include "lib/ringbuf.h"
@ -162,8 +161,8 @@ uart1_init(unsigned long ubr)
IE2 |= URXIE1; /* Enable USART1 RX interrupt */
#if TX_WITH_INTERRUPT
IE2 |= UTXIE1; /* Enable USART1 RX interrupt */
ringbuf_init(&txbuf, txbuf_data, sizeof(txbuf_data));
IE2 |= UTXIE1; /* Enable USART1 TX interrupt */
#endif /* TX_WITH_INTERRUPT */
}
/*---------------------------------------------------------------------------*/