Paparazzi UAS
v5.10_stable-5-g83a0da5-dirty
Paparazzi is a free software Unmanned Aircraft System.
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
Pages
chemo_detect.c
Go to the documentation of this file.
1
#include "
chemo_detect.h
"
2
#include "
enose.h
"
3
4
#define DETECT_PERIOD 8
/* *4Hz */
5
#define THRESHOLD 150
6
7
uint16_t
chemo_sensor
;
8
9
void
chemo_init
(
void
)
10
{
11
chemo_sensor
= 0;
12
}
13
14
void
chemo_periodic
(
void
)
15
{
16
#ifdef ENOSE
17
static
uint16_t
vals[
ENOSE_NB_SENSOR
][
DETECT_PERIOD
];
18
static
int
idx
;
19
20
/* Detection on the first sensor */
21
int
dval =
enose_val
[0] - vals[0][
idx
];
22
if
(dval < -
THRESHOLD
) {
23
chemo_sensor
= -dval;
24
}
else
{
25
chemo_sensor
= 0;
26
}
27
28
int
i;
29
for
(i = 0; i <
ENOSE_NB_SENSOR
; i++) {
30
vals[i][
idx
] =
enose_val
[i];
31
}
32
33
idx++;
34
if
(idx >
DETECT_PERIOD
) {
35
idx = 0;
36
}
37
#endif
/* ENOSE */
38
}
THRESHOLD
#define THRESHOLD
Definition:
chemo_detect.c:5
uint16_t
unsigned short uint16_t
Definition:
types.h:16
idx
static uint32_t idx
Definition:
nps_radio_control_spektrum.c:102
DETECT_PERIOD
#define DETECT_PERIOD
Definition:
chemo_detect.c:4
enose_val
uint16_t enose_val[ENOSE_NB_SENSOR]
Definition:
sim_enose.c:5
enose.h
chemo_periodic
void chemo_periodic(void)
Definition:
chemo_detect.c:14
chemo_sensor
uint16_t chemo_sensor
Definition:
chemo_detect.c:7
chemo_detect.h
chemo_init
void chemo_init(void)
Definition:
chemo_detect.c:9
ENOSE_NB_SENSOR
#define ENOSE_NB_SENSOR
Definition:
enose.h:6
sw
airborne
modules
enose
chemo_detect.c
Generated on Wed Aug 28 2019 16:29:04 for Paparazzi UAS by
1.8.8