mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-28 18:07:25 +08:00
[modules] baro modules publish TEMPERATURE via ABI
This commit is contained in:
@@ -99,6 +99,8 @@ void apogee_baro_event(void) {
|
|||||||
if (apogee_baro.data_available && startup_cnt == 0) {
|
if (apogee_baro.data_available && startup_cnt == 0) {
|
||||||
float pressure = ((float)apogee_baro.pressure/(1<<2));
|
float pressure = ((float)apogee_baro.pressure/(1<<2));
|
||||||
AbiSendMsgBARO_ABS(BARO_BOARD_SENDER_ID, &pressure);
|
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;
|
apogee_baro.data_available = FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,6 +96,8 @@ void baro_event(void) {
|
|||||||
if (bb_ms5611.data_available) {
|
if (bb_ms5611.data_available) {
|
||||||
float pressure = (float)bb_ms5611.data.pressure;
|
float pressure = (float)bb_ms5611.data.pressure;
|
||||||
AbiSendMsgBARO_ABS(BARO_BOARD_SENDER_ID, &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;
|
bb_ms5611.data_available = FALSE;
|
||||||
|
|
||||||
#ifdef BARO_LED
|
#ifdef BARO_LED
|
||||||
@@ -103,11 +105,10 @@ void baro_event(void) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
float ftempms = bb_ms5611.data.temperature / 100.;
|
|
||||||
float fbaroms = bb_ms5611.data.pressure / 100.;
|
float fbaroms = bb_ms5611.data.pressure / 100.;
|
||||||
DOWNLINK_SEND_BARO_MS5611(DefaultChannel, DefaultDevice,
|
DOWNLINK_SEND_BARO_MS5611(DefaultChannel, DefaultDevice,
|
||||||
&bb_ms5611.data.d1, &bb_ms5611.data.d2,
|
&bb_ms5611.data.d1, &bb_ms5611.data.d2,
|
||||||
&fbaroms, &ftempms);
|
&fbaroms, &temp);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,6 +85,8 @@ void baro_event(void) {
|
|||||||
if (bb_ms5611.data_available) {
|
if (bb_ms5611.data_available) {
|
||||||
float pressure = (float)bb_ms5611.data.pressure;
|
float pressure = (float)bb_ms5611.data.pressure;
|
||||||
AbiSendMsgBARO_ABS(BARO_BOARD_SENDER_ID, &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;
|
bb_ms5611.data_available = FALSE;
|
||||||
|
|
||||||
#ifdef BARO_LED
|
#ifdef BARO_LED
|
||||||
@@ -92,11 +94,10 @@ void baro_event(void) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
float ftempms = bb_ms5611.data.temperature / 100.;
|
|
||||||
float fbaroms = bb_ms5611.data.pressure / 100.;
|
float fbaroms = bb_ms5611.data.pressure / 100.;
|
||||||
DOWNLINK_SEND_BARO_MS5611(DefaultChannel, DefaultDevice,
|
DOWNLINK_SEND_BARO_MS5611(DefaultChannel, DefaultDevice,
|
||||||
&bb_ms5611.data.d1, &bb_ms5611.data.d2,
|
&bb_ms5611.data.d1, &bb_ms5611.data.d2,
|
||||||
&fbaroms, &ftempms);
|
&fbaroms, &temp);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,6 +75,8 @@ void baro_event(void)
|
|||||||
if (baro_bmp085.data_available) {
|
if (baro_bmp085.data_available) {
|
||||||
float pressure = (float)baro_bmp085.pressure;
|
float pressure = (float)baro_bmp085.pressure;
|
||||||
AbiSendMsgBARO_ABS(BARO_BOARD_SENDER_ID, &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;
|
baro_bmp085.data_available = FALSE;
|
||||||
#ifdef BARO_LED
|
#ifdef BARO_LED
|
||||||
RunOnceEvery(10,LED_TOGGLE(BARO_LED));
|
RunOnceEvery(10,LED_TOGGLE(BARO_LED));
|
||||||
|
|||||||
@@ -59,6 +59,8 @@ void baro_event(void) {
|
|||||||
if (baro_bmp085.data_available) {
|
if (baro_bmp085.data_available) {
|
||||||
float pressure = (float)baro_bmp085.pressure;
|
float pressure = (float)baro_bmp085.pressure;
|
||||||
AbiSendMsgBARO_ABS(BARO_BOARD_SENDER_ID, &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;
|
baro_bmp085.data_available = FALSE;
|
||||||
#ifdef BARO_LED
|
#ifdef BARO_LED
|
||||||
RunOnceEvery(10,LED_TOGGLE(BARO_LED));
|
RunOnceEvery(10,LED_TOGGLE(BARO_LED));
|
||||||
|
|||||||
@@ -87,6 +87,8 @@ void baro_bmp_event(void) {
|
|||||||
|
|
||||||
float pressure = (float)baro_bmp.pressure;
|
float pressure = (float)baro_bmp.pressure;
|
||||||
AbiSendMsgBARO_ABS(BARO_BMP_SENDER_ID, &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;
|
baro_bmp.data_available = FALSE;
|
||||||
|
|
||||||
#ifdef SENSOR_SYNC_SEND
|
#ifdef SENSOR_SYNC_SEND
|
||||||
|
|||||||
@@ -62,6 +62,8 @@ void baro_mpl3115_read_event( void ) {
|
|||||||
if (baro_mpl.data_available) {
|
if (baro_mpl.data_available) {
|
||||||
float pressure = (float)baro_mpl.pressure/(1<<2);
|
float pressure = (float)baro_mpl.pressure/(1<<2);
|
||||||
AbiSendMsgBARO_ABS(BARO_MPL3115_SENDER_ID, &pressure);
|
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
|
#ifdef SENSOR_SYNC_SEND
|
||||||
DOWNLINK_SEND_MPL3115_BARO(DefaultChannel, DefaultDevice, &baro_mpl.pressure, &baro_mpl.temperature, &baro_mpl.alt);
|
DOWNLINK_SEND_MPL3115_BARO(DefaultChannel, DefaultDevice, &baro_mpl.pressure, &baro_mpl.temperature, &baro_mpl.alt);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -91,17 +91,18 @@ void baro_ms5611_event( void ) {
|
|||||||
if (baro_ms5611.data_available) {
|
if (baro_ms5611.data_available) {
|
||||||
float pressure = (float)baro_ms5611.data.pressure;
|
float pressure = (float)baro_ms5611.data.pressure;
|
||||||
AbiSendMsgBARO_ABS(BARO_MS5611_SENDER_ID, &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.data_available = FALSE;
|
||||||
|
|
||||||
baro_ms5611_alt = pprz_isa_altitude_of_pressure(pressure);
|
baro_ms5611_alt = pprz_isa_altitude_of_pressure(pressure);
|
||||||
baro_ms5611_alt_valid = TRUE;
|
baro_ms5611_alt_valid = TRUE;
|
||||||
|
|
||||||
#ifdef SENSOR_SYNC_SEND
|
#ifdef SENSOR_SYNC_SEND
|
||||||
ftempms = baro_ms5611.data.temperature / 100.;
|
|
||||||
fbaroms = baro_ms5611.data.pressure / 100.;
|
fbaroms = baro_ms5611.data.pressure / 100.;
|
||||||
DOWNLINK_SEND_BARO_MS5611(DefaultChannel, DefaultDevice,
|
DOWNLINK_SEND_BARO_MS5611(DefaultChannel, DefaultDevice,
|
||||||
&baro_ms5611.data.d1, &baro_ms5611.data.d2,
|
&baro_ms5611.data.d1, &baro_ms5611.data.d2,
|
||||||
&fbaroms, &ftempms);
|
&fbaroms, &temp);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,17 +91,18 @@ void baro_ms5611_event( void ) {
|
|||||||
if (baro_ms5611.data_available) {
|
if (baro_ms5611.data_available) {
|
||||||
float pressure = (float)baro_ms5611.data.pressure;
|
float pressure = (float)baro_ms5611.data.pressure;
|
||||||
AbiSendMsgBARO_ABS(BARO_MS5611_SENDER_ID, &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.data_available = FALSE;
|
||||||
|
|
||||||
baro_ms5611_alt = pprz_isa_altitude_of_pressure(pressure);
|
baro_ms5611_alt = pprz_isa_altitude_of_pressure(pressure);
|
||||||
baro_ms5611_alt_valid = TRUE;
|
baro_ms5611_alt_valid = TRUE;
|
||||||
|
|
||||||
#ifdef SENSOR_SYNC_SEND
|
#ifdef SENSOR_SYNC_SEND
|
||||||
ftempms = baro_ms5611.data.temperature / 100.;
|
|
||||||
fbaroms = baro_ms5611.data.pressure / 100.;
|
fbaroms = baro_ms5611.data.pressure / 100.;
|
||||||
DOWNLINK_SEND_BARO_MS5611(DefaultChannel, DefaultDevice,
|
DOWNLINK_SEND_BARO_MS5611(DefaultChannel, DefaultDevice,
|
||||||
&baro_ms5611.data.d1, &baro_ms5611.data.d2,
|
&baro_ms5611.data.d1, &baro_ms5611.data.d2,
|
||||||
&fbaroms, &ftempms);
|
&fbaroms, &temp);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user