Initialize the transmit ringbuffer before enabling TX interrupt
This commit is contained in:
parent
1bede62d2a
commit
c6f7ef84fe
1 changed files with 2 additions and 3 deletions
|
@ -26,7 +26,7 @@
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* 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 "sys/energest.h"
|
||||||
#include "dev/uart1.h"
|
#include "dev/uart1.h"
|
||||||
#include "dev/leds.h"
|
|
||||||
#include "dev/watchdog.h"
|
#include "dev/watchdog.h"
|
||||||
|
|
||||||
#include "lib/ringbuf.h"
|
#include "lib/ringbuf.h"
|
||||||
|
@ -162,8 +161,8 @@ uart1_init(unsigned long ubr)
|
||||||
|
|
||||||
IE2 |= URXIE1; /* Enable USART1 RX interrupt */
|
IE2 |= URXIE1; /* Enable USART1 RX interrupt */
|
||||||
#if TX_WITH_INTERRUPT
|
#if TX_WITH_INTERRUPT
|
||||||
IE2 |= UTXIE1; /* Enable USART1 RX interrupt */
|
|
||||||
ringbuf_init(&txbuf, txbuf_data, sizeof(txbuf_data));
|
ringbuf_init(&txbuf, txbuf_data, sizeof(txbuf_data));
|
||||||
|
IE2 |= UTXIE1; /* Enable USART1 TX interrupt */
|
||||||
#endif /* TX_WITH_INTERRUPT */
|
#endif /* TX_WITH_INTERRUPT */
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
Loading…
Reference in a new issue