1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-19 22:35:23 +03:00

Use cpu_late_10ths_percent_limit to set limit on % of late tasks in 10th of a % (#13330)

* Use cpu_late_10ths_percent_limit to set limit on % of late tasks in 10th of a %
Set CPU load late limit to 1% based on testing

* Update src/main/cli/settings.c

Co-authored-by: Jan Post <Rm2k-Freak@web.de>

* Update src/main/scheduler/scheduler.h

Co-authored-by: Jan Post <Rm2k-Freak@web.de>

* Update src/main/fc/core.c

* Update src/test/unit/arming_prevention_unittest.cc

* Update src/main/scheduler/scheduler.c

---------

Co-authored-by: Mark Haslinghuis <mark@numloq.nl>
Co-authored-by: Jan Post <Rm2k-Freak@web.de>
This commit is contained in:
Steve Evans 2024-02-15 11:50:32 +00:00 committed by GitHub
parent a190ed98dc
commit e3e67b2ecb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 38 additions and 2 deletions

View file

@ -323,11 +323,13 @@ void updateArmingStatus(void)
unsetArmingDisabled(ARMING_DISABLED_ANGLE);
}
if (getAverageSystemLoadPercent() > LOAD_PERCENTAGE_ONE) {
#if defined(USE_LATE_TASK_STATISTICS)
if ((getCpuPercentageLate() > schedulerConfig()->cpuLatePercentageLimit)) {
setArmingDisabled(ARMING_DISABLED_LOAD);
} else {
unsetArmingDisabled(ARMING_DISABLED_LOAD);
}
#endif // USE_LATE_TASK_STATISTICS
if (isCalibrating()) {
setArmingDisabled(ARMING_DISABLED_CALIBRATING);