Paparazzi UAS  v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
radio_control.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2014 The Paparazzi Team
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, see
18  * <http://www.gnu.org/licenses/>.
19  */
20 
29 
31 
33 {
34  uint8_t i;
35  for (i = 0; i < RADIO_CONTROL_NB_CHANNEL; i++) {
36  radio_control.values[i] = 0;
37  }
44 }
45 
47 {
48  static uint8_t _1Hz;
49  _1Hz++;
50 
51  if (_1Hz >= 60) {
52  _1Hz = 0;
55  }
56 
59  } else {
63  }
65  }
66 
67 #if defined RADIO_CONTROL_LED
68  if (radio_control.status == RC_OK) {
69  LED_ON(RADIO_CONTROL_LED);
70  } else {
71  LED_OFF(RADIO_CONTROL_LED);
72  }
73 #endif
74 
75 }
#define RC_LOST
Definition: radio_control.h:49
void radio_control_impl_init(void)
Definition: spektrum_arch.c:30
uint8_t radio_ok_cpt
Definition: radio_control.h:55
uint8_t status
Definition: radio_control.h:53
#define RC_LOST_TIME
Definition: radio_control.h:43
pprz_t values[RADIO_CONTROL_NB_CHANNEL]
Definition: radio_control.h:58
void radio_control_init(void)
Definition: radio_control.c:32
#define RC_REALLY_LOST_TIME
Definition: radio_control.h:44
void radio_control_periodic_task(void)
Definition: radio_control.c:46
struct RadioControl radio_control
Definition: radio_control.c:30
#define RC_REALLY_LOST
Definition: radio_control.h:50
#define RADIO_CONTROL_NB_CHANNEL
Definition: spektrum_arch.h:34
#define RC_OK
Definition: radio_control.h:48
#define LED_ON(i)
Definition: led_hw.h:42
#define RC_OK_CPT
Definition: radio_control.h:46
unsigned char uint8_t
Definition: types.h:14
uint8_t time_since_last_frame
Definition: radio_control.h:54
#define LED_OFF(i)
Definition: led_hw.h:43
uint8_t frame_cpt
Definition: radio_control.h:57
uint8_t frame_rate
Definition: radio_control.h:56