Paparazzi UAS  v4.2.2_stable-4-gcc32f65
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
rc_settings.h
Go to the documentation of this file.
1 /*
2  * Paparazzi $Id$
3  *
4  * Copyright (C) 2006- Pascal Brisset, Antoine Drouin
5  *
6  * This file is part of paparazzi.
7  *
8  * paparazzi is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2, or (at your option)
11  * any later version.
12  *
13  * paparazzi is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with paparazzi; see the file COPYING. If not, write to
20  * the Free Software Foundation, 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  *
23  */
24 
25 
36 #ifndef RC_SETTINGS_H
37 #define RC_SETTINGS_H
38 
39 #if defined RADIO_CALIB && defined RADIO_CONTROL_SETTINGS
40 
41 #include "std.h"
42 #include "generated/radio.h"
43 
44 #define RC_SETTINGS_MODE_NONE 0
45 #define RC_SETTINGS_MODE_DOWN 1
46 #define RC_SETTINGS_MODE_UP 2
47 
55 
56 extern float slider_1_val, slider_2_val;
57 
58 void rc_settings(bool_t mode_changed);
59 
60 #define RcSettingsOff() (rc_settings_mode==RC_SETTINGS_MODE_NONE)
61 
62 #define RC_SETTINGS_MODE_OF_PULSE(pprz) (pprz < THRESHOLD1 ? RC_SETTINGS_MODE_DOWN : \
63  (pprz < THRESHOLD2 ? RC_SETTINGS_MODE_NONE : \
64  RC_SETTINGS_MODE_UP))
65 
66 #define RcSettingsModeUpdate(_rc_channels) \
67  ModeUpdate(rc_settings_mode, RC_SETTINGS_MODE_OF_PULSE(_rc_channels[RADIO_CALIB]))
68 
69 
70 #else /* RADIO_CALIB && defined RADIO_CONTROL_SETTINGS */
71 
72 #define RcSettingsOff() TRUE
73 
74 #endif /* ! (RADIO_CALIB && defined RADIO_CONTROL_SETTINGS) */
75 
76 #endif // RC_SETTINGS_H
uint8_t rc_settings_mode
Definition: rc_settings.c:37
float slider_1_val
Definition: rc_settings.c:38
void rc_settings(bool_t mode_changed __attribute__((unused)))
Includes generated code from tuning_rc.xml.
Definition: rc_settings.c:52
unsigned char uint8_t
Definition: types.h:14
float slider_2_val
Definition: rc_settings.c:38