Paparazzi UAS  v5.0.5_stable-7-g4b8bbb7
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
rc_settings.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006- Pascal Brisset, Antoine Drouin
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 
34 #ifndef RC_SETTINGS_H
35 #define RC_SETTINGS_H
36 
37 #if defined RADIO_CALIB && defined RADIO_CONTROL_SETTINGS
38 
39 #include "std.h"
40 #include "generated/radio.h"
41 
42 #define RC_SETTINGS_MODE_NONE 0
43 #define RC_SETTINGS_MODE_DOWN 1
44 #define RC_SETTINGS_MODE_UP 2
45 
53 
54 extern float slider_1_val, slider_2_val;
55 
56 void rc_settings(bool_t mode_changed);
57 
58 #define RcSettingsOff() (rc_settings_mode==RC_SETTINGS_MODE_NONE)
59 
60 #define RC_SETTINGS_MODE_OF_PULSE(pprz) (pprz < THRESHOLD1 ? RC_SETTINGS_MODE_DOWN : \
61  (pprz < THRESHOLD2 ? RC_SETTINGS_MODE_NONE : \
62  RC_SETTINGS_MODE_UP))
63 
64 #define RcSettingsModeUpdate(_rc_channels) \
65  ModeUpdate(rc_settings_mode, RC_SETTINGS_MODE_OF_PULSE(_rc_channels[RADIO_CALIB]))
66 
67 
68 #else /* RADIO_CALIB && defined RADIO_CONTROL_SETTINGS */
69 
70 #define RcSettingsOff() TRUE
71 
72 #endif /* ! (RADIO_CALIB && defined RADIO_CONTROL_SETTINGS) */
73 
74 #endif // RC_SETTINGS_H
uint8_t rc_settings_mode
Definition: rc_settings.c:34
float slider_1_val
Definition: rc_settings.c:35
unsigned char uint8_t
Definition: types.h:14
float slider_2_val
Definition: rc_settings.c:35
void rc_settings(bool_t mode_changed)
Includes generated code from tuning_rc.xml.
Definition: rc_settings.c:49