From eda23dec19e50b03796e642ae6f2ef22f93fae74 Mon Sep 17 00:00:00 2001 From: Felix Ruess Date: Wed, 1 Jul 2015 22:07:31 +0200 Subject: [PATCH] [rotorcraft] guidance_h: make some vars private --- conf/settings/control/rotorcraft_guidance.xml | 2 +- .../firmwares/rotorcraft/guidance/guidance_h.c | 14 +++++++++++--- .../firmwares/rotorcraft/guidance/guidance_h.h | 10 +--------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/conf/settings/control/rotorcraft_guidance.xml b/conf/settings/control/rotorcraft_guidance.xml index 162301c73f4..5181526b5ea 100644 --- a/conf/settings/control/rotorcraft_guidance.xml +++ b/conf/settings/control/rotorcraft_guidance.xml @@ -21,7 +21,7 @@ - + diff --git a/sw/airborne/firmwares/rotorcraft/guidance/guidance_h.c b/sw/airborne/firmwares/rotorcraft/guidance/guidance_h.c index 89546b75e76..cce9a602fca 100644 --- a/sw/airborne/firmwares/rotorcraft/guidance/guidance_h.c +++ b/sw/airborne/firmwares/rotorcraft/guidance/guidance_h.c @@ -82,9 +82,6 @@ struct Int32Vect2 guidance_h_accel_ref; #if GUIDANCE_H_USE_SPEED_REF struct Int32Vect2 guidance_h_speed_sp; #endif -struct Int32Vect2 guidance_h_pos_err; -struct Int32Vect2 guidance_h_speed_err; -struct Int32Vect2 guidance_h_trim_att_integrator; struct Int32Vect2 guidance_h_cmd_earth; struct Int32Eulers guidance_h_rc_sp; @@ -99,6 +96,11 @@ int32_t guidance_h_vgain; int32_t transition_percentage; int32_t transition_theta_offset; +/* internal variables */ +struct Int32Vect2 guidance_h_pos_err; +struct Int32Vect2 guidance_h_speed_err; +struct Int32Vect2 guidance_h_trim_att_integrator; + static void guidance_h_update_reference(void); static void guidance_h_traj_run(bool_t in_flight); @@ -587,3 +589,9 @@ static void read_rc_setpoint_speed_i(struct Int32Vect2 *speed_sp, bool_t in_flig speed_sp->y = 0; } } + +void guidance_h_set_igain(uint32_t igain) +{ + guidance_h_igain = igain; + INT_VECT2_ZERO(guidance_h_trim_att_integrator); +} diff --git a/sw/airborne/firmwares/rotorcraft/guidance/guidance_h.h b/sw/airborne/firmwares/rotorcraft/guidance/guidance_h.h index 626ae4a7e86..7c0ea444d92 100644 --- a/sw/airborne/firmwares/rotorcraft/guidance/guidance_h.h +++ b/sw/airborne/firmwares/rotorcraft/guidance/guidance_h.h @@ -74,11 +74,6 @@ extern struct Int32Vect2 guidance_h_pos_ref; ///< with #INT32_POS_FRAC extern struct Int32Vect2 guidance_h_speed_ref; ///< with #INT32_SPEED_FRAC extern struct Int32Vect2 guidance_h_accel_ref; ///< with #INT32_ACCEL_FRAC -extern struct Int32Vect2 guidance_h_pos_err; -extern struct Int32Vect2 guidance_h_speed_err; -extern struct Int32Vect2 guidance_h_trim_att_integrator; - - /** horizontal guidance command. * In north/east with #INT32_ANGLE_FRAC * @todo convert to real force command @@ -101,11 +96,8 @@ extern void guidance_h_mode_changed(uint8_t new_mode); extern void guidance_h_read_rc(bool_t in_flight); extern void guidance_h_run(bool_t in_flight); +extern void guidance_h_set_igain(uint32_t igain); -#define guidance_h_SetKi(_val) { \ - guidance_h_igain = _val; \ - INT_VECT2_ZERO(guidance_h_trim_att_integrator); \ - } /* Make sure that ref can only be temporarily disabled for testing, * but not enabled if GUIDANCE_H_USE_REF was defined to FALSE.