paparazzi-commits
[Top][All Lists]
Advanced

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

[paparazzi-commits] [5684] made test_adc target in lisa_l_test_progs.mak


From: antoine drouin
Subject: [paparazzi-commits] [5684] made test_adc target in lisa_l_test_progs.makefile
Date: Thu, 26 Aug 2010 00:15:51 +0000

Revision: 5684
          http://svn.sv.gnu.org/viewvc/?view=rev&root=paparazzi&revision=5684
Author:   poine
Date:     2010-08-26 00:15:50 +0000 (Thu, 26 Aug 2010)
Log Message:
-----------
made test_adc target in lisa_l_test_progs.makefile

Modified Paths:
--------------
    paparazzi3/trunk/conf/airframes/Poine/booz2_a7.xml
    paparazzi3/trunk/conf/autopilot/lisa_l_test_progs.makefile
    paparazzi3/trunk/sw/airborne/lisa/test_adc.c
    paparazzi3/trunk/sw/airborne/stm32/stm32_vector_table.c

Modified: paparazzi3/trunk/conf/airframes/Poine/booz2_a7.xml
===================================================================
--- paparazzi3/trunk/conf/airframes/Poine/booz2_a7.xml  2010-08-25 23:32:26 UTC 
(rev 5683)
+++ paparazzi3/trunk/conf/airframes/Poine/booz2_a7.xml  2010-08-26 00:15:50 UTC 
(rev 5684)
@@ -206,6 +206,7 @@
     <target name="test_baro"        board="lisa_l_1.0"/>
     <target name="test_rc_spektrum" board="lisa_l_1.0"/>
     <target name="test_rc_ppm"      board="lisa_l_1.0"/>
+    <target name="test_adc"         board="lisa_l_1.0"/>
   </firmware>
 
   <firmware name="lisa_passthrough">

Modified: paparazzi3/trunk/conf/autopilot/lisa_l_test_progs.makefile
===================================================================
--- paparazzi3/trunk/conf/autopilot/lisa_l_test_progs.makefile  2010-08-25 
23:32:26 UTC (rev 5683)
+++ paparazzi3/trunk/conf/autopilot/lisa_l_test_progs.makefile  2010-08-26 
00:15:50 UTC (rev 5684)
@@ -195,3 +195,38 @@
                       $(SRC_BOOZ)/radio_control/booz_radio_control_ppm.c \
                       
$(SRC_BOOZ_ARCH)/radio_control/booz_radio_control_ppm_arch.c
 test_rc_ppm.CFLAGS += -DUSE_TIM2_IRQ
+
+#
+# test_adc
+#
+# configuration
+#   SYS_TIME_LED
+#   MODEM_PORT
+#   MODEM_BAUD
+#   RADIO_CONTROL_LED
+#
+test_adc.ARCHDIR = $(ARCHI)
+test_adc.TARGET = test_adc
+test_adc.TARGETDIR = test_adc
+test_adc.CFLAGS = -I$(SRC_LISA) -I$(ARCHI) -DPERIPHERALS_AUTO_INIT
+test_adc.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG)
+test_adc.srcs = $(SRC_LISA)/test_adc.c \
+                $(SRC_ARCH)/stm32_exceptions.c \
+                $(SRC_ARCH)/stm32_vector_table.c
+test_adc.CFLAGS += -DUSE_LED
+test_adc.srcs   += $(SRC_ARCH)/led_hw.c
+test_adc.CFLAGS += -DUSE_SYS_TIME 
+test_adc.CFLAGS +=-DSYS_TIME_LED=$(SYS_TIME_LED)
+test_adc.CFLAGS += -DPERIODIC_TASK_PERIOD='SYS_TICS_OF_SEC(1./512.)'
+test_adc.srcs   += sys_time.c $(SRC_ARCH)/sys_time_hw.c
+
+test_adc.CFLAGS += -DUSE_$(MODEM_PORT) -D$(MODEM_PORT)_BAUD=$(MODEM_BAUD)
+test_adc.srcs   += $(SRC_ARCH)/uart_hw.c
+test_adc.CFLAGS += -DDATALINK=PPRZ -DPPRZ_UART=Uart2
+
+test_adc.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport 
-DDOWNLINK_DEVICE=$(MODEM_PORT) 
+test_adc.srcs   += downlink.c pprz_transport.c
+
+test_adc.srcs   += $(SRC_ARCH)/adc_hw.c
+test_adc.CFLAGS += -DUSE_AD1 -DUSE_AD1_1 -DUSE_AD1_2 -DUSE_AD1_3 -DUSE_AD1_4
+test_adc.CFLAGS += -DUSE_ADC1_2_IRQ_HANDLER
\ No newline at end of file

Modified: paparazzi3/trunk/sw/airborne/lisa/test_adc.c
===================================================================
--- paparazzi3/trunk/sw/airborne/lisa/test_adc.c        2010-08-25 23:32:26 UTC 
(rev 5683)
+++ paparazzi3/trunk/sw/airborne/lisa/test_adc.c        2010-08-26 00:15:50 UTC 
(rev 5684)
@@ -1,7 +1,7 @@
 /*
  * $Id$
  *  
- * Copyright (C) 2009 Antoine Drouin <address@hidden>
+ * Copyright (C) 2010 The Paparazzi Team
  *
  * This file is part of paparazzi.
  *
@@ -18,7 +18,8 @@
  * You should have received a copy of the GNU General Public License
  * along with paparazzi; see the file COPYING.  If not, write to
  * the Free Software Foundation, 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA. 
+ * Boston, MA 02111-1307, USA.
+ *
  */
 
 #include <stm32/flash.h>
@@ -47,9 +48,7 @@
 static inline void main_init( void ) {
        hw_init();
        sys_time_init();
-       led_init(); 
-       adc_init(); 
-       
+       adc_init();     
        adc_buf_channel(0, &adc0_buf, 3);
        adc_buf_channel(1, &adc1_buf, 3);
        adc_buf_channel(2, &adc2_buf, 3);
@@ -57,32 +56,33 @@
 }
 
 int main( void ) {
-       main_init(); 
-
-       while(1) {
-             if (sys_time_periodic()) { 
-               main_periodic_task();
-               DOWNLINK_SEND_ALIVE(DefaultChannel, 16, MD5SUM); 
-             }
-       
-             main_event_task();
-       }
-       return 0;
+  main_init(); 
+  
+  while(1) {
+    if (sys_time_periodic()) { 
+      main_periodic_task();
+    }
+    main_event_task();
+  }
+  return 0;
 }
 
 static inline void main_periodic_task( void ) {
-       LED_PERIODIC();
+  RunOnceEvery(100, {DOWNLINK_SEND_ALIVE(DefaultChannel, 16, MD5SUM);});
+  RunOnceEvery(100, {/*LED_TOGGLE(7);*/ DOWNLINK_SEND_TIME(DefaultChannel, 
&cpu_time_sec);});  
+  LED_PERIODIC();
 }
 
 static inline void main_event_task( void ) {
-       uint8_t down = 123;
-       
-       if (adc_new_data_trigger) { 
-               DOWNLINK_SEND_PONG(DefaultChannel);
-               adc_new_data_trigger = 0; 
-               LED_TOGGLE(7);
-//             down = (((adc0_buf.values[0]) >> 4) & 0x00ff);
-               DOWNLINK_SEND_BOOZ_DEBUG_FOO(DefaultChannel, &down);
-       }
+  
+  if (adc_new_data_trigger) { 
+    adc_new_data_trigger = 0; 
+    uint16_t v1 = 123;
+    uint16_t v2 = 123;
+    v1 = (((adc0_buf.values[0]) >> 4) & 0x00ff);
+    v2 = (((adc1_buf.values[0]) >> 4) & 0x00ff);
+    RunOnceEvery(100, {DOWNLINK_SEND_ADC_GENERIC(DefaultChannel, &v1, &v2)});
+  }
+
 }
 

Modified: paparazzi3/trunk/sw/airborne/stm32/stm32_vector_table.c
===================================================================
--- paparazzi3/trunk/sw/airborne/stm32/stm32_vector_table.c     2010-08-25 
23:32:26 UTC (rev 5683)
+++ paparazzi3/trunk/sw/airborne/stm32/stm32_vector_table.c     2010-08-26 
00:15:50 UTC (rev 5684)
@@ -152,7 +152,14 @@
 #define DMA1_C4_IRQ_HANDLER null_handler
 #endif
 
+#ifdef USE_ADC1_2_IRQ_HANDLER
+extern void adc1_2_irq_handler(void);
+#define ADC1_2_IRQ_HANDLER adc1_2_irq_handler
+#else
+#define ADC1_2_IRQ_HANDLER null_handler
+#endif
 
+
 #ifdef USE_TIM1_UP_IRQ
 extern void tim1_up_irq_handler(void);
 #define TIM1_UP_IRQ_HANDLER tim1_up_irq_handler
@@ -229,7 +236,7 @@
     null_handler,             /* dma1_channel5_irq_handler */
     null_handler,             /* dma1_channel6_irq_handler */
     null_handler,             /* dma1_channel7_irq_handler */
-    null_handler,             /* adc1_2_irq_handler */
+    ADC1_2_IRQ_HANDLER,       /* adc1_2_irq_handler */
     USB_HP_CAN1_TX_IRQ_HANDLER, /* usb_hp_can_tx_irq_handler */
     USB_LP_CAN1_RX0_IRQ_HANDLER, /* usb_lp_can_rx0_irq_handler */
     null_handler,             /* can_rx1_irq_handler */




reply via email to

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