Must check error flag before reading. Removed leds debug.

This commit is contained in:
nifi 2009-11-18 13:24:12 +00:00
parent 65a50f3d88
commit 2640f9bf26
1 changed files with 3 additions and 6 deletions

View File

@ -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.14 2009/10/30 15:06:27 adamdunkels Exp $ * @(#)$Id: uart1.c,v 1.15 2009/11/18 13:24:12 nifi Exp $
*/ */
/* /*
@ -37,7 +37,6 @@
#include <io.h> #include <io.h>
#include <signal.h> #include <signal.h>
#include "dev/leds.h"
#include "sys/energest.h" #include "sys/energest.h"
#include "dev/uart1.h" #include "dev/uart1.h"
#include "dev/watchdog.h" #include "dev/watchdog.h"
@ -174,14 +173,12 @@ uart1_rx_interrupt(void)
rx_in_progress = 1; rx_in_progress = 1;
LPM4_EXIT; LPM4_EXIT;
} else { } else {
c = RXBUF1;
rx_in_progress = 0; rx_in_progress = 0;
/* Check status register for receive errors. */ /* Check status register for receive errors. */
if(URCTL1 & RXERR) { if(URCTL1 & RXERR) {
volatile unsigned dummy; c = RXBUF1; /* Clear error flags by forcing a dummy read. */
leds_invert(LEDS_ALL);
// dummy = RXBUF1; /* Clear error flags by forcing a dummy read. */
} else { } else {
c = RXBUF1;
if(uart1_input_handler != NULL) { if(uart1_input_handler != NULL) {
if(uart1_input_handler(c)) { if(uart1_input_handler(c)) {
LPM4_EXIT; LPM4_EXIT;