Paparazzi UAS  v5.15_devel-109-gee85905
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:57
uint8_t radio_ok_cpt
Definition: radio_control.h:66
uint8_t status
Definition: radio_control.h:64
#define LED_OFF(i)
Definition: led_hw.h:52
#define RC_LOST_TIME
Definition: radio_control.h:46
pprz_t values[RADIO_CONTROL_NB_CHANNEL]
Definition: radio_control.h:69
void radio_control_init(void)
Definition: radio_control.c:32
#define RADIO_CONTROL_NB_CHANNEL
Definition: intermcu_ap.h:49
#define RC_REALLY_LOST_TIME
Definition: radio_control.h:49
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:58
#define RC_OK
Definition: radio_control.h:56
#define RC_OK_CPT
Definition: radio_control.h:53
unsigned char uint8_t
Definition: types.h:14
void radio_control_impl_init(void)
Definition: spektrum_arch.c:42
#define LED_ON(i)
Definition: led_hw.h:51
uint8_t time_since_last_frame
Definition: radio_control.h:65
uint8_t frame_cpt
Definition: radio_control.h:68
uint8_t frame_rate
Definition: radio_control.h:67