mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-04 13:55:40 +08:00
@@ -1,30 +0,0 @@
|
||||
|
||||
#include "subsystems/sensors/baro.h"
|
||||
#include "baro_board.h"
|
||||
|
||||
struct Baro baro;
|
||||
|
||||
void baro_init(void) {
|
||||
baro_ms5611_init();
|
||||
}
|
||||
|
||||
void baro_periodic(void) {
|
||||
static uint8_t cnt;
|
||||
switch(cnt) {
|
||||
case 0:
|
||||
baro_ms5611_periodic();
|
||||
cnt++;
|
||||
break;
|
||||
case 1:
|
||||
baro_ms5611_d1();
|
||||
cnt++;
|
||||
break;
|
||||
case 2:
|
||||
baro_ms5611_d2();
|
||||
cnt = 0;
|
||||
break;
|
||||
default:
|
||||
cnt = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1,30 +1,14 @@
|
||||
|
||||
/*
|
||||
* board specific fonctions for the KroozSD board
|
||||
* board specific interface for the KroozSD board
|
||||
*
|
||||
* It uses the subsystems/sensors/baro_ms5611_i2c.c driver
|
||||
*/
|
||||
|
||||
#ifndef BOARDS_KROOZ_BARO_H
|
||||
#define BOARDS_KROOZ_BARO_H
|
||||
|
||||
#include "std.h"
|
||||
#include "mcu_periph/i2c.h"
|
||||
#include "modules/sensors/baro_ms5611_i2c.h"
|
||||
#include "math/pprz_algebra_int.h"
|
||||
|
||||
//#include "led.h"
|
||||
|
||||
static inline void baro_event(void (*b_abs_handler)(void), void (*b_diff_handler)(void))
|
||||
{
|
||||
baro_ms5611_event();
|
||||
if(baro_ms5611_valid) {
|
||||
baro.status = BS_RUNNING;
|
||||
baro.absolute = (int32_t)baroms;
|
||||
b_abs_handler();
|
||||
baro_ms5611_valid = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
#define BaroEvent(_b_abs_handler, _b_diff_handler) baro_event(_b_abs_handler,_b_diff_handler)
|
||||
extern void baro_event(void (*b_abs_handler)(void));
|
||||
#define BaroEvent(_b_abs_handler, _b_diff_handler) baro_event(_b_abs_handler)
|
||||
|
||||
#endif /* BOARDS_KROOZ_SD_BARO_H */
|
||||
|
||||
Reference in New Issue
Block a user