paparazzi-commits
[Top][All Lists]
Advanced

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

[paparazzi-commits] [5321] added very simple servo switch module for fix


From: Felix Ruess
Subject: [paparazzi-commits] [5321] added very simple servo switch module for fixed wings
Date: Wed, 11 Aug 2010 23:00:01 +0000

Revision: 5321
          http://svn.sv.gnu.org/viewvc/?view=rev&root=paparazzi&revision=5321
Author:   flixr
Date:     2010-08-11 23:00:01 +0000 (Wed, 11 Aug 2010)
Log Message:
-----------
added very simple servo switch module for fixed wings

Modified Paths:
--------------
    paparazzi3/trunk/conf/airframes/mentor_tum.xml

Added Paths:
-----------
    paparazzi3/trunk/conf/modules/servo_switch.xml
    paparazzi3/trunk/conf/settings/settings_servo_switch.xml
    paparazzi3/trunk/sw/airborne/modules/servo_switch/
    paparazzi3/trunk/sw/airborne/modules/servo_switch/servo_switch.c
    paparazzi3/trunk/sw/airborne/modules/servo_switch/servo_switch.h

Modified: paparazzi3/trunk/conf/airframes/mentor_tum.xml
===================================================================
--- paparazzi3/trunk/conf/airframes/mentor_tum.xml      2010-08-11 22:43:20 UTC 
(rev 5320)
+++ paparazzi3/trunk/conf/airframes/mentor_tum.xml      2010-08-11 23:00:01 UTC 
(rev 5321)
@@ -10,7 +10,7 @@
 <airframe name="Mentor Twog AkaModell">
 
   <modules main_freq="60">
-    <load name="switch_channel.xml"/>
+    <load name="servo_switch.xml"/>
     <load name="sys_mon.xml"/>
   </modules>
 

Added: paparazzi3/trunk/conf/modules/servo_switch.xml
===================================================================
--- paparazzi3/trunk/conf/modules/servo_switch.xml                              
(rev 0)
+++ paparazzi3/trunk/conf/modules/servo_switch.xml      2010-08-11 23:00:01 UTC 
(rev 5321)
@@ -0,0 +1,15 @@
+<!DOCTYPE module SYSTEM "module.dtd">
+
+<module name="servo_switch">
+  <header>
+    <file name="servo_switch.h"/>
+  </header>
+  <init fun="servo_switch_init()"/>
+  <periodic fun="servo_switch_periodic()" freq="10."/>
+  <makefile>
+    <flag name="SWITCH_ON_VALUE"  value="MIN_PPRZ"/>
+    <flag name="SWITCH_OFF_VALUE" value="MAX_PPRZ"/>
+    <file name="servo_switch.c"/>
+  </makefile>
+</module>
+

Added: paparazzi3/trunk/conf/settings/settings_servo_switch.xml
===================================================================
--- paparazzi3/trunk/conf/settings/settings_servo_switch.xml                    
        (rev 0)
+++ paparazzi3/trunk/conf/settings/settings_servo_switch.xml    2010-08-11 
23:00:01 UTC (rev 5321)
@@ -0,0 +1,12 @@
+<!DOCTYPE settings SYSTEM "settings.dtd">
+
+<settings>
+  <dl_settings NAME="Servo switch control">
+    <dl_settings NAME="SWITCH">
+      <dl_setting var="servo_switch_on" min="0" step="1" max="1" 
module="servo_switch" values="Off|On">
+        <strip_button name="ON"  value="1"/>
+        <strip_button name="OFF" value="0"/>
+      </dl_setting>
+    </dl_settings>
+  </dl_settings>
+</settings>

Added: paparazzi3/trunk/sw/airborne/modules/servo_switch/servo_switch.c
===================================================================
--- paparazzi3/trunk/sw/airborne/modules/servo_switch/servo_switch.c            
                (rev 0)
+++ paparazzi3/trunk/sw/airborne/modules/servo_switch/servo_switch.c    
2010-08-11 23:00:01 UTC (rev 5321)
@@ -0,0 +1,40 @@
+/*
+ * $Id: $
+ *
+ * Copyright (C) 2010 Flixr
+ *
+ * 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 "servo_switch.h"
+#include "inter_mcu.h"
+
+bool_t servo_switch_on;
+int16_t servo_switch_value;
+
+void servo_switch_init(void) {
+  servo_switch_on = FALSE;
+  servo_switch_periodic();
+}
+
+void servo_switch_periodic(void) {
+  if (servo_switch_on == TRUE)
+    ap_state->commands[COMMAND_SWITCH] = SWITCH_ON_VALUE;
+  else
+    ap_state->commands[COMMAND_SWITCH] = SWITCH_OFF_VALUE;
+}

Added: paparazzi3/trunk/sw/airborne/modules/servo_switch/servo_switch.h
===================================================================
--- paparazzi3/trunk/sw/airborne/modules/servo_switch/servo_switch.h            
                (rev 0)
+++ paparazzi3/trunk/sw/airborne/modules/servo_switch/servo_switch.h    
2010-08-11 23:00:01 UTC (rev 5321)
@@ -0,0 +1,47 @@
+/*
+ * $Id: $
+ *
+ * Copyright (C) 2010 Flixr
+ *
+ * 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 SERVO_SWITCH_H
+#define SERVO_SWITCH_H
+
+#include "std.h"
+#include "paparazzi.h"
+
+extern bool_t servo_switch_on;
+extern int16_t servo_switch_value;
+
+#ifndef SWITCH_ON_VALUE
+#define SWITCH_ON_VALUE MAX_PPRZ
+#endif
+#ifndef SWITCH_OFF_VALUE
+#define SWITCH_OFF_VALUE MIN_PPRZ
+#endif
+
+extern void servo_switch_init(void);
+extern void servo_switch_periodic(void);
+
+#define ServoSwitchOn()  ({ servo_switch_on = TRUE; FALSE; })
+#define ServoSwitchOff() ({ servo_switch_on = FALSE; FALSE; })
+
+#endif //SERVO_SWITCH_H
+




reply via email to

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