paparazzi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[paparazzi-commits] [6064] Modified uart test to test for data reflectio


From: Piotr Esden-Tempski
Subject: [paparazzi-commits] [6064] Modified uart test to test for data reflection.
Date: Mon, 04 Oct 2010 20:54:01 +0000

Revision: 6064
          http://svn.sv.gnu.org/viewvc/?view=rev&root=paparazzi&revision=6064
Author:   esden
Date:     2010-10-04 20:54:00 +0000 (Mon, 04 Oct 2010)
Log Message:
-----------
Modified uart test to test for data reflection.

The test is indicating if the same data it sends out is received by
switching on red or green leds on/off. The test can be easily performed
by connecting a loopback connector to the uart connectors.

Modified Paths:
--------------
    paparazzi3/trunk/sw/airborne/lisa/test_uart.c

Modified: paparazzi3/trunk/sw/airborne/lisa/test_uart.c
===================================================================
--- paparazzi3/trunk/sw/airborne/lisa/test_uart.c       2010-10-04 20:05:19 UTC 
(rev 6063)
+++ paparazzi3/trunk/sw/airborne/lisa/test_uart.c       2010-10-04 20:54:00 UTC 
(rev 6064)
@@ -51,21 +51,55 @@
 }
 
 static inline void main_periodic( void ) {
-  uart1_transmit('a');
-  uart1_transmit('b');
-  uart1_transmit('c');
-  uart1_transmit('\r');
-  uart1_transmit('\n');
-  uart2_transmit('d');
-  uart2_transmit('e');
-  uart2_transmit('f');
-  uart2_transmit('\r');
-  uart2_transmit('\n');
-  uart3_transmit('g');
-  uart3_transmit('h');
-  uart3_transmit('i');
-  uart3_transmit('\r');
-  uart3_transmit('\n');
+  char ch;
+
+  Uart1Transmit('a');
+  Uart2Transmit('b');
+  Uart3Transmit('c');
+
+  if (Uart1ChAvailable()) {
+       ch = Uart1Getch();
+       if (ch == 'a') {
+               LED_OFF(0);
+               LED_ON(1);
+       } else {
+               LED_ON(0);
+               LED_ON(1);
+       }
+  } else {
+               LED_ON(0);
+               LED_OFF(1);
+  }
+
+  if (Uart2ChAvailable()) {
+       ch = Uart2Getch();
+       if (ch == 'b') {
+               LED_OFF(2);
+               LED_ON(3);
+       } else {
+               LED_ON(2);
+               LED_ON(3);
+       }
+  } else {
+               LED_ON(2);
+               LED_OFF(3);
+  }
+
+  if (Uart3ChAvailable()) {
+       ch = Uart3Getch();
+       if (ch == 'c') {
+               LED_OFF(4);
+               LED_ON(5);
+       } else {
+               LED_ON(4);
+               LED_ON(5);
+       }
+  } else {
+               LED_ON(4);
+               LED_OFF(5);
+  }
+
+  LED_PERIODIC();
 }
 
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]