diff --git a/src/modules/commander/HealthAndArmingChecks/checks/cpuResourceCheck.cpp b/src/modules/commander/HealthAndArmingChecks/checks/cpuResourceCheck.cpp index 6a142ba73b..51df7df324 100644 --- a/src/modules/commander/HealthAndArmingChecks/checks/cpuResourceCheck.cpp +++ b/src/modules/commander/HealthAndArmingChecks/checks/cpuResourceCheck.cpp @@ -41,8 +41,6 @@ void CpuResourceChecks::checkAndReport(const Context &context, Report &reporter) return; } - static hrt_abstime high_cpu_load_start_time_us_ = 0; - cpuload_s cpuload; if (!_cpuload_sub.copy(&cpuload) || hrt_elapsed_time(&cpuload.timestamp) > 2_s) { diff --git a/src/modules/commander/HealthAndArmingChecks/checks/cpuResourceCheck.hpp b/src/modules/commander/HealthAndArmingChecks/checks/cpuResourceCheck.hpp index c2582d171f..22f0007015 100644 --- a/src/modules/commander/HealthAndArmingChecks/checks/cpuResourceCheck.hpp +++ b/src/modules/commander/HealthAndArmingChecks/checks/cpuResourceCheck.hpp @@ -49,6 +49,8 @@ public: private: uORB::Subscription _cpuload_sub{ORB_ID(cpuload)}; + hrt_abstime high_cpu_load_start_time_us_{0}; + DEFINE_PARAMETERS_CUSTOM_PARENT(HealthAndArmingCheckBase, (ParamFloat) _param_com_cpu_max ) diff --git a/src/modules/commander/commander_params.c b/src/modules/commander/commander_params.c index b84fdeff6b..121fa14236 100644 --- a/src/modules/commander/commander_params.c +++ b/src/modules/commander/commander_params.c @@ -920,6 +920,7 @@ PARAM_DEFINE_FLOAT(COM_KILL_DISARM, 5.0f); /** * Maximum allowed CPU load to still arm. + * * The check fails if the CPU load is above this threshold for 2s. * * A negative value disables the check.