Merge branch 'baro_peripherals'

closes #515
This commit is contained in:
Felix Ruess
2013-08-28 16:19:18 +02:00
30 changed files with 1729 additions and 1197 deletions
-30
View File
@@ -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;
}
}
+4 -20
View File
@@ -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 */