forked from Archive/PX4-Autopilot
CPU resource check: use class member and fix param description
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
parent
c054bc2370
commit
fd009c8be3
|
@ -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) {
|
||||
|
|
|
@ -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<px4::params::COM_CPU_MAX>) _param_com_cpu_max
|
||||
)
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue