paparazzi-commits
[Top][All Lists]
Advanced

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

[paparazzi-commits] [6235] add module that send data on a windturbine by


From: Gautier Hattenberger
Subject: [paparazzi-commits] [6235] add module that send data on a windturbine by using trigger_ext as a low level module
Date: Mon, 25 Oct 2010 15:34:39 +0000

Revision: 6235
          http://svn.sv.gnu.org/viewvc/?view=rev&root=paparazzi&revision=6235
Author:   gautier
Date:     2010-10-25 15:34:39 +0000 (Mon, 25 Oct 2010)
Log Message:
-----------
add module that send data on a windturbine by using trigger_ext as a low level 
module

Modified Paths:
--------------
    paparazzi3/trunk/conf/modules/trig_test.xml
    paparazzi3/trunk/sw/airborne/arch/lpc21/modules/core/trigger_ext_hw.c
    paparazzi3/trunk/sw/airborne/modules/core/trigger_ext.c
    paparazzi3/trunk/sw/airborne/modules/core/trigger_ext.h

Added Paths:
-----------
    paparazzi3/trunk/conf/modules/windturbine.xml
    paparazzi3/trunk/sw/airborne/arch/sim/modules/core/
    paparazzi3/trunk/sw/airborne/arch/sim/modules/core/trigger_ext_hw.c
    paparazzi3/trunk/sw/airborne/arch/sim/modules/core/trigger_ext_hw.h
    paparazzi3/trunk/sw/airborne/modules/meteo/windturbine.c
    paparazzi3/trunk/sw/airborne/modules/meteo/windturbine.h

Modified: paparazzi3/trunk/conf/modules/trig_test.xml
===================================================================
--- paparazzi3/trunk/conf/modules/trig_test.xml 2010-10-25 15:21:46 UTC (rev 
6234)
+++ paparazzi3/trunk/conf/modules/trig_test.xml 2010-10-25 15:34:39 UTC (rev 
6235)
@@ -5,7 +5,7 @@
     <file name="trigger_ext.h"/>
   </header>
   <init fun="trigger_ext_init()"/>
-  <makefile target="ap">
+  <makefile>
     <file_hw name="trigger_ext_hw.c"/>
     <file name="trigger_ext.c"/>
     <flag name="TRIGGER_EXT"/>

Added: paparazzi3/trunk/conf/modules/windturbine.xml
===================================================================
--- paparazzi3/trunk/conf/modules/windturbine.xml                               
(rev 0)
+++ paparazzi3/trunk/conf/modules/windturbine.xml       2010-10-25 15:34:39 UTC 
(rev 6235)
@@ -0,0 +1,15 @@
+<!DOCTYPE module SYSTEM "module.dtd">
+
+<module name="windturbine" dir="meteo">
+  <depend require="trig_test.xml"/>
+  <header>
+    <file name="windturbine.h"/>
+  </header>
+  <periodic fun="windturbine_periodic()" freq="10"/>
+  <makefile>
+    <file name="windturbine.c"/>
+    <flag name="TURBINE_ID" value="42"/>
+    <flag name="GPS_TIMESTAMP"/>
+  </makefile>
+</module>
+

Modified: paparazzi3/trunk/sw/airborne/arch/lpc21/modules/core/trigger_ext_hw.c
===================================================================
--- paparazzi3/trunk/sw/airborne/arch/lpc21/modules/core/trigger_ext_hw.c       
2010-10-25 15:21:46 UTC (rev 6234)
+++ paparazzi3/trunk/sw/airborne/arch/lpc21/modules/core/trigger_ext_hw.c       
2010-10-25 15:34:39 UTC (rev 6235)
@@ -35,9 +35,9 @@
   trigger_t0 = TRIGGER_CR;
   delta_t0_temp = trigger_t0 - last;
   if (MSEC_OF_SYS_TICS(delta_t0_temp) > 10) {
-    delta_t0 = delta_t0_temp;
+    trigger_delta_t0 = delta_t0_temp;
     last = trigger_t0;
-    trig_ext_valid = TRUE;
+    trigger_ext_valid = TRUE;
   }
 }
 
@@ -52,6 +52,6 @@
 #else
 #error "trig_ext_hw.h: Unknown PULSE_TYPE"
 #endif
-  trig_ext_valid = FALSE;
+  trigger_ext_valid = FALSE;
 }
 

Added: paparazzi3/trunk/sw/airborne/arch/sim/modules/core/trigger_ext_hw.c
===================================================================
--- paparazzi3/trunk/sw/airborne/arch/sim/modules/core/trigger_ext_hw.c         
                (rev 0)
+++ paparazzi3/trunk/sw/airborne/arch/sim/modules/core/trigger_ext_hw.c 
2010-10-25 15:34:39 UTC (rev 6235)
@@ -0,0 +1,32 @@
+/*
+ * $Id$
+ *  
+ * Copyright (C) 2010 Martin Mueller
+ *
+ * This file is part of paparazzi.
+ *
+ * paparazzi is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * paparazzi is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * 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. 
+ *
+ */
+
+
+#include "core/trigger_ext_hw.h"
+#include "std.h"
+
+void trigger_ext_init ( void ) {
+  trigger_ext_valid = FALSE;
+}
+

Added: paparazzi3/trunk/sw/airborne/arch/sim/modules/core/trigger_ext_hw.h
===================================================================
--- paparazzi3/trunk/sw/airborne/arch/sim/modules/core/trigger_ext_hw.h         
                (rev 0)
+++ paparazzi3/trunk/sw/airborne/arch/sim/modules/core/trigger_ext_hw.h 
2010-10-25 15:34:39 UTC (rev 6235)
@@ -0,0 +1,31 @@
+/*
+ * $Id$
+ *  
+ * Copyright (C) 2010 Martin Mueller
+ *
+ * This file is part of paparazzi.
+ *
+ * paparazzi is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * paparazzi is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * 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. 
+ *
+ */
+
+#ifndef TRIGGER_EXT_HW_H
+#define TRIGGER_EXT_HW_H
+
+#include "core/trigger_ext.h"
+
+#endif /* TRIGGER_EXT_HW_H */
+

Modified: paparazzi3/trunk/sw/airborne/modules/core/trigger_ext.c
===================================================================
--- paparazzi3/trunk/sw/airborne/modules/core/trigger_ext.c     2010-10-25 
15:21:46 UTC (rev 6234)
+++ paparazzi3/trunk/sw/airborne/modules/core/trigger_ext.c     2010-10-25 
15:34:39 UTC (rev 6235)
@@ -32,6 +32,6 @@
 #include "core/trigger_ext.h"
 
 uint32_t trigger_t0;
-uint32_t delta_t0;
-volatile bool_t trig_ext_valid;
+uint32_t trigger_delta_t0;
+volatile bool_t trigger_ext_valid;
 

Modified: paparazzi3/trunk/sw/airborne/modules/core/trigger_ext.h
===================================================================
--- paparazzi3/trunk/sw/airborne/modules/core/trigger_ext.h     2010-10-25 
15:21:46 UTC (rev 6234)
+++ paparazzi3/trunk/sw/airborne/modules/core/trigger_ext.h     2010-10-25 
15:34:39 UTC (rev 6235)
@@ -40,8 +40,8 @@
 #define TRIG_EXT_EDGE_FALLING 0
 
 extern uint32_t trigger_t0;
-extern uint32_t delta_t0;
-extern volatile bool_t trig_ext_valid;
+extern uint32_t trigger_delta_t0;
+extern volatile bool_t trigger_ext_valid;
 
 void trigger_ext_init ( void );
 

Copied: paparazzi3/trunk/sw/airborne/modules/meteo/windturbine.c (from rev 
6227, paparazzi3/trunk/sw/airborne/modules/sensors/trigger_ext.c)
===================================================================
--- paparazzi3/trunk/sw/airborne/modules/meteo/windturbine.c                    
        (rev 0)
+++ paparazzi3/trunk/sw/airborne/modules/meteo/windturbine.c    2010-10-25 
15:34:39 UTC (rev 6235)
@@ -0,0 +1,63 @@
+/*
+ * $Id$
+ *  
+ * Copyright (C) 2010 Martin Mueller
+ *
+ * This file is part of paparazzi.
+ *
+ * paparazzi is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * paparazzi is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * 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. 
+ *
+ */
+
+/** \file windturbine.c
+ *
+ *   This measures a trigger pulse length (e.g. duration of a wind turbine
+ *   rotation) and sends a message with the info.
+ */
+
+
+#include "meteo/windturbine.h"
+#include "core/trigger_ext.h"
+#include "gps.h"
+#include "sys_time.h"
+
+#ifndef DOWNLINK_DEVICE
+#define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE
+#endif
+
+#include "uart.h"
+#include "messages.h"
+#include "downlink.h"
+
+
+void windturbine_periodic( void ) {
+  if (trigger_ext_valid == TRUE) {
+    uint8_t ac_id = 0;
+    uint8_t turb_id = TURBINE_ID;
+    uint32_t sync_itow, cycle_time;
+
+    sync_itow = itow_from_ticks(trigger_t0);
+    cycle_time = MSEC_OF_SYS_TICS(trigger_delta_t0);
+
+    DOWNLINK_SEND_WINDTURBINE_STATUS_(DefaultChannel,
+                &ac_id,
+                &turb_id,
+                &sync_itow,
+                &cycle_time );
+    trigger_ext_valid = FALSE;
+  }
+}
+

Copied: paparazzi3/trunk/sw/airborne/modules/meteo/windturbine.h (from rev 
6227, paparazzi3/trunk/sw/airborne/modules/sensors/trigger_ext.h)
===================================================================
--- paparazzi3/trunk/sw/airborne/modules/meteo/windturbine.h                    
        (rev 0)
+++ paparazzi3/trunk/sw/airborne/modules/meteo/windturbine.h    2010-10-25 
15:34:39 UTC (rev 6235)
@@ -0,0 +1,40 @@
+/*
+ * $Id$
+ *  
+ * Copyright (C) 2010 Martin Mueller
+ *
+ * This file is part of paparazzi.
+ *
+ * paparazzi is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * paparazzi is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * 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. 
+ *
+ */
+
+/** \file windturbine.h
+ *
+ *   This measures a trigger pulse length (e.g. duration of a wind turbine
+ *   rotation) and sends a message with the info.
+ *
+ *   Module trigger_ext needs to be loaded
+ */
+
+#ifndef WINDTURBINE_H
+#define WINDTURBINE_H
+
+void windturbine_periodic( void );
+
+#endif
+
+




reply via email to

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