mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-26 16:30:07 +08:00
[telemetry] rename 'device' to 'link_device'
This commit is contained in:
@@ -121,7 +121,7 @@ static void navdata_write(const uint8_t *buf, size_t count)
|
||||
#if PERIODIC_TELEMETRY
|
||||
#include "subsystems/datalink/telemetry.h"
|
||||
|
||||
static void send_navdata(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_navdata(struct transport_tx *trans, struct link_device *dev) {
|
||||
pprz_msg_send_ARDRONE_NAVDATA(trans, dev, AC_ID,
|
||||
&navdata.taille,
|
||||
&navdata.nu_trame,
|
||||
@@ -154,7 +154,7 @@ static void send_navdata(struct transport_tx *trans, struct device *dev) {
|
||||
&nav_port.checksum_errors);
|
||||
}
|
||||
|
||||
static void send_filter_status(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_filter_status(struct transport_tx *trans, struct link_device *dev) {
|
||||
uint8_t mde = 3;
|
||||
if (ahrs.status == AHRS_UNINIT) mde = 2;
|
||||
if (imu_lost) mde = 5;
|
||||
|
||||
@@ -56,13 +56,13 @@ bool_t gps_lost;
|
||||
|
||||
bool_t power_switch;
|
||||
|
||||
static void send_alive(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_alive(struct transport_tx *trans, struct link_device *dev) {
|
||||
pprz_msg_send_ALIVE(trans, dev, AC_ID, 16, MD5SUM);
|
||||
}
|
||||
|
||||
#if defined RADIO_CALIB && defined RADIO_CONTROL_SETTINGS
|
||||
#include "rc_settings.h"
|
||||
static void send_rc_settings(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_rc_settings(struct transport_tx *trans, struct link_device *dev) {
|
||||
if (!RcSettingsOff())
|
||||
pprz_msg_send_SETTINGS(trans, dev, AC_ID, &slider_1_val, &slider_2_val);
|
||||
}
|
||||
@@ -70,7 +70,7 @@ static void send_rc_settings(struct transport_tx *trans, struct device *dev) {
|
||||
uint8_t rc_settings_mode = 0;
|
||||
#endif
|
||||
|
||||
static void send_mode(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_mode(struct transport_tx *trans, struct link_device *dev) {
|
||||
pprz_msg_send_PPRZ_MODE(trans, dev, AC_ID,
|
||||
&pprz_mode, &v_ctl_mode, &lateral_mode, &horizontal_mode, &rc_settings_mode, &mcu1_status);
|
||||
}
|
||||
@@ -80,18 +80,18 @@ void autopilot_send_mode(void) {
|
||||
send_mode(&(DefaultChannel).trans_tx, &(DefaultDevice).device);
|
||||
}
|
||||
|
||||
static void send_attitude(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_attitude(struct transport_tx *trans, struct link_device *dev) {
|
||||
struct FloatEulers* att = stateGetNedToBodyEulers_f();
|
||||
pprz_msg_send_ATTITUDE(trans, dev, AC_ID,
|
||||
&(att->phi), &(att->psi), &(att->theta));
|
||||
};
|
||||
|
||||
static void send_estimator(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_estimator(struct transport_tx *trans, struct link_device *dev) {
|
||||
pprz_msg_send_ESTIMATOR(trans, dev, AC_ID,
|
||||
&(stateGetPositionUtm_f()->alt), &(stateGetSpeedEnu_f()->z));
|
||||
}
|
||||
|
||||
static void send_bat(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_bat(struct transport_tx *trans, struct link_device *dev) {
|
||||
int16_t amps = (int16_t) (current/10);
|
||||
int16_t e = energy;
|
||||
pprz_msg_send_BAT(trans, dev, AC_ID,
|
||||
@@ -100,7 +100,7 @@ static void send_bat(struct transport_tx *trans, struct device *dev) {
|
||||
&block_time, &stage_time, &e);
|
||||
}
|
||||
|
||||
static void send_energy(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_energy(struct transport_tx *trans, struct link_device *dev) {
|
||||
uint16_t e = energy;
|
||||
float vsup = ((float)vsupply) / 10.0f;
|
||||
float curs = ((float)current) / 1000.0f;
|
||||
@@ -108,14 +108,14 @@ static void send_energy(struct transport_tx *trans, struct device *dev) {
|
||||
pprz_msg_send_ENERGY(trans, dev, AC_ID, &vsup, &curs, &e, &power);
|
||||
}
|
||||
|
||||
static void send_dl_value(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_dl_value(struct transport_tx *trans, struct link_device *dev) {
|
||||
PeriodicSendDlValue(trans, dev);
|
||||
}
|
||||
|
||||
// FIXME not the best place
|
||||
#include "firmwares/fixedwing/stabilization/stabilization_attitude.h"
|
||||
#include CTRL_TYPE_H
|
||||
static void send_desired(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_desired(struct transport_tx *trans, struct link_device *dev) {
|
||||
#ifndef USE_AIRSPEED
|
||||
float v_ctl_auto_airspeed_setpoint = NOMINAL_AIRSPEED;
|
||||
#endif
|
||||
@@ -125,7 +125,7 @@ static void send_desired(struct transport_tx *trans, struct device *dev) {
|
||||
&v_ctl_auto_airspeed_setpoint);
|
||||
}
|
||||
|
||||
static void send_airspeed(struct transport_tx *trans __attribute__((unused)), struct device *dev __attribute__((unused))) {
|
||||
static void send_airspeed(struct transport_tx *trans __attribute__((unused)), struct link_device *dev __attribute__((unused))) {
|
||||
#ifdef MEASURE_AIRSPEED
|
||||
float* airspeed = stateGetAirspeed_f();
|
||||
pprz_msg_send_AIRSPEED(trans, dev, AC_ID, airspeed, airspeed, airspeed, airspeed);
|
||||
@@ -136,7 +136,7 @@ static void send_airspeed(struct transport_tx *trans __attribute__((unused)), st
|
||||
#endif
|
||||
}
|
||||
|
||||
static void send_downlink(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_downlink(struct transport_tx *trans, struct link_device *dev) {
|
||||
static uint16_t last;
|
||||
uint16_t rate = (downlink.nb_bytes - last) / PERIOD_DOWNLINK_Ap_0;
|
||||
last = downlink.nb_bytes;
|
||||
|
||||
@@ -141,7 +141,7 @@ static inline void on_mag_event( void );
|
||||
volatile uint8_t ahrs_timeout_counter = 0;
|
||||
|
||||
//FIXME not the correct place
|
||||
static void send_filter_status(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_filter_status(struct transport_tx *trans, struct link_device *dev) {
|
||||
uint8_t mde = 3;
|
||||
if (ahrs.status == AHRS_UNINIT) mde = 2;
|
||||
if (ahrs_timeout_counter > 10) mde = 5;
|
||||
|
||||
@@ -76,22 +76,22 @@ tid_t electrical_tid; ///< id for electrical_periodic() timer
|
||||
|
||||
/********** PERIODIC MESSAGES ************************************************/
|
||||
#if PERIODIC_TELEMETRY
|
||||
static void send_commands(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_commands(struct transport_tx *trans, struct link_device *dev) {
|
||||
pprz_msg_send_COMMANDS(trans, dev, AC_ID, COMMANDS_NB, commands);
|
||||
}
|
||||
|
||||
#ifdef RADIO_CONTROL
|
||||
static void send_fbw_status(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_fbw_status(struct transport_tx *trans, struct link_device *dev) {
|
||||
pprz_msg_send_FBW_STATUS(trans, dev, AC_ID,
|
||||
&(radio_control.status), &(radio_control.frame_rate), &fbw_mode, &electrical.vsupply, &electrical.current);
|
||||
}
|
||||
|
||||
static void send_rc(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_rc(struct transport_tx *trans, struct link_device *dev) {
|
||||
pprz_msg_send_RC(trans, dev, AC_ID, RADIO_CONTROL_NB_CHANNEL, radio_control.values);
|
||||
}
|
||||
|
||||
#else
|
||||
static void send_fbw_status(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_fbw_status(struct transport_tx *trans, struct link_device *dev) {
|
||||
uint8_t dummy = 0;
|
||||
pprz_msg_send_FBW_STATUS(trans, dev, AC_ID,
|
||||
&dummy, &dummy, &fbw_mode, &electrical.vsupply, &electrical.current);
|
||||
@@ -99,7 +99,7 @@ static void send_fbw_status(struct transport_tx *trans, struct device *dev) {
|
||||
#endif
|
||||
|
||||
#ifdef ACTUATORS
|
||||
static void send_actuators(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_actuators(struct transport_tx *trans, struct link_device *dev) {
|
||||
pprz_msg_send_ACTUATORS(trans, dev, AC_ID , ACTUATORS_NB, actuators);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -451,16 +451,16 @@ void nav_periodic_task(void) {
|
||||
#if PERIODIC_TELEMETRY
|
||||
#include "subsystems/datalink/telemetry.h"
|
||||
|
||||
static void send_nav_ref(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_nav_ref(struct transport_tx *trans, struct link_device *dev) {
|
||||
pprz_msg_send_NAVIGATION_REF(trans, dev, AC_ID,
|
||||
&nav_utm_east0, &nav_utm_north0, &nav_utm_zone0, &ground_alt);
|
||||
}
|
||||
|
||||
static void send_nav(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_nav(struct transport_tx *trans, struct link_device *dev) {
|
||||
SEND_NAVIGATION(trans, dev);
|
||||
}
|
||||
|
||||
static void send_wp_moved(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_wp_moved(struct transport_tx *trans, struct link_device *dev) {
|
||||
static uint8_t i;
|
||||
i++; if (i >= nb_waypoint) i = 0;
|
||||
DownlinkSendWp(trans, dev, i);
|
||||
@@ -473,21 +473,21 @@ bool_t DownlinkSendWpNr(uint8_t _wp)
|
||||
}
|
||||
|
||||
|
||||
static void send_circle(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_circle(struct transport_tx *trans, struct link_device *dev) {
|
||||
if (nav_in_circle) {
|
||||
pprz_msg_send_CIRCLE(trans, dev, AC_ID,
|
||||
&nav_circle_x, &nav_circle_y, &nav_circle_radius);
|
||||
}
|
||||
}
|
||||
|
||||
static void send_segment(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_segment(struct transport_tx *trans, struct link_device *dev) {
|
||||
if (nav_in_segment) {
|
||||
pprz_msg_send_SEGMENT(trans, dev, AC_ID,
|
||||
&nav_segment_x_1, &nav_segment_y_1, &nav_segment_x_2, &nav_segment_y_2);
|
||||
}
|
||||
}
|
||||
|
||||
static void send_survey(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_survey(struct transport_tx *trans, struct link_device *dev) {
|
||||
if (nav_survey_active) {
|
||||
pprz_msg_send_SURVEY(trans, dev, AC_ID,
|
||||
&nav_survey_east, &nav_survey_north, &nav_survey_west, &nav_survey_south);
|
||||
|
||||
@@ -192,16 +192,16 @@ inline static void h_ctl_pitch_loop( void );
|
||||
#if PERIODIC_TELEMETRY
|
||||
#include "subsystems/datalink/telemetry.h"
|
||||
|
||||
static void send_calibration(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_calibration(struct transport_tx *trans, struct link_device *dev) {
|
||||
pprz_msg_send_CALIBRATION(trans, dev, AC_ID, &v_ctl_auto_throttle_sum_err, &v_ctl_auto_throttle_submode);
|
||||
}
|
||||
|
||||
static void send_tune_roll(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_tune_roll(struct transport_tx *trans, struct link_device *dev) {
|
||||
pprz_msg_send_TUNE_ROLL(trans, dev, AC_ID,
|
||||
&(stateGetBodyRates_f()->p), &(stateGetNedToBodyEulers_f()->phi), &h_ctl_roll_setpoint);
|
||||
}
|
||||
|
||||
static void send_ctl_a(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_ctl_a(struct transport_tx *trans, struct link_device *dev) {
|
||||
pprz_msg_send_H_CTL_A(trans, dev, AC_ID,
|
||||
&h_ctl_roll_sum_err,
|
||||
&h_ctl_roll_setpoint,
|
||||
|
||||
@@ -115,7 +115,7 @@ static float nav_ratio;
|
||||
#if PERIODIC_TELEMETRY
|
||||
#include "subsystems/datalink/telemetry.h"
|
||||
|
||||
static void send_calibration(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_calibration(struct transport_tx *trans, struct link_device *dev) {
|
||||
pprz_msg_send_CALIBRATION(trans, dev, AC_ID, &v_ctl_auto_throttle_sum_err, &v_ctl_auto_throttle_submode);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -138,7 +138,7 @@ PRINT_CONFIG_MSG("Enabled UNLOCKED_HOME_MODE since MODE_AUTO2 is AP_MODE_HOME")
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static void send_alive(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_alive(struct transport_tx *trans, struct link_device *dev) {
|
||||
pprz_msg_send_ALIVE(trans, dev, AC_ID, 16, MD5SUM);
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ static void send_alive(struct transport_tx *trans, struct device *dev) {
|
||||
#include "subsystems/actuators/motor_mixing.h"
|
||||
#endif
|
||||
|
||||
static void send_status(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_status(struct transport_tx *trans, struct link_device *dev) {
|
||||
uint32_t imu_nb_err = 0;
|
||||
#if USE_MOTOR_MIXING
|
||||
uint8_t _motor_nb_err = motor_mixing.nb_saturation + motor_mixing.nb_failure * 10;
|
||||
@@ -168,7 +168,7 @@ static void send_status(struct transport_tx *trans, struct device *dev) {
|
||||
&electrical.vsupply, &time_sec);
|
||||
}
|
||||
|
||||
static void send_energy(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_energy(struct transport_tx *trans, struct link_device *dev) {
|
||||
uint16_t e = electrical.energy;
|
||||
float vsup = ((float)electrical.vsupply) / 10.0f;
|
||||
float curs = ((float)electrical.current) / 1000.0f;
|
||||
@@ -176,7 +176,7 @@ static void send_energy(struct transport_tx *trans, struct device *dev) {
|
||||
pprz_msg_send_ENERGY(trans, dev, AC_ID, &vsup, &curs, &e, &power);
|
||||
}
|
||||
|
||||
static void send_fp(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_fp(struct transport_tx *trans, struct link_device *dev) {
|
||||
int32_t carrot_up = -guidance_v_z_sp;
|
||||
pprz_msg_send_ROTORCRAFT_FP(trans, dev, AC_ID,
|
||||
&(stateGetPositionEnu_i()->x),
|
||||
@@ -197,11 +197,11 @@ static void send_fp(struct transport_tx *trans, struct device *dev) {
|
||||
}
|
||||
|
||||
#ifdef RADIO_CONTROL
|
||||
static void send_rc(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_rc(struct transport_tx *trans, struct link_device *dev) {
|
||||
pprz_msg_send_RC(trans, dev, AC_ID, RADIO_CONTROL_NB_CHANNEL, radio_control.values);
|
||||
}
|
||||
|
||||
static void send_rotorcraft_rc(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_rotorcraft_rc(struct transport_tx *trans, struct link_device *dev) {
|
||||
#ifdef RADIO_KILL_SWITCH
|
||||
int16_t _kill_switch = radio_control.values[RADIO_KILL_SWITCH];
|
||||
#else
|
||||
@@ -219,16 +219,16 @@ static void send_rotorcraft_rc(struct transport_tx *trans, struct device *dev) {
|
||||
#endif
|
||||
|
||||
#ifdef ACTUATORS
|
||||
static void send_actuators(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_actuators(struct transport_tx *trans, struct link_device *dev) {
|
||||
pprz_msg_send_ACTUATORS(trans, dev, AC_ID , ACTUATORS_NB, actuators);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void send_dl_value(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_dl_value(struct transport_tx *trans, struct link_device *dev) {
|
||||
PeriodicSendDlValue(trans, dev);
|
||||
}
|
||||
|
||||
static void send_rotorcraft_cmd(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_rotorcraft_cmd(struct transport_tx *trans, struct link_device *dev) {
|
||||
pprz_msg_send_ROTORCRAFT_CMD(trans, dev, AC_ID,
|
||||
&stabilization_cmd[COMMAND_ROLL],
|
||||
&stabilization_cmd[COMMAND_PITCH],
|
||||
|
||||
@@ -109,7 +109,7 @@ static void read_rc_setpoint_speed_i(struct Int32Vect2 *speed_sp, bool_t in_flig
|
||||
#if PERIODIC_TELEMETRY
|
||||
#include "subsystems/datalink/telemetry.h"
|
||||
|
||||
static void send_gh(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_gh(struct transport_tx *trans, struct link_device *dev) {
|
||||
struct NedCoor_i* pos = stateGetPositionNed_i();
|
||||
pprz_msg_send_GUIDANCE_H_INT(trans, dev, AC_ID,
|
||||
&guidance_h_pos_sp.x, &guidance_h_pos_sp.y,
|
||||
@@ -117,7 +117,7 @@ static void send_gh(struct transport_tx *trans, struct device *dev) {
|
||||
&(pos->x), &(pos->y));
|
||||
}
|
||||
|
||||
static void send_hover_loop(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_hover_loop(struct transport_tx *trans, struct link_device *dev) {
|
||||
struct NedCoor_i* pos = stateGetPositionNed_i();
|
||||
struct NedCoor_i* speed = stateGetSpeedNed_i();
|
||||
struct NedCoor_i* accel = stateGetAccelNed_i();
|
||||
@@ -138,7 +138,7 @@ static void send_hover_loop(struct transport_tx *trans, struct device *dev) {
|
||||
&guidance_h_heading_sp);
|
||||
}
|
||||
|
||||
static void send_href(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_href(struct transport_tx *trans, struct link_device *dev) {
|
||||
pprz_msg_send_GUIDANCE_H_REF_INT(trans, dev, AC_ID,
|
||||
&guidance_h_pos_sp.x, &guidance_h_pos_ref.x,
|
||||
&guidance_h_speed_sp.x, &guidance_h_speed_ref.x,
|
||||
@@ -148,7 +148,7 @@ static void send_href(struct transport_tx *trans, struct device *dev) {
|
||||
&guidance_h_accel_ref.y);
|
||||
}
|
||||
|
||||
static void send_tune_hover(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_tune_hover(struct transport_tx *trans, struct link_device *dev) {
|
||||
pprz_msg_send_ROTORCRAFT_TUNE_HOVER(trans, dev, AC_ID,
|
||||
&radio_control.values[RADIO_ROLL],
|
||||
&radio_control.values[RADIO_PITCH],
|
||||
|
||||
@@ -142,7 +142,7 @@ static void run_hover_loop(bool_t in_flight);
|
||||
#if PERIODIC_TELEMETRY
|
||||
#include "subsystems/datalink/telemetry.h"
|
||||
|
||||
static void send_vert_loop(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_vert_loop(struct transport_tx *trans, struct link_device *dev) {
|
||||
pprz_msg_send_VERT_LOOP(trans, dev, AC_ID,
|
||||
&guidance_v_z_sp, &guidance_v_zd_sp,
|
||||
&(stateGetPositionNed_i()->z),
|
||||
@@ -159,7 +159,7 @@ static void send_vert_loop(struct transport_tx *trans, struct device *dev) {
|
||||
&guidance_v_delta_t);
|
||||
}
|
||||
|
||||
static void send_tune_vert(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_tune_vert(struct transport_tx *trans, struct link_device *dev) {
|
||||
pprz_msg_send_TUNE_VERT(trans, dev, AC_ID,
|
||||
&guidance_v_z_sp,
|
||||
&(stateGetPositionNed_i()->z),
|
||||
|
||||
@@ -106,7 +106,7 @@ static inline void nav_set_altitude( void );
|
||||
#if PERIODIC_TELEMETRY
|
||||
#include "subsystems/datalink/telemetry.h"
|
||||
|
||||
static void send_nav_status(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_nav_status(struct transport_tx *trans, struct link_device *dev) {
|
||||
float dist_home = sqrtf(dist2_to_home);
|
||||
float dist_wp = sqrtf(dist2_to_wp);
|
||||
pprz_msg_send_ROTORCRAFT_NAV_STATUS(trans, dev, AC_ID,
|
||||
@@ -129,7 +129,7 @@ static void send_nav_status(struct transport_tx *trans, struct device *dev) {
|
||||
}
|
||||
}
|
||||
|
||||
static void send_wp_moved(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_wp_moved(struct transport_tx *trans, struct link_device *dev) {
|
||||
static uint8_t i;
|
||||
i++; if (i >= nb_waypoint) i = 0;
|
||||
pprz_msg_send_WP_MOVED_ENU(trans, dev, AC_ID,
|
||||
|
||||
@@ -44,7 +44,7 @@ float stabilization_att_ff_cmd[COMMANDS_NB];
|
||||
#if PERIODIC_TELEMETRY
|
||||
#include "subsystems/datalink/telemetry.h"
|
||||
|
||||
static void send_att(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_att(struct transport_tx *trans, struct link_device *dev) {
|
||||
struct FloatRates* body_rate = stateGetBodyRates_f();
|
||||
struct FloatEulers* att = stateGetNedToBodyEulers_f();
|
||||
float foo = 0.0;
|
||||
@@ -69,7 +69,7 @@ static void send_att(struct transport_tx *trans, struct device *dev) {
|
||||
&foo, &foo, &foo);
|
||||
}
|
||||
|
||||
static void send_att_ref(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_att_ref(struct transport_tx *trans, struct link_device *dev) {
|
||||
pprz_msg_send_STAB_ATTITUDE_REF_FLOAT(trans, dev, AC_ID,
|
||||
&stab_att_sp_euler.phi,
|
||||
&stab_att_sp_euler.theta,
|
||||
|
||||
@@ -65,7 +65,7 @@ static inline void reset_psi_ref_from_body(void) {
|
||||
#if PERIODIC_TELEMETRY
|
||||
#include "subsystems/datalink/telemetry.h"
|
||||
|
||||
static void send_att(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_att(struct transport_tx *trans, struct link_device *dev) {
|
||||
struct Int32Rates* body_rate = stateGetBodyRates_i();
|
||||
struct Int32Eulers* att = stateGetNedToBodyEulers_i();
|
||||
pprz_msg_send_STAB_ATTITUDE_INT(trans, dev, AC_ID,
|
||||
@@ -88,7 +88,7 @@ static void send_att(struct transport_tx *trans, struct device *dev) {
|
||||
&stabilization_cmd[COMMAND_YAW]);
|
||||
}
|
||||
|
||||
static void send_att_ref(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_att_ref(struct transport_tx *trans, struct link_device *dev) {
|
||||
pprz_msg_send_STAB_ATTITUDE_REF_INT(trans, dev, AC_ID,
|
||||
&stab_att_sp_euler.phi,
|
||||
&stab_att_sp_euler.theta,
|
||||
|
||||
@@ -95,7 +95,7 @@ static const float psi_ddgain_surface[] = STABILIZATION_ATTITUDE_PSI_DDGAIN_SURF
|
||||
#if PERIODIC_TELEMETRY
|
||||
#include "subsystems/datalink/telemetry.h"
|
||||
|
||||
static void send_att(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_att(struct transport_tx *trans, struct link_device *dev) {
|
||||
struct FloatRates* body_rate = stateGetBodyRates_f();
|
||||
struct FloatEulers* att = stateGetNedToBodyEulers_f();
|
||||
pprz_msg_send_STAB_ATTITUDE_FLOAT(trans, dev, AC_ID,
|
||||
@@ -119,7 +119,7 @@ static void send_att(struct transport_tx *trans, struct device *dev) {
|
||||
&body_rate_d.p, &body_rate_d.q, &body_rate_d.r);
|
||||
}
|
||||
|
||||
static void send_att_ref(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_att_ref(struct transport_tx *trans, struct link_device *dev) {
|
||||
pprz_msg_send_STAB_ATTITUDE_REF_FLOAT(trans, dev, AC_ID,
|
||||
&stab_att_sp_euler.phi,
|
||||
&stab_att_sp_euler.theta,
|
||||
|
||||
@@ -69,7 +69,7 @@ int32_t stabilization_att_ff_cmd[COMMANDS_NB];
|
||||
#if PERIODIC_TELEMETRY
|
||||
#include "subsystems/datalink/telemetry.h"
|
||||
|
||||
static void send_att(struct transport_tx *trans, struct device *dev) { //FIXME really use this message here ?
|
||||
static void send_att(struct transport_tx *trans, struct link_device *dev) { //FIXME really use this message here ?
|
||||
struct Int32Rates* body_rate = stateGetBodyRates_i();
|
||||
struct Int32Eulers* att = stateGetNedToBodyEulers_i();
|
||||
pprz_msg_send_STAB_ATTITUDE_INT(trans, dev, AC_ID,
|
||||
@@ -92,7 +92,7 @@ static void send_att(struct transport_tx *trans, struct device *dev) { //FIXME r
|
||||
&stabilization_cmd[COMMAND_YAW]);
|
||||
}
|
||||
|
||||
static void send_att_ref(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_att_ref(struct transport_tx *trans, struct link_device *dev) {
|
||||
pprz_msg_send_STAB_ATTITUDE_REF_INT(trans, dev, AC_ID,
|
||||
&stab_att_sp_euler.phi,
|
||||
&stab_att_sp_euler.theta,
|
||||
@@ -108,7 +108,7 @@ static void send_att_ref(struct transport_tx *trans, struct device *dev) {
|
||||
&stab_att_ref_accel.r);
|
||||
}
|
||||
|
||||
static void send_ahrs_ref_quat(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_ahrs_ref_quat(struct transport_tx *trans, struct link_device *dev) {
|
||||
struct Int32Quat* quat = stateGetNedToBodyQuat_i();
|
||||
pprz_msg_send_AHRS_REF_QUAT(trans, dev, AC_ID,
|
||||
&stab_att_ref_quat.qi,
|
||||
|
||||
@@ -118,7 +118,7 @@ struct Int32Rates stabilization_rate_ff_cmd;
|
||||
#if PERIODIC_TELEMETRY
|
||||
#include "subsystems/datalink/telemetry.h"
|
||||
|
||||
static void send_rate(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_rate(struct transport_tx *trans, struct link_device *dev) {
|
||||
pprz_msg_send_RATE_LOOP(trans, dev, AC_ID,
|
||||
&stabilization_rate_sp.p,
|
||||
&stabilization_rate_sp.q,
|
||||
|
||||
@@ -184,12 +184,12 @@ struct link_mcu_msg link_mcu_from_fbw_msg;
|
||||
#define RC_REALLY_LOST 2
|
||||
|
||||
|
||||
static void send_commands(struct transport_tx *trans, struct device *dev)
|
||||
static void send_commands(struct transport_tx *trans, struct link_device *dev)
|
||||
{
|
||||
pprz_msg_send_COMMANDS(trans, dev, AC_ID, COMMANDS_NB, ap_state->commands);
|
||||
}
|
||||
|
||||
static void send_fbw_status(struct transport_tx *trans, struct device *dev)
|
||||
static void send_fbw_status(struct transport_tx *trans, struct link_device *dev)
|
||||
{
|
||||
uint8_t rc_status = 0;
|
||||
uint8_t fbw_status = 0;
|
||||
|
||||
@@ -106,7 +106,7 @@ uint8_t link_mcu_fbw_nb_err;
|
||||
#if PERIODIC_TELEMETRY
|
||||
#include "subsystems/datalink/telemetry.h"
|
||||
|
||||
static void send_debug_link(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_debug_link(struct transport_tx *trans, struct link_device *dev) {
|
||||
uint8_t mcu1_ppm_cpt_foo = 0; //FIXME
|
||||
pprz_msg_send_DEBUG_MCU_LINK(trans, dev, AC_ID,
|
||||
&link_mcu_nb_err, &link_mcu_fbw_nb_err, &mcu1_ppm_cpt_foo);
|
||||
|
||||
@@ -254,12 +254,12 @@ inline void parse_mavpilot_msg( void );
|
||||
#define RC_REALLY_LOST 2
|
||||
|
||||
|
||||
static void send_commands(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_commands(struct transport_tx *trans, struct link_device *dev) {
|
||||
pprz_msg_send_COMMANDS(trans, dev, AC_ID, COMMANDS_NB, ap_state->commands);
|
||||
}
|
||||
|
||||
|
||||
static void send_fbw_status(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_fbw_status(struct transport_tx *trans, struct link_device *dev) {
|
||||
uint8_t rc_status = 0;
|
||||
uint8_t fbw_status = 0;
|
||||
if (bit_is_set(fbw_state->status, STATUS_MODE_AUTO))
|
||||
|
||||
@@ -39,7 +39,7 @@ typedef void (*send_message_t)(void *);
|
||||
|
||||
/** Device structure
|
||||
*/
|
||||
struct device {
|
||||
struct link_device {
|
||||
check_free_space_t check_free_space; ///< check if transmit buffer is not full
|
||||
transmit_t transmit; ///< transmit one byte
|
||||
send_message_t send_message; ///< send completed buffer
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
struct i2c_periph i2c0;
|
||||
|
||||
#if PERIODIC_TELEMETRY
|
||||
static void send_i2c0_err(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_i2c0_err(struct transport_tx *trans, struct link_device *dev) {
|
||||
uint16_t i2c0_queue_full_cnt = i2c0.errors->queue_full_cnt;
|
||||
uint16_t i2c0_ack_fail_cnt = i2c0.errors->ack_fail_cnt;
|
||||
uint16_t i2c0_miss_start_stop_cnt = i2c0.errors->miss_start_stop_cnt;
|
||||
@@ -76,7 +76,7 @@ void i2c0_init(void) {
|
||||
struct i2c_periph i2c1;
|
||||
|
||||
#if PERIODIC_TELEMETRY
|
||||
static void send_i2c1_err(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_i2c1_err(struct transport_tx *trans, struct link_device *dev) {
|
||||
uint16_t i2c1_queue_full_cnt = i2c1.errors->queue_full_cnt;
|
||||
uint16_t i2c1_ack_fail_cnt = i2c1.errors->ack_fail_cnt;
|
||||
uint16_t i2c1_miss_start_stop_cnt = i2c1.errors->miss_start_stop_cnt;
|
||||
@@ -116,7 +116,7 @@ void i2c1_init(void) {
|
||||
struct i2c_periph i2c2;
|
||||
|
||||
#if PERIODIC_TELEMETRY
|
||||
static void send_i2c2_err(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_i2c2_err(struct transport_tx *trans, struct link_device *dev) {
|
||||
uint16_t i2c2_queue_full_cnt = i2c2.errors->queue_full_cnt;
|
||||
uint16_t i2c2_ack_fail_cnt = i2c2.errors->ack_fail_cnt;
|
||||
uint16_t i2c2_miss_start_stop_cnt = i2c2.errors->miss_start_stop_cnt;
|
||||
@@ -160,7 +160,7 @@ void i2c3_init(void) {
|
||||
}
|
||||
|
||||
#if PERIODIC_TELEMETRY
|
||||
static void send_i2c3_err(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_i2c3_err(struct transport_tx *trans, struct link_device *dev) {
|
||||
uint16_t i2c3_queue_full_cnt = i2c3.errors->queue_full_cnt;
|
||||
uint16_t i2c3_ack_fail_cnt = i2c3.errors->ack_fail_cnt;
|
||||
uint16_t i2c3_miss_start_stop_cnt = i2c3.errors->miss_start_stop_cnt;
|
||||
@@ -190,7 +190,7 @@ static void send_i2c3_err(struct transport_tx *trans, struct device *dev) {
|
||||
#endif /* USE_I2C3 */
|
||||
|
||||
#if PERIODIC_TELEMETRY
|
||||
static void send_i2c_err(struct transport_tx *trans __attribute__((unused)), struct device *dev __attribute__((unused))) {
|
||||
static void send_i2c_err(struct transport_tx *trans __attribute__((unused)), struct link_device *dev __attribute__((unused))) {
|
||||
static uint8_t _i2c_nb_cnt = 0;
|
||||
switch (_i2c_nb_cnt) {
|
||||
case 0:
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
struct uart_periph uart0;
|
||||
|
||||
#if PERIODIC_TELEMETRY
|
||||
static void send_uart0_err(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_uart0_err(struct transport_tx *trans, struct link_device *dev) {
|
||||
uint16_t ore = uart0.ore;
|
||||
uint16_t ne_err = uart0.ne_err;
|
||||
uint16_t fe_err = uart0.fe_err;
|
||||
@@ -46,7 +46,7 @@ static void send_uart0_err(struct transport_tx *trans, struct device *dev) {
|
||||
struct uart_periph uart1;
|
||||
|
||||
#if PERIODIC_TELEMETRY
|
||||
static void send_uart1_err(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_uart1_err(struct transport_tx *trans, struct link_device *dev) {
|
||||
uint16_t ore = uart1.ore;
|
||||
uint16_t ne_err = uart1.ne_err;
|
||||
uint16_t fe_err = uart1.fe_err;
|
||||
@@ -62,7 +62,7 @@ static void send_uart1_err(struct transport_tx *trans, struct device *dev) {
|
||||
struct uart_periph uart2;
|
||||
|
||||
#if PERIODIC_TELEMETRY
|
||||
static void send_uart2_err(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_uart2_err(struct transport_tx *trans, struct link_device *dev) {
|
||||
uint16_t ore = uart2.ore;
|
||||
uint16_t ne_err = uart2.ne_err;
|
||||
uint16_t fe_err = uart2.fe_err;
|
||||
@@ -78,7 +78,7 @@ static void send_uart2_err(struct transport_tx *trans, struct device *dev) {
|
||||
struct uart_periph uart3;
|
||||
|
||||
#if PERIODIC_TELEMETRY
|
||||
static void send_uart3_err(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_uart3_err(struct transport_tx *trans, struct link_device *dev) {
|
||||
uint16_t ore = uart3.ore;
|
||||
uint16_t ne_err = uart3.ne_err;
|
||||
uint16_t fe_err = uart3.fe_err;
|
||||
@@ -94,7 +94,7 @@ static void send_uart3_err(struct transport_tx *trans, struct device *dev) {
|
||||
struct uart_periph uart4;
|
||||
|
||||
#if PERIODIC_TELEMETRY
|
||||
static void send_uart4_err(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_uart4_err(struct transport_tx *trans, struct link_device *dev) {
|
||||
uint16_t ore = uart4.ore;
|
||||
uint16_t ne_err = uart4.ne_err;
|
||||
uint16_t fe_err = uart4.fe_err;
|
||||
@@ -110,7 +110,7 @@ static void send_uart4_err(struct transport_tx *trans, struct device *dev) {
|
||||
struct uart_periph uart5;
|
||||
|
||||
#if PERIODIC_TELEMETRY
|
||||
static void send_uart5_err(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_uart5_err(struct transport_tx *trans, struct link_device *dev) {
|
||||
uint16_t ore = uart5.ore;
|
||||
uint16_t ne_err = uart5.ne_err;
|
||||
uint16_t fe_err = uart5.fe_err;
|
||||
@@ -126,7 +126,7 @@ static void send_uart5_err(struct transport_tx *trans, struct device *dev) {
|
||||
struct uart_periph uart6;
|
||||
|
||||
#if PERIODIC_TELEMETRY
|
||||
static void send_uart6_err(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_uart6_err(struct transport_tx *trans, struct link_device *dev) {
|
||||
uint16_t ore = uart6.ore;
|
||||
uint16_t ne_err = uart6.ne_err;
|
||||
uint16_t fe_err = uart6.fe_err;
|
||||
@@ -139,7 +139,7 @@ static void send_uart6_err(struct transport_tx *trans, struct device *dev) {
|
||||
#endif
|
||||
|
||||
#if PERIODIC_TELEMETRY
|
||||
static void send_uart_err(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_uart_err(struct transport_tx *trans, struct link_device *dev) {
|
||||
static uint8_t uart_nb_cnt = 0;
|
||||
switch (uart_nb_cnt) {
|
||||
#if USE_UART0
|
||||
|
||||
@@ -71,7 +71,7 @@ struct uart_periph {
|
||||
volatile uint16_t ne_err; ///< noise error counter
|
||||
volatile uint16_t fe_err; ///< framing error counter
|
||||
/** Generic device interface */
|
||||
struct device device;
|
||||
struct link_device device;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ struct udp_periph {
|
||||
/** UDP network */
|
||||
void* network;
|
||||
/** Generic device interface */
|
||||
struct device device;
|
||||
struct link_device device;
|
||||
};
|
||||
|
||||
extern void udp_periph_init(struct udp_periph* p, char* host, int port_out, int port_in, bool_t broadcast);
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
struct usb_serial_periph {
|
||||
/** Generic device interface */
|
||||
struct device device;
|
||||
struct link_device device;
|
||||
};
|
||||
|
||||
extern struct usb_serial_periph usb_serial;
|
||||
|
||||
@@ -138,13 +138,13 @@ static void temperature_cb(uint8_t __attribute__((unused)) sender_id, const floa
|
||||
#if PERIODIC_TELEMETRY
|
||||
#include "subsystems/datalink/telemetry.h"
|
||||
|
||||
static void send_baro_raw(struct transport_tx *trans, struct device *dev)
|
||||
static void send_baro_raw(struct transport_tx *trans, struct link_device *dev)
|
||||
{
|
||||
pprz_msg_send_BARO_RAW(trans, dev, AC_ID,
|
||||
&air_data.pressure, &air_data.differential);
|
||||
}
|
||||
|
||||
static void send_air_data(struct transport_tx *trans, struct device *dev)
|
||||
static void send_air_data(struct transport_tx *trans, struct link_device *dev)
|
||||
{
|
||||
pprz_msg_send_AIR_DATA(trans, dev, AC_ID,
|
||||
&air_data.pressure, &air_data.differential,
|
||||
@@ -153,7 +153,7 @@ static void send_air_data(struct transport_tx *trans, struct device *dev)
|
||||
&air_data.tas_factor);
|
||||
}
|
||||
|
||||
static void send_amsl(struct transport_tx *trans, struct device *dev)
|
||||
static void send_amsl(struct transport_tx *trans, struct link_device *dev)
|
||||
{
|
||||
const float MeterPerFeet = 0.3048;
|
||||
float amsl_baro_ft = air_data.amsl_baro / MeterPerFeet;
|
||||
|
||||
@@ -100,12 +100,12 @@ void cam_target(void);
|
||||
void cam_waypoint_target(void);
|
||||
void cam_ac_target(void);
|
||||
|
||||
static void send_cam(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_cam(struct transport_tx *trans, struct link_device *dev) {
|
||||
SEND_CAM(DefaultChannel, DefaultDevice);
|
||||
}
|
||||
|
||||
#ifdef SHOW_CAM_COORDINATES
|
||||
static void send_cam_point(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_cam_point(struct transport_tx *trans, struct link_device *dev) {
|
||||
pprz_msg_send_CAM_POINT(trans, dev, AC_ID,
|
||||
&cam_point_distance_from_home, &cam_point_lat, &cam_point_lon);
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ int16_t rotorcraft_cam_pan;
|
||||
#define ROTORCRAFT_CAM_PAN_MIN 0
|
||||
#define ROTORCRAFT_CAM_PAN_MAX INT32_ANGLE_2_PI
|
||||
|
||||
static void send_cam(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_cam(struct transport_tx *trans, struct link_device *dev) {
|
||||
pprz_msg_send_ROTORCRAFT_CAM(trans, dev, AC_ID,
|
||||
&rotorcraft_cam_tilt,&rotorcraft_cam_pan);
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ void digital_cam_uart_event(void)
|
||||
}
|
||||
|
||||
#if PERIODIC_TELEMETRY
|
||||
static void send_thumbnails(struct transport_tx *trans, struct device *dev)
|
||||
static void send_thumbnails(struct transport_tx *trans, struct link_device *dev)
|
||||
{
|
||||
static int cnt = 0;
|
||||
if (digital_cam_uart_thumbnails > 0) {
|
||||
|
||||
@@ -45,7 +45,7 @@ static uint32_t samples_idx;
|
||||
#if PERIODIC_TELEMETRY
|
||||
#include "subsystems/datalink/telemetry.h"
|
||||
|
||||
static void send_aligner(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_aligner(struct transport_tx *trans, struct link_device *dev) {
|
||||
pprz_msg_send_FILTER_ALIGNER(trans, dev, AC_ID,
|
||||
&ahrs_aligner.lp_gyro.p,
|
||||
&ahrs_aligner.lp_gyro.q,
|
||||
|
||||
@@ -49,7 +49,7 @@ unsigned char buffer[4096]; //Packet buffer
|
||||
#if PERIODIC_TELEMETRY
|
||||
#include "subsystems/datalink/telemetry.h"
|
||||
|
||||
static void send_ahrs_ad2(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_ahrs_ad2(struct transport_tx *trans, struct link_device *dev) {
|
||||
pprz_msg_send_AHRS_ARDRONE2(trans, dev, AC_ID,
|
||||
&ahrs_impl.state,
|
||||
&ahrs_impl.control_state,
|
||||
|
||||
@@ -93,7 +93,7 @@ struct AhrsFloatCmpl ahrs_impl;
|
||||
#if PERIODIC_TELEMETRY
|
||||
#include "subsystems/datalink/telemetry.h"
|
||||
|
||||
static void send_att(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_att(struct transport_tx *trans, struct link_device *dev) {
|
||||
struct FloatEulers ltp_to_imu_euler;
|
||||
float_eulers_of_quat(<p_to_imu_euler, &ahrs_impl.ltp_to_imu_quat);
|
||||
struct Int32Eulers euler_i;
|
||||
@@ -108,14 +108,14 @@ static void send_att(struct transport_tx *trans, struct device *dev) {
|
||||
&(eulers_body->psi));
|
||||
}
|
||||
|
||||
static void send_geo_mag(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_geo_mag(struct transport_tx *trans, struct link_device *dev) {
|
||||
pprz_msg_send_GEO_MAG(trans, dev, AC_ID,
|
||||
&ahrs_impl.mag_h.x, &ahrs_impl.mag_h.y, &ahrs_impl.mag_h.z);
|
||||
}
|
||||
|
||||
// TODO convert from float to int if we really need this one
|
||||
/*
|
||||
static void send_rmat(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_rmat(struct transport_tx *trans, struct link_device *dev) {
|
||||
struct Int32RMat* att_rmat = stateGetNedToBodyRMat_i();
|
||||
pprz_msg_send_AHRS_RMAT(trans, dev, AC_ID,
|
||||
&ahrs_impl.ltp_to_imu_rmat.m[0],
|
||||
|
||||
@@ -63,7 +63,7 @@ struct AhrsMlkf ahrs_impl;
|
||||
#if PERIODIC_TELEMETRY
|
||||
#include "subsystems/datalink/telemetry.h"
|
||||
|
||||
static void send_geo_mag(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_geo_mag(struct transport_tx *trans, struct link_device *dev) {
|
||||
pprz_msg_send_GEO_MAG(trans, dev, AC_ID,
|
||||
&ahrs_impl.mag_h.x, &ahrs_impl.mag_h.y, &ahrs_impl.mag_h.z);
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ void ahrs_align(void) {
|
||||
#if PERIODIC_TELEMETRY
|
||||
#include "subsystems/datalink/telemetry.h"
|
||||
|
||||
static send_gx3(struct transport_tx *trans, struct device *dev) {
|
||||
static send_gx3(struct transport_tx *trans, struct link_device *dev) {
|
||||
pprz_msg_send_GX3_INFO(trans, dev, AC_ID,
|
||||
&ahrs_impl.gx3_freq,
|
||||
&ahrs_impl.gx3_packet.chksm_error,
|
||||
|
||||
@@ -42,12 +42,12 @@ float heading;
|
||||
#if PERIODIC_TELEMETRY
|
||||
#include "subsystems/datalink/telemetry.h"
|
||||
|
||||
static void send_infrared(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_infrared(struct transport_tx *trans, struct link_device *dev) {
|
||||
pprz_msg_send_IR_SENSORS(trans, dev, AC_ID,
|
||||
&infrared.value.ir1, &infrared.value.ir2, &infrared.pitch, &infrared.roll, &infrared.top);
|
||||
}
|
||||
|
||||
static void send_status(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_status(struct transport_tx *trans, struct link_device *dev) {
|
||||
uint16_t contrast = abs(infrared.roll) + abs(infrared.pitch) + abs(infrared.top);
|
||||
uint8_t mde = 3;
|
||||
if (contrast < 50) mde = 7;
|
||||
|
||||
@@ -64,7 +64,7 @@ static inline void set_body_state_from_euler(void);
|
||||
#if PERIODIC_TELEMETRY
|
||||
#include "subsystems/datalink/telemetry.h"
|
||||
|
||||
static void send_filter(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_filter(struct transport_tx *trans, struct link_device *dev) {
|
||||
pprz_msg_send_FILTER(trans, dev, AC_ID,
|
||||
&ahrs_impl.ltp_to_imu_euler.phi,
|
||||
&ahrs_impl.ltp_to_imu_euler.theta,
|
||||
@@ -83,7 +83,7 @@ static void send_filter(struct transport_tx *trans, struct device *dev) {
|
||||
&ahrs_impl.gyro_bias.r);
|
||||
}
|
||||
|
||||
static void send_euler(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_euler(struct transport_tx *trans, struct link_device *dev) {
|
||||
struct Int32Eulers* eulers = stateGetNedToBodyEulers_i();
|
||||
pprz_msg_send_AHRS_EULER_INT(trans, dev, AC_ID,
|
||||
&ahrs_impl.ltp_to_imu_euler.phi,
|
||||
@@ -94,7 +94,7 @@ static void send_euler(struct transport_tx *trans, struct device *dev) {
|
||||
&(eulers->psi));
|
||||
}
|
||||
|
||||
static void send_bias(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_bias(struct transport_tx *trans, struct link_device *dev) {
|
||||
pprz_msg_send_AHRS_GYRO_BIAS_INT(trans, dev, AC_ID,
|
||||
&ahrs_impl.gyro_bias.p, &ahrs_impl.gyro_bias.q, &ahrs_impl.gyro_bias.r);
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ static inline void ahrs_update_mag_2d(float dt);
|
||||
#if PERIODIC_TELEMETRY
|
||||
#include "subsystems/datalink/telemetry.h"
|
||||
|
||||
static void send_quat(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_quat(struct transport_tx *trans, struct link_device *dev) {
|
||||
struct Int32Quat* quat = stateGetNedToBodyQuat_i();
|
||||
pprz_msg_send_AHRS_QUAT_INT(trans, dev, AC_ID,
|
||||
&ahrs_impl.weight,
|
||||
@@ -128,7 +128,7 @@ static void send_quat(struct transport_tx *trans, struct device *dev) {
|
||||
&(quat->qz));
|
||||
}
|
||||
|
||||
static void send_euler(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_euler(struct transport_tx *trans, struct link_device *dev) {
|
||||
struct Int32Eulers ltp_to_imu_euler;
|
||||
int32_eulers_of_quat(<p_to_imu_euler, &ahrs_impl.ltp_to_imu_quat);
|
||||
struct Int32Eulers* eulers = stateGetNedToBodyEulers_i();
|
||||
@@ -141,12 +141,12 @@ static void send_euler(struct transport_tx *trans, struct device *dev) {
|
||||
&(eulers->psi));
|
||||
}
|
||||
|
||||
static void send_bias(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_bias(struct transport_tx *trans, struct link_device *dev) {
|
||||
pprz_msg_send_AHRS_GYRO_BIAS_INT(trans, dev, AC_ID,
|
||||
&ahrs_impl.gyro_bias.p, &ahrs_impl.gyro_bias.q, &ahrs_impl.gyro_bias.r);
|
||||
}
|
||||
|
||||
static void send_geo_mag(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_geo_mag(struct transport_tx *trans, struct link_device *dev) {
|
||||
struct FloatVect3 h_float;
|
||||
h_float.x = MAG_FLOAT_OF_BFP(ahrs_impl.mag_h.x);
|
||||
h_float.y = MAG_FLOAT_OF_BFP(ahrs_impl.mag_h.y);
|
||||
|
||||
@@ -50,7 +50,7 @@ extern void chibios_logFinish(void);
|
||||
|
||||
struct chibios_sdlog {
|
||||
/** Generic device interface */
|
||||
struct device device;
|
||||
struct link_device device;
|
||||
};
|
||||
|
||||
extern struct chibios_sdlog chibios_sdlog;
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
struct ivy_transport ivy_tp;
|
||||
|
||||
static void put_bytes(struct ivy_transport *trans, struct device *dev __attribute__((unused)), enum TransportDataType type __attribute__((unused)), enum TransportDataFormat format __attribute__((unused)), uint8_t len, const void *bytes)
|
||||
static void put_bytes(struct ivy_transport *trans, struct link_device *dev __attribute__((unused)), enum TransportDataType type __attribute__((unused)), enum TransportDataFormat format __attribute__((unused)), uint8_t len, const void *bytes)
|
||||
{
|
||||
const uint8_t *b = (const uint8_t *) bytes;
|
||||
|
||||
@@ -123,7 +123,7 @@ static void put_bytes(struct ivy_transport *trans, struct device *dev __attribut
|
||||
}
|
||||
}
|
||||
|
||||
static void put_named_byte(struct ivy_transport *trans, struct device *dev __attribute__((unused)), enum TransportDataType type __attribute__((unused)), enum TransportDataFormat format __attribute__((unused)), uint8_t byte __attribute__((unused)), const char * name __attribute__((unused)))
|
||||
static void put_named_byte(struct ivy_transport *trans, struct link_device *dev __attribute__((unused)), enum TransportDataType type __attribute__((unused)), enum TransportDataFormat format __attribute__((unused)), uint8_t byte __attribute__((unused)), const char * name __attribute__((unused)))
|
||||
{
|
||||
trans->ivy_p += sprintf(trans->ivy_p, "%s ", name);
|
||||
}
|
||||
@@ -133,12 +133,12 @@ static uint8_t size_of(struct ivy_transport *trans __attribute__((unused)), uint
|
||||
return len;
|
||||
}
|
||||
|
||||
static void start_message(struct ivy_transport *trans, struct device *dev __attribute__((unused)), uint8_t payload_len __attribute__((unused)))
|
||||
static void start_message(struct ivy_transport *trans, struct link_device *dev __attribute__((unused)), uint8_t payload_len __attribute__((unused)))
|
||||
{
|
||||
trans->ivy_p = trans->ivy_buf;
|
||||
}
|
||||
|
||||
static void end_message(struct ivy_transport *trans, struct device *dev __attribute__((unused)))
|
||||
static void end_message(struct ivy_transport *trans, struct link_device *dev __attribute__((unused)))
|
||||
{
|
||||
*(--trans->ivy_p) = '\0';
|
||||
if (trans->ivy_dl_enabled) {
|
||||
@@ -146,17 +146,17 @@ static void end_message(struct ivy_transport *trans, struct device *dev __attrib
|
||||
}
|
||||
}
|
||||
|
||||
static void overrun(struct ivy_transport *trans __attribute__((unused)), struct device *dev __attribute__((unused)))
|
||||
static void overrun(struct ivy_transport *trans __attribute__((unused)), struct link_device *dev __attribute__((unused)))
|
||||
{
|
||||
downlink.nb_ovrn++;
|
||||
}
|
||||
|
||||
static void count_bytes(struct ivy_transport *trans __attribute__((unused)), struct device *dev __attribute__((unused)), uint8_t bytes)
|
||||
static void count_bytes(struct ivy_transport *trans __attribute__((unused)), struct link_device *dev __attribute__((unused)), uint8_t bytes)
|
||||
{
|
||||
downlink.nb_bytes += bytes;
|
||||
}
|
||||
|
||||
static int check_available_space(struct ivy_transport *trans __attribute__((unused)), struct device *dev __attribute__((unused)), uint8_t bytes __attribute__((unused)))
|
||||
static int check_available_space(struct ivy_transport *trans __attribute__((unused)), struct link_device *dev __attribute__((unused)), uint8_t bytes __attribute__((unused)))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ struct ivy_transport {
|
||||
// generic transmission interface
|
||||
struct transport_tx trans_tx;
|
||||
// generic (dummy) device
|
||||
struct device device;
|
||||
struct link_device device;
|
||||
};
|
||||
|
||||
extern struct ivy_transport ivy_tp;
|
||||
|
||||
@@ -48,14 +48,14 @@
|
||||
|
||||
struct pprz_transport pprz_tp;
|
||||
|
||||
static void put_1byte(struct pprz_transport *trans, struct device *dev, const uint8_t byte)
|
||||
static void put_1byte(struct pprz_transport *trans, struct link_device *dev, const uint8_t byte)
|
||||
{
|
||||
trans->ck_a_tx += byte;
|
||||
trans->ck_b_tx += trans->ck_a_tx;
|
||||
dev->transmit(dev->periph, byte);
|
||||
}
|
||||
|
||||
static void put_bytes(struct pprz_transport *trans, struct device *dev, enum TransportDataType type __attribute__((unused)), enum TransportDataFormat format __attribute__((unused)), uint8_t len, const void *bytes)
|
||||
static void put_bytes(struct pprz_transport *trans, struct link_device *dev, enum TransportDataType type __attribute__((unused)), enum TransportDataFormat format __attribute__((unused)), uint8_t len, const void *bytes)
|
||||
{
|
||||
const uint8_t *b = (const uint8_t *) bytes;
|
||||
int i;
|
||||
@@ -64,7 +64,7 @@ static void put_bytes(struct pprz_transport *trans, struct device *dev, enum Tra
|
||||
}
|
||||
}
|
||||
|
||||
static void put_named_byte(struct pprz_transport *trans, struct device *dev, enum TransportDataType type __attribute__((unused)), enum TransportDataFormat format __attribute__((unused)), uint8_t byte, const char * name __attribute__((unused)))
|
||||
static void put_named_byte(struct pprz_transport *trans, struct link_device *dev, enum TransportDataType type __attribute__((unused)), enum TransportDataFormat format __attribute__((unused)), uint8_t byte, const char * name __attribute__((unused)))
|
||||
{
|
||||
put_1byte(trans, dev, byte);
|
||||
}
|
||||
@@ -75,7 +75,7 @@ static uint8_t size_of(struct pprz_transport *trans __attribute__((unused)), uin
|
||||
return len + 4;
|
||||
}
|
||||
|
||||
static void start_message(struct pprz_transport *trans, struct device *dev, uint8_t payload_len)
|
||||
static void start_message(struct pprz_transport *trans, struct link_device *dev, uint8_t payload_len)
|
||||
{
|
||||
downlink.nb_msgs++;
|
||||
dev->transmit(dev->periph, STX);
|
||||
@@ -85,24 +85,24 @@ static void start_message(struct pprz_transport *trans, struct device *dev, uint
|
||||
trans->ck_b_tx = msg_len;
|
||||
}
|
||||
|
||||
static void end_message(struct pprz_transport *trans, struct device *dev)
|
||||
static void end_message(struct pprz_transport *trans, struct link_device *dev)
|
||||
{
|
||||
dev->transmit(dev->periph, trans->ck_a_tx);
|
||||
dev->transmit(dev->periph, trans->ck_b_tx);
|
||||
dev->send_message(dev);
|
||||
}
|
||||
|
||||
static void overrun(struct pprz_transport *trans __attribute__((unused)), struct device *dev __attribute__((unused)))
|
||||
static void overrun(struct pprz_transport *trans __attribute__((unused)), struct link_device *dev __attribute__((unused)))
|
||||
{
|
||||
downlink.nb_ovrn++;
|
||||
}
|
||||
|
||||
static void count_bytes(struct pprz_transport *trans __attribute__((unused)), struct device *dev __attribute__((unused)), uint8_t bytes)
|
||||
static void count_bytes(struct pprz_transport *trans __attribute__((unused)), struct link_device *dev __attribute__((unused)), uint8_t bytes)
|
||||
{
|
||||
downlink.nb_bytes += bytes;
|
||||
}
|
||||
|
||||
static int check_available_space(struct pprz_transport *trans __attribute__((unused)), struct device *dev, uint8_t bytes)
|
||||
static int check_available_space(struct pprz_transport *trans __attribute__((unused)), struct link_device *dev, uint8_t bytes)
|
||||
{
|
||||
return dev->check_free_space(dev, bytes);
|
||||
}
|
||||
|
||||
@@ -48,13 +48,13 @@ struct pprzlog_transport pprzlog_tp;
|
||||
|
||||
#define STX_LOG 0x99
|
||||
|
||||
static void put_1byte(struct pprzlog_transport *trans, struct device *dev, const uint8_t byte)
|
||||
static void put_1byte(struct pprzlog_transport *trans, struct link_device *dev, const uint8_t byte)
|
||||
{
|
||||
trans->ck += byte;
|
||||
dev->transmit(dev->periph, byte);
|
||||
}
|
||||
|
||||
static void put_bytes(struct pprzlog_transport *trans, struct device *dev, enum TransportDataType type __attribute__((unused)), enum TransportDataFormat format __attribute__((unused)), uint8_t len, const void *bytes)
|
||||
static void put_bytes(struct pprzlog_transport *trans, struct link_device *dev, enum TransportDataType type __attribute__((unused)), enum TransportDataFormat format __attribute__((unused)), uint8_t len, const void *bytes)
|
||||
{
|
||||
const uint8_t *b = (const uint8_t *) bytes;
|
||||
int i;
|
||||
@@ -63,7 +63,7 @@ static void put_bytes(struct pprzlog_transport *trans, struct device *dev, enum
|
||||
}
|
||||
}
|
||||
|
||||
static void put_named_byte(struct pprzlog_transport *trans, struct device *dev, enum TransportDataType type __attribute__((unused)), enum TransportDataFormat format __attribute__((unused)), uint8_t byte, const char * name __attribute__((unused)))
|
||||
static void put_named_byte(struct pprzlog_transport *trans, struct link_device *dev, enum TransportDataType type __attribute__((unused)), enum TransportDataFormat format __attribute__((unused)), uint8_t byte, const char * name __attribute__((unused)))
|
||||
{
|
||||
put_1byte(trans, dev, byte);
|
||||
}
|
||||
@@ -73,7 +73,7 @@ static uint8_t size_of(struct pprzlog_transport *trans __attribute__((unused)),
|
||||
return len;
|
||||
}
|
||||
|
||||
static void start_message(struct pprzlog_transport *trans, struct device *dev, uint8_t payload_len)
|
||||
static void start_message(struct pprzlog_transport *trans, struct link_device *dev, uint8_t payload_len)
|
||||
{
|
||||
dev->transmit(dev->periph, STX_LOG);
|
||||
const uint8_t msg_len = size_of(trans, payload_len);
|
||||
@@ -83,21 +83,21 @@ static void start_message(struct pprzlog_transport *trans, struct device *dev, u
|
||||
put_bytes(trans, dev, DL_TYPE_TIMESTAMP, DL_FORMAT_SCALAR, 4, (uint8_t*)(&ts));
|
||||
}
|
||||
|
||||
static void end_message(struct pprzlog_transport *trans, struct device *dev)
|
||||
static void end_message(struct pprzlog_transport *trans, struct link_device *dev)
|
||||
{
|
||||
dev->transmit(dev->periph, trans->ck);
|
||||
dev->send_message(dev);
|
||||
}
|
||||
|
||||
static void overrun(struct pprzlog_transport *trans __attribute__((unused)), struct device *dev __attribute__((unused)))
|
||||
static void overrun(struct pprzlog_transport *trans __attribute__((unused)), struct link_device *dev __attribute__((unused)))
|
||||
{
|
||||
}
|
||||
|
||||
static void count_bytes(struct pprzlog_transport *trans __attribute__((unused)), struct device *dev __attribute__((unused)), uint8_t bytes __attribute__((unused)))
|
||||
static void count_bytes(struct pprzlog_transport *trans __attribute__((unused)), struct link_device *dev __attribute__((unused)), uint8_t bytes __attribute__((unused)))
|
||||
{
|
||||
}
|
||||
|
||||
static int check_available_space(struct pprzlog_transport *trans __attribute__((unused)), struct device *dev, uint8_t bytes)
|
||||
static int check_available_space(struct pprzlog_transport *trans __attribute__((unused)), struct link_device *dev, uint8_t bytes)
|
||||
{
|
||||
return dev->check_free_space(dev, bytes);
|
||||
}
|
||||
|
||||
@@ -178,7 +178,7 @@ static const uint8_t pn_bind[] = { 0x98, 0x88, 0x1B, 0xE4, 0x30, 0x79, 0x03, 0x8
|
||||
#if PERIODIC_TELEMETRY
|
||||
#include "subsystems/datalink/telemetry.h"
|
||||
|
||||
static void send_superbit(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_superbit(struct transport_tx *trans, struct link_device *dev) {
|
||||
uint8_t status = superbitrf.status;
|
||||
uint8_t cyrf6936_status = superbitrf.cyrf6936.status;
|
||||
pprz_msg_send_SUPERBITRF(trans, dev, AC_ID,
|
||||
|
||||
@@ -113,7 +113,7 @@ struct SuperbitRF {
|
||||
uint8_t tx_extract_idx; /**< The transmit buffer extract index */
|
||||
|
||||
/** Generic device interface */
|
||||
struct device device;
|
||||
struct link_device device;
|
||||
};
|
||||
|
||||
/* The superbitrf functions and structures */
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
/** Telemetry callback definition
|
||||
*/
|
||||
typedef void (*telemetry_cb)(struct transport_tx *trans, struct device *dev);
|
||||
typedef void (*telemetry_cb)(struct transport_tx *trans, struct link_device *dev);
|
||||
|
||||
/** Telemetry header
|
||||
*/
|
||||
|
||||
@@ -84,13 +84,13 @@ enum TransportDataFormat {
|
||||
* to store in the transport structure
|
||||
*/
|
||||
typedef uint8_t (*size_of_t)(void *, uint8_t);
|
||||
typedef int (*check_available_space_t)(void *, struct device *, uint8_t);
|
||||
typedef void (*put_bytes_t)(void *, struct device *, enum TransportDataType, enum TransportDataFormat, uint8_t, const void *);
|
||||
typedef void (*put_named_byte_t)(void *, struct device *, enum TransportDataType, enum TransportDataFormat, uint8_t, const char *);
|
||||
typedef void (*start_message_t)(void *, struct device *, uint8_t);
|
||||
typedef void (*end_message_t)(void *, struct device *);
|
||||
typedef void (*overrun_t)(void *, struct device *);
|
||||
typedef void (*count_bytes_t)(void *, struct device *, uint8_t);
|
||||
typedef int (*check_available_space_t)(void *, struct link_device *, uint8_t);
|
||||
typedef void (*put_bytes_t)(void *, struct link_device *, enum TransportDataType, enum TransportDataFormat, uint8_t, const void *);
|
||||
typedef void (*put_named_byte_t)(void *, struct link_device *, enum TransportDataType, enum TransportDataFormat, uint8_t, const char *);
|
||||
typedef void (*start_message_t)(void *, struct link_device *, uint8_t);
|
||||
typedef void (*end_message_t)(void *, struct link_device *);
|
||||
typedef void (*overrun_t)(void *, struct link_device *);
|
||||
typedef void (*count_bytes_t)(void *, struct link_device *, uint8_t);
|
||||
|
||||
/** Generic transmission transport header
|
||||
*/
|
||||
|
||||
@@ -56,7 +56,7 @@ struct w5100_periph {
|
||||
volatile uint8_t work_rx[4];
|
||||
uint8_t tx_running;
|
||||
/** Generic device interface */
|
||||
struct device device;
|
||||
struct link_device device;
|
||||
};
|
||||
|
||||
extern uint8_t w5100_rx_buf[W5100_RX_BUFFER_SIZE];
|
||||
|
||||
@@ -53,13 +53,13 @@ struct xbee_transport xbee_tp;
|
||||
|
||||
/** Xbee protocol implementation */
|
||||
|
||||
static void put_1byte(struct xbee_transport *trans, struct device *dev, const uint8_t byte)
|
||||
static void put_1byte(struct xbee_transport *trans, struct link_device *dev, const uint8_t byte)
|
||||
{
|
||||
trans->cs_tx += byte;
|
||||
dev->transmit(dev->periph, byte);
|
||||
}
|
||||
|
||||
static void put_bytes(struct xbee_transport *trans, struct device *dev, enum TransportDataType type __attribute__((unused)), enum TransportDataFormat format __attribute__((unused)), uint8_t len, const void *bytes)
|
||||
static void put_bytes(struct xbee_transport *trans, struct link_device *dev, enum TransportDataType type __attribute__((unused)), enum TransportDataFormat format __attribute__((unused)), uint8_t len, const void *bytes)
|
||||
{
|
||||
const uint8_t *b = (const uint8_t *) bytes;
|
||||
int i;
|
||||
@@ -68,7 +68,7 @@ static void put_bytes(struct xbee_transport *trans, struct device *dev, enum Tra
|
||||
}
|
||||
}
|
||||
|
||||
static void put_named_byte(struct xbee_transport *trans, struct device *dev, enum TransportDataType type __attribute__((unused)), enum TransportDataFormat format __attribute__((unused)), uint8_t byte, const char * name __attribute__((unused)))
|
||||
static void put_named_byte(struct xbee_transport *trans, struct link_device *dev, enum TransportDataType type __attribute__((unused)), enum TransportDataFormat format __attribute__((unused)), uint8_t byte, const char * name __attribute__((unused)))
|
||||
{
|
||||
put_1byte(trans, dev, byte);
|
||||
}
|
||||
@@ -79,7 +79,7 @@ static uint8_t size_of(struct xbee_transport *trans __attribute__((unused)), uin
|
||||
return len + XBEE_API_OVERHEAD + XBEE_TX_OVERHEAD;
|
||||
}
|
||||
|
||||
static void start_message(struct xbee_transport *trans, struct device *dev, uint8_t payload_len)
|
||||
static void start_message(struct xbee_transport *trans, struct link_device *dev, uint8_t payload_len)
|
||||
{
|
||||
downlink.nb_msgs++;
|
||||
dev->transmit(dev->periph, XBEE_START);
|
||||
@@ -91,24 +91,24 @@ static void start_message(struct xbee_transport *trans, struct device *dev, uint
|
||||
put_bytes(trans, dev, DL_TYPE_UINT8, DL_FORMAT_SCALAR, XBEE_TX_OVERHEAD + 1, header);
|
||||
}
|
||||
|
||||
static void end_message(struct xbee_transport *trans, struct device *dev)
|
||||
static void end_message(struct xbee_transport *trans, struct link_device *dev)
|
||||
{
|
||||
trans->cs_tx = 0xff - trans->cs_tx;
|
||||
dev->transmit(dev->periph, trans->cs_tx);
|
||||
dev->send_message(dev);
|
||||
}
|
||||
|
||||
static void overrun(struct xbee_transport *trans __attribute__((unused)), struct device *dev __attribute__((unused)))
|
||||
static void overrun(struct xbee_transport *trans __attribute__((unused)), struct link_device *dev __attribute__((unused)))
|
||||
{
|
||||
downlink.nb_ovrn++;
|
||||
}
|
||||
|
||||
static void count_bytes(struct xbee_transport *trans __attribute__((unused)), struct device *dev __attribute__((unused)), uint8_t bytes)
|
||||
static void count_bytes(struct xbee_transport *trans __attribute__((unused)), struct link_device *dev __attribute__((unused)), uint8_t bytes)
|
||||
{
|
||||
downlink.nb_bytes += bytes;
|
||||
}
|
||||
|
||||
static int check_available_space(struct xbee_transport *trans __attribute__((unused)), struct device *dev, uint8_t bytes)
|
||||
static int check_available_space(struct xbee_transport *trans __attribute__((unused)), struct link_device *dev, uint8_t bytes)
|
||||
{
|
||||
return dev->check_free_space(dev, bytes);
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ struct GpsTimeSync gps_time_sync;
|
||||
#if PERIODIC_TELEMETRY
|
||||
#include "subsystems/datalink/telemetry.h"
|
||||
|
||||
static void send_svinfo(struct transport_tx *trans, struct device *dev, uint8_t svid) {
|
||||
static void send_svinfo(struct transport_tx *trans, struct link_device *dev, uint8_t svid) {
|
||||
if (svid < GPS_NB_CHANNELS) {
|
||||
pprz_msg_send_SVINFO(trans, dev, AC_ID, &svid,
|
||||
&gps.svinfos[svid].svid, &gps.svinfos[svid].flags,
|
||||
@@ -55,13 +55,13 @@ static void send_svinfo(struct transport_tx *trans, struct device *dev, uint8_t
|
||||
}
|
||||
|
||||
/** send SVINFO message if there is information for satellite with svid */
|
||||
static inline void send_svinfo_available(struct transport_tx *trans, struct device *dev, uint8_t svid) {
|
||||
static inline void send_svinfo_available(struct transport_tx *trans, struct link_device *dev, uint8_t svid) {
|
||||
if (gps.svinfos[svid].cno > 0) {
|
||||
send_svinfo(trans, dev, svid);
|
||||
}
|
||||
}
|
||||
|
||||
static void send_gps(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_gps(struct transport_tx *trans, struct link_device *dev) {
|
||||
static uint8_t i;
|
||||
int16_t climb = -gps.ned_vel.z;
|
||||
int16_t course = (DegOfRad(gps.course)/((int32_t)1e6));
|
||||
@@ -80,7 +80,7 @@ static void send_gps(struct transport_tx *trans, struct device *dev) {
|
||||
i++;
|
||||
}
|
||||
|
||||
static void send_gps_int(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_gps_int(struct transport_tx *trans, struct link_device *dev) {
|
||||
static uint8_t i;
|
||||
static uint8_t last_cnos[GPS_NB_CHANNELS];
|
||||
pprz_msg_send_GPS_INT(trans, dev, AC_ID,
|
||||
@@ -102,7 +102,7 @@ static void send_gps_int(struct transport_tx *trans, struct device *dev) {
|
||||
i++;
|
||||
}
|
||||
|
||||
static void send_gps_lla(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_gps_lla(struct transport_tx *trans, struct link_device *dev) {
|
||||
uint8_t err = 0;
|
||||
int16_t climb = -gps.ned_vel.z;
|
||||
int16_t course = (DegOfRad(gps.course)/((int32_t)1e6));
|
||||
@@ -113,7 +113,7 @@ static void send_gps_lla(struct transport_tx *trans, struct device *dev) {
|
||||
&gps.fix, &err);
|
||||
}
|
||||
|
||||
static void send_gps_sol(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_gps_sol(struct transport_tx *trans, struct link_device *dev) {
|
||||
pprz_msg_send_GPS_SOL(trans, dev, AC_ID, &gps.pacc, &gps.sacc, &gps.pdop, &gps.num_sv);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -44,63 +44,63 @@
|
||||
|
||||
#if USE_IMU_FLOAT
|
||||
|
||||
static void send_accel(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_accel(struct transport_tx *trans, struct link_device *dev) {
|
||||
pprz_msg_send_IMU_ACCEL(trans, dev, AC_ID,
|
||||
&imuf.accel.x, &imuf.accel.y, &imuf.accel.z);
|
||||
}
|
||||
|
||||
static void send_gyro(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_gyro(struct transport_tx *trans, struct link_device *dev) {
|
||||
pprz_msg_send_IMU_GYRO(trans, dev, AC_ID,
|
||||
&imuf.gyro.p, &imuf.gyro.q, &imuf.gyro.r);
|
||||
}
|
||||
|
||||
#else // !USE_IMU_FLOAT
|
||||
|
||||
static void send_accel_raw(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_accel_raw(struct transport_tx *trans, struct link_device *dev) {
|
||||
pprz_msg_send_IMU_ACCEL_RAW(trans, dev, AC_ID,
|
||||
&imu.accel_unscaled.x, &imu.accel_unscaled.y, &imu.accel_unscaled.z);
|
||||
}
|
||||
|
||||
static void send_accel_scaled(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_accel_scaled(struct transport_tx *trans, struct link_device *dev) {
|
||||
pprz_msg_send_IMU_ACCEL_SCALED(trans, dev, AC_ID,
|
||||
&imu.accel.x, &imu.accel.y, &imu.accel.z);
|
||||
}
|
||||
|
||||
static void send_accel(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_accel(struct transport_tx *trans, struct link_device *dev) {
|
||||
struct FloatVect3 accel_float;
|
||||
ACCELS_FLOAT_OF_BFP(accel_float, imu.accel);
|
||||
pprz_msg_send_IMU_ACCEL(trans, dev, AC_ID,
|
||||
&accel_float.x, &accel_float.y, &accel_float.z);
|
||||
}
|
||||
|
||||
static void send_gyro_raw(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_gyro_raw(struct transport_tx *trans, struct link_device *dev) {
|
||||
pprz_msg_send_IMU_GYRO_RAW(trans, dev, AC_ID,
|
||||
&imu.gyro_unscaled.p, &imu.gyro_unscaled.q, &imu.gyro_unscaled.r);
|
||||
}
|
||||
|
||||
static void send_gyro_scaled(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_gyro_scaled(struct transport_tx *trans, struct link_device *dev) {
|
||||
pprz_msg_send_IMU_GYRO_SCALED(trans, dev, AC_ID,
|
||||
&imu.gyro.p, &imu.gyro.q, &imu.gyro.r);
|
||||
}
|
||||
|
||||
static void send_gyro(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_gyro(struct transport_tx *trans, struct link_device *dev) {
|
||||
struct FloatRates gyro_float;
|
||||
RATES_FLOAT_OF_BFP(gyro_float, imu.gyro);
|
||||
pprz_msg_send_IMU_GYRO(trans, dev, AC_ID,
|
||||
&gyro_float.p, &gyro_float.q, &gyro_float.r);
|
||||
}
|
||||
|
||||
static void send_mag_raw(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_mag_raw(struct transport_tx *trans, struct link_device *dev) {
|
||||
pprz_msg_send_IMU_MAG_RAW(trans, dev, AC_ID,
|
||||
&imu.mag_unscaled.x, &imu.mag_unscaled.y, &imu.mag_unscaled.z);
|
||||
}
|
||||
|
||||
static void send_mag_scaled(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_mag_scaled(struct transport_tx *trans, struct link_device *dev) {
|
||||
pprz_msg_send_IMU_MAG_SCALED(trans, dev, AC_ID,
|
||||
&imu.mag.x, &imu.mag.y, &imu.mag.z);
|
||||
}
|
||||
|
||||
static void send_mag(struct transport_tx *trans, struct device *dev) {
|
||||
static void send_mag(struct transport_tx *trans, struct link_device *dev) {
|
||||
struct FloatVect3 mag_float;
|
||||
MAGS_FLOAT_OF_BFP(mag_float, imu.mag);
|
||||
pprz_msg_send_IMU_MAG(trans, dev, AC_ID,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user