mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-03 06:28:27 -04:00
AP_Scheduler: PerfInfo: allow specification of loop rate
This commit is contained in:
parent
d1781532d4
commit
ae9d4d514d
@ -23,7 +23,13 @@ public:
|
||||
uint32_t get_avg_time() const;
|
||||
uint32_t get_stddev_time() const;
|
||||
|
||||
void set_loop_rate(uint16_t rate_hz) {
|
||||
// allow a 20% overrun before we consider a loop "slow":
|
||||
overtime_threshold_micros = 1000000/rate_hz * 1.2f;
|
||||
}
|
||||
|
||||
private:
|
||||
uint16_t overtime_threshold_micros;
|
||||
uint16_t loop_count;
|
||||
uint32_t max_time; // in microseconds
|
||||
uint32_t min_time; // in microseconds
|
||||
@ -33,6 +39,7 @@ private:
|
||||
uint32_t log_dropped;
|
||||
uint32_t overtime_threshold_us;
|
||||
bool ignore_loop;
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user