mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-21 07:33:33 +08:00
CPU resource check: use class member and fix param description
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
committed by
Matthias Grob
parent
c054bc2370
commit
fd009c8be3
@@ -41,8 +41,6 @@ void CpuResourceChecks::checkAndReport(const Context &context, Report &reporter)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
static hrt_abstime high_cpu_load_start_time_us_ = 0;
|
|
||||||
|
|
||||||
cpuload_s cpuload;
|
cpuload_s cpuload;
|
||||||
|
|
||||||
if (!_cpuload_sub.copy(&cpuload) || hrt_elapsed_time(&cpuload.timestamp) > 2_s) {
|
if (!_cpuload_sub.copy(&cpuload) || hrt_elapsed_time(&cpuload.timestamp) > 2_s) {
|
||||||
|
|||||||
@@ -49,6 +49,8 @@ public:
|
|||||||
private:
|
private:
|
||||||
uORB::Subscription _cpuload_sub{ORB_ID(cpuload)};
|
uORB::Subscription _cpuload_sub{ORB_ID(cpuload)};
|
||||||
|
|
||||||
|
hrt_abstime high_cpu_load_start_time_us_{0};
|
||||||
|
|
||||||
DEFINE_PARAMETERS_CUSTOM_PARENT(HealthAndArmingCheckBase,
|
DEFINE_PARAMETERS_CUSTOM_PARENT(HealthAndArmingCheckBase,
|
||||||
(ParamFloat<px4::params::COM_CPU_MAX>) _param_com_cpu_max
|
(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.
|
* Maximum allowed CPU load to still arm.
|
||||||
|
*
|
||||||
* The check fails if the CPU load is above this threshold for 2s.
|
* The check fails if the CPU load is above this threshold for 2s.
|
||||||
*
|
*
|
||||||
* A negative value disables the check.
|
* A negative value disables the check.
|
||||||
|
|||||||
Reference in New Issue
Block a user