Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
spektrum_arch.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2010-2012 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, write to
18  * the Free Software Foundation, 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  */
21 
31 #include "modules/core/abi.h"
32 #include "std.h"
33 #include <inttypes.h>
34 
35 #include "nps_radio_control.h"
36 
37 static bool spektrum_available;
38 
39 void spektrum_init(void)
40 {
41  spektrum_available = false;
42 }
43 
44 void spektrum_event(void)
45 {
46  if (spektrum_available) {
50  AbiSendMsgRADIO_CONTROL(RADIO_CONTROL_SPEKTRUM_ID, &radio_control);
51  }
52  spektrum_available = false;
53 }
54 
55 void spektrum_try_bind(void) {}
56 
57 #ifdef RADIO_CONTROL
59 {
65  spektrum_available = true;
66 }
67 #else //RADIO_CONTROL
68 void radio_control_feed(void) {}
69 #endif //RADIO_CONTROL
70 
Main include for ABI (AirBorneInterface).
#define RADIO_CONTROL_SPEKTRUM_ID
struct NpsRadioControl nps_radio_control
#define MAX_PPRZ
Definition: paparazzi.h:8
struct RadioControl radio_control
Definition: radio_control.c:33
Generic interface for radio control modules.
uint8_t time_since_last_frame
Definition: radio_control.h:62
pprz_t values[RADIO_CONTROL_NB_CHANNEL]
Definition: radio_control.h:67
uint8_t status
Definition: radio_control.h:61
uint8_t frame_cpt
Definition: radio_control.h:65
#define RC_OK
Definition: radio_control.h:49
Radio control spektrum interface.
void spektrum_event(void)
Definition: spektrum_arch.c:44
void radio_control_feed(void)
Definition: spektrum_arch.c:58
static bool spektrum_available
Definition: spektrum_arch.c:37
void spektrum_init(void)
Definition: spektrum_arch.c:39
void spektrum_try_bind(void)
Definition: spektrum_arch.c:55