mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-30 18:33:38 +08:00
commander remove continuous param_get in arm_auth_update
This commit is contained in:
committed by
Lorenz Meier
parent
641129ad4e
commit
49180de27c
@@ -179,9 +179,11 @@ uint8_t arm_auth_check()
|
|||||||
return vehicle_command_ack_s::VEHICLE_RESULT_DENIED;
|
return vehicle_command_ack_s::VEHICLE_RESULT_DENIED;
|
||||||
}
|
}
|
||||||
|
|
||||||
void arm_auth_update(hrt_abstime now)
|
void arm_auth_update(hrt_abstime now, bool param_update)
|
||||||
{
|
{
|
||||||
param_get(param_arm_parameters, (int32_t*)&arm_parameters);
|
if (param_update) {
|
||||||
|
param_get(param_arm_parameters, (int32_t*)&arm_parameters);
|
||||||
|
}
|
||||||
|
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case ARM_AUTH_WAITING_AUTH:
|
case ARM_AUTH_WAITING_AUTH:
|
||||||
|
|||||||
@@ -45,6 +45,6 @@ enum arm_auth_methods {
|
|||||||
};
|
};
|
||||||
|
|
||||||
void arm_auth_init(orb_advert_t *mav_log_pub, uint8_t *system_id);
|
void arm_auth_init(orb_advert_t *mav_log_pub, uint8_t *system_id);
|
||||||
void arm_auth_update(hrt_abstime now);
|
void arm_auth_update(hrt_abstime now, bool param_update = true);
|
||||||
uint8_t arm_auth_check();
|
uint8_t arm_auth_check();
|
||||||
enum arm_auth_methods arm_auth_method_get();
|
enum arm_auth_methods arm_auth_method_get();
|
||||||
|
|||||||
@@ -1704,9 +1704,10 @@ Commander::run()
|
|||||||
arming_ret = TRANSITION_NOT_CHANGED;
|
arming_ret = TRANSITION_NOT_CHANGED;
|
||||||
|
|
||||||
/* update parameters */
|
/* update parameters */
|
||||||
orb_check(param_changed_sub, &updated);
|
bool params_updated = false;
|
||||||
|
orb_check(param_changed_sub, ¶ms_updated);
|
||||||
|
|
||||||
if (updated || param_init_forced) {
|
if (params_updated || param_init_forced) {
|
||||||
|
|
||||||
/* parameters changed */
|
/* parameters changed */
|
||||||
struct parameter_update_s param_changed;
|
struct parameter_update_s param_changed;
|
||||||
@@ -3189,7 +3190,7 @@ Commander::run()
|
|||||||
have_taken_off_since_arming = false;
|
have_taken_off_since_arming = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
arm_auth_update(now);
|
arm_auth_update(now, params_updated || param_init_forced);
|
||||||
|
|
||||||
usleep(COMMANDER_MONITORING_INTERVAL);
|
usleep(COMMANDER_MONITORING_INTERVAL);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user