aboutsummaryrefslogtreecommitdiff
path: root/src/modules/px4iofirmware/serial.c
diff options
context:
space:
mode:
authorpx4dev <px4@purgatory.org>2013-07-06 12:27:37 -0700
committerpx4dev <px4@purgatory.org>2013-07-06 12:27:37 -0700
commit4d400aa7e75aa091fb649bbeaf0a2d6a644c177c (patch)
treefbd54c773d55b090726fe079802d562b9e55495c /src/modules/px4iofirmware/serial.c
parent87a4f1507a3bca4bcae870b13ff5416669ededf0 (diff)
downloadpx4-firmware-4d400aa7e75aa091fb649bbeaf0a2d6a644c177c.tar.gz
px4-firmware-4d400aa7e75aa091fb649bbeaf0a2d6a644c177c.tar.bz2
px4-firmware-4d400aa7e75aa091fb649bbeaf0a2d6a644c177c.zip
Enable UART error handling on PX4IO.
Diffstat (limited to 'src/modules/px4iofirmware/serial.c')
-rw-r--r--src/modules/px4iofirmware/serial.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/modules/px4iofirmware/serial.c b/src/modules/px4iofirmware/serial.c
index 8742044c3..e4bc68f58 100644
--- a/src/modules/px4iofirmware/serial.c
+++ b/src/modules/px4iofirmware/serial.c
@@ -129,8 +129,8 @@ interface_init(void)
irq_attach(PX4FMU_SERIAL_VECTOR, serial_interrupt);
up_enable_irq(PX4FMU_SERIAL_VECTOR);
- /* enable UART and DMA */
- /*rCR3 = USART_CR3_EIE; */
+ /* enable UART and error/idle interrupts */
+ rCR3 = USART_CR3_EIE;
rCR1 = USART_CR1_RE | USART_CR1_TE | USART_CR1_UE | USART_CR1_IDLEIE;
#if 0 /* keep this for signal integrity testing */
@@ -259,7 +259,6 @@ serial_interrupt(int irq, void *context)
uint32_t sr = rSR; /* get UART status register */
(void)rDR; /* required to clear any of the interrupt status that brought us here */
-#if 0
if (sr & (USART_SR_ORE | /* overrun error - packet was too big for DMA or DMA was too slow */
USART_SR_NE | /* noise error - we have lost a byte due to noise */
USART_SR_FE)) { /* framing error - start/stop bit lost or line break */
@@ -278,7 +277,7 @@ serial_interrupt(int irq, void *context)
/* don't attempt to handle IDLE if it's set - things went bad */
return 0;
}
-#endif
+
if (sr & USART_SR_IDLE) {
/* the packet might have been short - go check */