Paparazzi UAS  v5.12_stable-4-g9b43e9b
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
auto1_commands.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 OpenUAS
3  *
4  * This file is part of paparazzi.
5  *
6  * paparazzi is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * paparazzi is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with paparazzi; see the file COPYING. If not, write to
18  * the Free Software Foundation, 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  *
21  */
22 
23 #include "auto1_commands.h"
24 #include "generated/airframe.h"
25 #include "autopilot.h"
26 #include "inter_mcu.h"
27 
29 {
30  // Copy Radio commands in AUTO1
32 #ifdef COMMAND_GEAR
33 #ifndef RADIO_GEAR
34 #error auto1_commands COMMAND_GEAR needs RADIO_GEAR channel
35 #endif
36  imcu_set_command(COMMAND_GEAR, imcu_get_radio(RADIO_GEAR));
37 #endif
38 #ifdef COMMAND_FLAP
39 #ifndef RADIO_FLAP
40 #error auto1_commands COMMAND_FLAP needs RADIO_FLAP channel
41 #endif
42  imcu_set_command(COMMAND_FLAP, imcu_get_radio(RADIO_FLAP));
43 #endif
44 #ifdef COMMAND_AUX1
45 #ifndef RADIO_AUX1
46 #error auto1_commands COMMAND_AUX1 needs RADIO_AUX1 channel
47 #endif
48  imcu_set_command(COMMAND_AUX1, imcu_get_radio(RADIO_AUX1));
49 #endif
50 #ifdef COMMAND_AUX2
51 #ifndef RADIO_AUX2
52 #error auto1_commands COMMAND_AUX2 needs RADIO_AUX2 channel
53 #endif
54  imcu_set_command(COMMAND_AUX2, imcu_get_radio(RADIO_AUX2));
55 #endif
56 #ifdef COMMAND_AUX3
57 #ifndef RADIO_AUX3
58 #error auto1_commands COMMAND_AUX1 needs RADIO_AUX3 channel
59 #endif
60  imcu_set_command(COMMAND_AUX3, imcu_get_radio(RADIO_AUX3));
61 #endif
62 #ifdef COMMAND_AUX4
63 #ifndef RADIO_AUX4
64 #error auto1_commands COMMAND_AUX4 needs RADIO_AUX4 channel
65 #endif
66  imcu_set_command(COMMAND_AUX4, imcu_get_radio(RADIO_AUX4));
67 #endif
68 #ifdef COMMAND_AUX5
69 #ifndef RADIO_AUX5
70 #error auto1_commands COMMAND_AUX5 needs RADIO_AUX5 channel
71 #endif
72  imcu_set_command(COMMAND_AUX5, imcu_get_radio(RADIO_AUX5));
73 #endif
74 #ifdef COMMAND_AUX6
75 #ifndef RADIO_AUX6
76 #error auto1_commands COMMAND_AUX6 needs RADIO_AUX6 channel
77 #endif
78  imcu_set_command(COMMAND_AUX6, imcu_get_radio(RADIO_AUX6));
79 #endif
80 #ifdef COMMAND_AUX7
81 #ifndef RADIO_AUX7
82 #error auto1_commands COMMAND_AUX7 needs RADIO_AUX7 channel
83 #endif
84  imcu_set_command(COMMAND_AUX7, imcu_get_radio(RADIO_AUX7));
85 #endif
86 #ifdef COMMAND_BRAKE
87 #ifndef RADIO_BRAKE
88 #error auto1_commands COMMAND_BRAKE needs RADIO_BRAKE channel
89 #endif
90  imcu_set_command(COMMAND_BRAKE, imcu_get_radio(RADIO_BRAKE));
91 #endif
92 #ifdef COMMAND_HATCH
93 #ifndef RADIO_HATCH
94 #error auto1_commands COMMAND_HATCH needs RADIO_HATCH channel
95 #endif
96  imcu_set_command(COMMAND_HATCH, imcu_get_radio(RADIO_HATCH));
97 #endif
98  }
99 }
#define RADIO_AUX3
Definition: spektrum_arch.h:50
Enable AUTO1 commands flaps and hatch from RC.
#define AP_MODE_AUTO1
Communication between fbw and ap processes.
#define RADIO_AUX7
Definition: spektrum_arch.h:54
void periodic_auto1_commands(void)
#define RADIO_AUX2
Definition: spektrum_arch.h:49
#define RADIO_AUX1
Definition: spektrum_arch.h:48
#define RADIO_GEAR
Definition: spektrum_arch.h:46
#define RADIO_AUX5
Definition: spektrum_arch.h:52
#define RADIO_AUX6
Definition: spektrum_arch.h:53
#define RADIO_AUX4
Definition: spektrum_arch.h:51
Core autopilot interface common to all firmwares.
#define RADIO_FLAP
Definition: spektrum_arch.h:47
uint8_t autopilot_get_mode(void)
get autopilot mode
Definition: autopilot.c:179