[modules] baro modules publish TEMPERATURE via ABI

This commit is contained in:
Felix Ruess
2014-10-12 17:30:58 +02:00
parent f6827405be
commit 2d26cdbd2d
9 changed files with 22 additions and 8 deletions
+2
View File
@@ -99,6 +99,8 @@ void apogee_baro_event(void) {
if (apogee_baro.data_available && startup_cnt == 0) {
float pressure = ((float)apogee_baro.pressure/(1<<2));
AbiSendMsgBARO_ABS(BARO_BOARD_SENDER_ID, &pressure);
float temp = apogee_baro.temperature / 16.0f;
AbiSendMsgTEMPERATURE(BARO_BOARD_SENDER_ID, &temp);
apogee_baro.data_available = FALSE;
}
}
+3 -2
View File
@@ -96,6 +96,8 @@ void baro_event(void) {
if (bb_ms5611.data_available) {
float pressure = (float)bb_ms5611.data.pressure;
AbiSendMsgBARO_ABS(BARO_BOARD_SENDER_ID, &pressure);
float temp = bb_ms5611.data.temperature / 100.0f;
AbiSendMsgTEMPERATURE(BARO_BOARD_SENDER_ID, &temp);
bb_ms5611.data_available = FALSE;
#ifdef BARO_LED
@@ -103,11 +105,10 @@ void baro_event(void) {
#endif
#if DEBUG
float ftempms = bb_ms5611.data.temperature / 100.;
float fbaroms = bb_ms5611.data.pressure / 100.;
DOWNLINK_SEND_BARO_MS5611(DefaultChannel, DefaultDevice,
&bb_ms5611.data.d1, &bb_ms5611.data.d2,
&fbaroms, &ftempms);
&fbaroms, &temp);
#endif
}
}
+3 -2
View File
@@ -85,6 +85,8 @@ void baro_event(void) {
if (bb_ms5611.data_available) {
float pressure = (float)bb_ms5611.data.pressure;
AbiSendMsgBARO_ABS(BARO_BOARD_SENDER_ID, &pressure);
float temp = bb_ms5611.data.temperature / 100.0f;
AbiSendMsgTEMPERATURE(BARO_BOARD_SENDER_ID, &temp);
bb_ms5611.data_available = FALSE;
#ifdef BARO_LED
@@ -92,11 +94,10 @@ void baro_event(void) {
#endif
#if DEBUG
float ftempms = bb_ms5611.data.temperature / 100.;
float fbaroms = bb_ms5611.data.pressure / 100.;
DOWNLINK_SEND_BARO_MS5611(DefaultChannel, DefaultDevice,
&bb_ms5611.data.d1, &bb_ms5611.data.d2,
&fbaroms, &ftempms);
&fbaroms, &temp);
#endif
}
}
+2
View File
@@ -75,6 +75,8 @@ void baro_event(void)
if (baro_bmp085.data_available) {
float pressure = (float)baro_bmp085.pressure;
AbiSendMsgBARO_ABS(BARO_BOARD_SENDER_ID, &pressure);
float temp = baro_bmp085.temperature / 10.0f;
AbiSendMsgTEMPERATURE(BARO_BOARD_SENDER_ID, &temp);
baro_bmp085.data_available = FALSE;
#ifdef BARO_LED
RunOnceEvery(10,LED_TOGGLE(BARO_LED));
+2
View File
@@ -59,6 +59,8 @@ void baro_event(void) {
if (baro_bmp085.data_available) {
float pressure = (float)baro_bmp085.pressure;
AbiSendMsgBARO_ABS(BARO_BOARD_SENDER_ID, &pressure);
float temp = baro_bmp085.temperature / 10.0f;
AbiSendMsgTEMPERATURE(BARO_BOARD_SENDER_ID, &temp);
baro_bmp085.data_available = FALSE;
#ifdef BARO_LED
RunOnceEvery(10,LED_TOGGLE(BARO_LED));
+2
View File
@@ -87,6 +87,8 @@ void baro_bmp_event(void) {
float pressure = (float)baro_bmp.pressure;
AbiSendMsgBARO_ABS(BARO_BMP_SENDER_ID, &pressure);
float temp = baro_bmp.temperature / 10.0f;
AbiSendMsgTEMPERATURE(BARO_BOARD_SENDER_ID, &temp);
baro_bmp.data_available = FALSE;
#ifdef SENSOR_SYNC_SEND
@@ -62,6 +62,8 @@ void baro_mpl3115_read_event( void ) {
if (baro_mpl.data_available) {
float pressure = (float)baro_mpl.pressure/(1<<2);
AbiSendMsgBARO_ABS(BARO_MPL3115_SENDER_ID, &pressure);
float temp = (float)baro_mpl.pressure / 16.0f;
AbiSendMsgTEMPERATURE(BARO_MPL3115_SENDER_ID, &temp);
#ifdef SENSOR_SYNC_SEND
DOWNLINK_SEND_MPL3115_BARO(DefaultChannel, DefaultDevice, &baro_mpl.pressure, &baro_mpl.temperature, &baro_mpl.alt);
#endif
@@ -91,17 +91,18 @@ void baro_ms5611_event( void ) {
if (baro_ms5611.data_available) {
float pressure = (float)baro_ms5611.data.pressure;
AbiSendMsgBARO_ABS(BARO_MS5611_SENDER_ID, &pressure);
float temp = baro_ms5611.data.temperature / 100.0f;
AbiSendMsgTEMPERATURE(BARO_MS5611_SENDER_ID, &temp);
baro_ms5611.data_available = FALSE;
baro_ms5611_alt = pprz_isa_altitude_of_pressure(pressure);
baro_ms5611_alt_valid = TRUE;
#ifdef SENSOR_SYNC_SEND
ftempms = baro_ms5611.data.temperature / 100.;
fbaroms = baro_ms5611.data.pressure / 100.;
DOWNLINK_SEND_BARO_MS5611(DefaultChannel, DefaultDevice,
&baro_ms5611.data.d1, &baro_ms5611.data.d2,
&fbaroms, &ftempms);
&fbaroms, &temp);
#endif
}
}
@@ -91,17 +91,18 @@ void baro_ms5611_event( void ) {
if (baro_ms5611.data_available) {
float pressure = (float)baro_ms5611.data.pressure;
AbiSendMsgBARO_ABS(BARO_MS5611_SENDER_ID, &pressure);
float temp = baro_ms5611.data.temperature / 100.0f;
AbiSendMsgTEMPERATURE(BARO_MS5611_SENDER_ID, &temp);
baro_ms5611.data_available = FALSE;
baro_ms5611_alt = pprz_isa_altitude_of_pressure(pressure);
baro_ms5611_alt_valid = TRUE;
#ifdef SENSOR_SYNC_SEND
ftempms = baro_ms5611.data.temperature / 100.;
fbaroms = baro_ms5611.data.pressure / 100.;
DOWNLINK_SEND_BARO_MS5611(DefaultChannel, DefaultDevice,
&baro_ms5611.data.d1, &baro_ms5611.data.d2,
&fbaroms, &ftempms);
&fbaroms, &temp);
#endif
}
}