mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-04 13:55:40 +08:00
[air_data] use static function for telemetry
This commit is contained in:
@@ -30,7 +30,6 @@
|
|||||||
|
|
||||||
#include "subsystems/air_data.h"
|
#include "subsystems/air_data.h"
|
||||||
#include "subsystems/abi.h"
|
#include "subsystems/abi.h"
|
||||||
#include "subsystems/datalink/telemetry.h"
|
|
||||||
|
|
||||||
/** global AirData state
|
/** global AirData state
|
||||||
*/
|
*/
|
||||||
@@ -47,15 +46,23 @@ static void pressure_abs_cb(uint8_t __attribute__((unused)) sender_id, const flo
|
|||||||
air_data.pressure = *pressure;
|
air_data.pressure = *pressure;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if DOWNLINK
|
||||||
|
#include "subsystems/datalink/telemetry.h"
|
||||||
|
|
||||||
|
static void send_baro_raw(void) {
|
||||||
|
DOWNLINK_SEND_BARO_RAW(DefaultChannel, DefaultDevice,
|
||||||
|
&air_data.pressure, &air_data.differential);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/** AirData initialization. Called at startup.
|
/** AirData initialization. Called at startup.
|
||||||
* Bind ABI messages
|
* Bind ABI messages
|
||||||
*/
|
*/
|
||||||
void air_data_init( void ) {
|
void air_data_init( void ) {
|
||||||
AbiBindMsgBARO_ABS(AIR_DATA_BARO_ABS_ID, &pressure_abs_ev, pressure_abs_cb);
|
AbiBindMsgBARO_ABS(AIR_DATA_BARO_ABS_ID, &pressure_abs_ev, pressure_abs_cb);
|
||||||
|
|
||||||
|
#if DOWNLINK
|
||||||
register_periodic_telemetry(DefaultPeriodic, "BARO_RAW", send_baro_raw);
|
register_periodic_telemetry(DefaultPeriodic, "BARO_RAW", send_baro_raw);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void send_baro_raw(void) {
|
|
||||||
DOWNLINK_SEND_BARO_RAW(DefaultChannel, DefaultDevice,
|
|
||||||
&air_data.pressure, &air_data.differential);
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -52,7 +52,5 @@ extern struct AirData air_data;
|
|||||||
*/
|
*/
|
||||||
extern void air_data_init( void );
|
extern void air_data_init( void );
|
||||||
|
|
||||||
extern void send_baro_raw(void);
|
|
||||||
|
|
||||||
#endif /* AIR_DATA_H */
|
#endif /* AIR_DATA_H */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user