36 #include <linux/input.h>
46 static void *
baro_read(
void *data __attribute__((unused)))
48 struct input_event ev;
51 int fd_sonar = open(
"/dev/input/baro_event", O_RDONLY);
53 printf(
"Unable to open baro event to read pressure\n");
59 n = read(fd_sonar, &ev,
sizeof(ev));
60 if (n ==
sizeof(ev) && ev.type == EV_ABS && ev.code == ABS_PRESSURE) {
80 pthread_t baro_thread;
81 if (pthread_create(&baro_thread, NULL,
baro_read, NULL) != 0) {
82 printf(
"[swing_board] Could not create baro reading thread!\n");
84 pthread_setname_np(baro_thread,
"pprz_baro_thread");
Common barometric sensor implementation.
Main include for ABI (AirBorneInterface).
static bool baro_swing_available
static void * baro_read(void *data)
Check baro thread TODO something better ?
#define BARO_BOARD_SENDER_ID
default onboard baro
static int32_t baro_swing_raw
static pthread_mutex_t baro_swing_mutex
Paparazzi Swing Baro Sensor implementation.