From 0a28bb33b68cae4ba9cf168ba47583cb1ff851bf Mon Sep 17 00:00:00 2001 From: Christophe De Wagter Date: Thu, 20 Oct 2016 11:39:19 +0200 Subject: [PATCH] [uart_drop] rename for uniformity: module name='switch' type='uart' --- conf/modules/auto1_commands.xml | 2 +- conf/modules/servo_switch.xml | 4 +-- conf/modules/switch_uart.xml | 33 +++++++++++++++++++ .../auto1_commands.c | 0 .../auto1_commands.h | 0 .../servo_switch.c | 2 +- .../servo_switch.h | 0 .../uart_drop.c => switching/switch_uart.c} | 11 +++++-- .../uart_drop.h => switching/switch_uart.h} | 10 ++++-- 9 files changed, 52 insertions(+), 10 deletions(-) create mode 100644 conf/modules/switch_uart.xml rename sw/airborne/modules/{servo_switch => switching}/auto1_commands.c (100%) rename sw/airborne/modules/{servo_switch => switching}/auto1_commands.h (100%) rename sw/airborne/modules/{servo_switch => switching}/servo_switch.c (97%) rename sw/airborne/modules/{servo_switch => switching}/servo_switch.h (100%) rename sw/airborne/modules/{com/uart_drop.c => switching/switch_uart.c} (84%) rename sw/airborne/modules/{com/uart_drop.h => switching/switch_uart.h} (79%) diff --git a/conf/modules/auto1_commands.xml b/conf/modules/auto1_commands.xml index 85e4ace56f6..bfd8b510e88 100644 --- a/conf/modules/auto1_commands.xml +++ b/conf/modules/auto1_commands.xml @@ -1,6 +1,6 @@ - + AUTO1 FLAPS/HATCH COMMANDS. Enable RC controlled HATCH and BRAKE/FLAPS in both MANUAL and AUTO1, while automatic in AUTO2. diff --git a/conf/modules/servo_switch.xml b/conf/modules/servo_switch.xml index 08e3831d04e..4d037318c1f 100644 --- a/conf/modules/servo_switch.xml +++ b/conf/modules/servo_switch.xml @@ -1,6 +1,6 @@ - + Servo switch @@ -10,7 +10,7 @@ - + diff --git a/conf/modules/switch_uart.xml b/conf/modules/switch_uart.xml new file mode 100644 index 00000000000..f7863fa3982 --- /dev/null +++ b/conf/modules/switch_uart.xml @@ -0,0 +1,33 @@ + + + + + Active swithes via UART commands. + Module typically used in competitions to drop items like paint-balls. An arduino is a typical target. + + + + + + + + + + + + + + +
+ +
+ + + + + + + + +
+ diff --git a/sw/airborne/modules/servo_switch/auto1_commands.c b/sw/airborne/modules/switching/auto1_commands.c similarity index 100% rename from sw/airborne/modules/servo_switch/auto1_commands.c rename to sw/airborne/modules/switching/auto1_commands.c diff --git a/sw/airborne/modules/servo_switch/auto1_commands.h b/sw/airborne/modules/switching/auto1_commands.h similarity index 100% rename from sw/airborne/modules/servo_switch/auto1_commands.h rename to sw/airborne/modules/switching/auto1_commands.h diff --git a/sw/airborne/modules/servo_switch/servo_switch.c b/sw/airborne/modules/switching/servo_switch.c similarity index 97% rename from sw/airborne/modules/servo_switch/servo_switch.c rename to sw/airborne/modules/switching/servo_switch.c index aa13e080b2c..9946d15811c 100644 --- a/sw/airborne/modules/servo_switch/servo_switch.c +++ b/sw/airborne/modules/switching/servo_switch.c @@ -19,7 +19,7 @@ * Boston, MA 02111-1307, USA. */ -#include "servo_switch/servo_switch.h" +#include "switching/servo_switch.h" #include "generated/airframe.h" #include "subsystems/actuators.h" diff --git a/sw/airborne/modules/servo_switch/servo_switch.h b/sw/airborne/modules/switching/servo_switch.h similarity index 100% rename from sw/airborne/modules/servo_switch/servo_switch.h rename to sw/airborne/modules/switching/servo_switch.h diff --git a/sw/airborne/modules/com/uart_drop.c b/sw/airborne/modules/switching/switch_uart.c similarity index 84% rename from sw/airborne/modules/com/uart_drop.c rename to sw/airborne/modules/switching/switch_uart.c index 90c91a30257..24708d60021 100644 --- a/sw/airborne/modules/com/uart_drop.c +++ b/sw/airborne/modules/switching/switch_uart.c @@ -23,17 +23,22 @@ * Module for dropping balls using UART */ -#include "modules/com/uart_drop.h" +#include "modules/switching/switch_uart.h" #include "mcu_periph/uart.h" +uint8_t switch_uart_channel = 0; + static uint8_t drop_string[] = ". */ /** - * @file "modules/com/uart_drop.h" + * @file "modules/switching/switch_uart.h" * @author Freek van Tienen * Module for dropping balls using UART */ +#ifndef SWITCH_UART_H +#define SWITCH_UART_H + #include "std.h" -#ifndef UART_DROP_H -#define UART_DROP_H +#define switch_uart_SwitchUartChannel(X) ({switch_uart_channel=X;drop_ball(switch_uart_channel); false;}) + +extern uint8_t switch_uart_channel; extern void drop_ball(uint8_t number);