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
sim_enose.c
Go to the documentation of this file.
1 #include "enose/enose.h"
2 
7 
8 uint16_t nominal_val[ENOSE_NB_SENSOR] = {1500, 1500, 4000};
9 uint16_t min_val[ENOSE_NB_SENSOR] = {1100, 1200, 2500};
10 
11 void enose_init(void)
12 {
13  int i;
14  for (i = 0; i < ENOSE_NB_SENSOR; i++) {
15  enose_val[i] = nominal_val[i];
16  }
17 }
18 void enose_set_heat(uint8_t no_sensor, uint8_t value) { }
19 void enose_periodic(void)
20 {
21  int i;
22  for (i = 0; i < ENOSE_NB_SENSOR; i++) {
23  if (enose_val[i] < min_val[i]) {
24  enose_val[i] = min_val[i];
25  }
26  int d = nominal_val[i] - enose_val[i];
27  enose_val[i] += d / 10.;
28  }
29 }
unsigned short uint16_t
Definition: types.h:16
uint16_t min_val[ENOSE_NB_SENSOR]
Definition: sim_enose.c:9
uint16_t value
Definition: adc_arch.c:586
uint8_t enose_status
Definition: sim_enose.c:3
void enose_set_heat(uint8_t no_sensor, uint8_t value)
Definition: sim_enose.c:18
uint16_t enose_val[ENOSE_NB_SENSOR]
Definition: sim_enose.c:5
void enose_periodic(void)
Definition: sim_enose.c:19
void enose_init(void)
Definition: sim_enose.c:11
unsigned char uint8_t
Definition: types.h:14
#define ENOSE_NB_SENSOR
Definition: enose.h:6
uint16_t enose_PID_val
Definition: sim_enose.c:6
uint8_t enose_heat[ENOSE_NB_SENSOR]
Definition: sim_enose.c:4
uint16_t nominal_val[ENOSE_NB_SENSOR]
Definition: sim_enose.c:8