Commit Graph

61 Commits

Author SHA1 Message Date
Peter Barker 8b13413f43 AP_Scheduler: add and use AP_SCHEDULER_EXTENDED_TASKINFO_ENABLED 2023-06-27 10:43:39 +10:00
Peter Barker 435214852e AP_Scheduler: add and use AP_Scheduler_config.h 2023-06-27 10:43:39 +10:00
Peter Barker 3e84eb2358 AP_Scheduler: rename HAL_SCHEDULER_ENABLED to AP_SCHEDULER_ENABLED
there's AP_HAL::Scheduler which confuses this
2023-02-28 11:26:04 +11:00
Andrew Tridgell 5f6d3e5d8c AP_Scheduler: added ticks32() API
this is the number of scheduler ticks since boot, as uint32_t
2023-01-29 15:28:43 +11:00
Randy Mackay d9aa366b59 AP_Scheduler: add get_filtered_loop_rate_hz 2022-12-06 11:00:51 +11:00
jackhong12 4a4f361a17 all: use CLASS_NO_COPY() macro 2022-10-04 11:23:04 +11:00
Andy Piper 2209576c90 AP_Scheduler: refactor task info into TaskInfo
break fast_loop down into FastTasks to aid profiling
run fast tasks before scheduled tasks
fix scheduler example
introduce fast task priorities
remove fast loop
2022-05-03 08:20:13 +09:00
Peter Barker 27b34f8b5f AP_Scheduler: tidy includes 2022-05-03 09:14:58 +10:00
Jaaaky e92c900b56 AP_Scheduler: Fix multi #include's 2021-12-21 10:38:46 +11:00
Peter Barker e1310b2082 AP_Scheduler: allow specification of Scheduler table priorities 2021-11-17 19:00:04 +11:00
Peter Barker ef2e273ee6 AP_Scheduler: add support for AP_Logger into AP_Periph 2021-06-08 09:57:55 +10:00
Andrew Tridgell f6ec48e0e2 AP_Scheduler: removed perf counters 2021-06-07 14:29:27 +10:00
Patrick José Pereira 806bc4898b AP_Scheduler: Add missing const in member functions
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
2021-02-03 18:45:14 +11:00
Andrew Tridgell 6da0212ce4 AP_Scheduler: use ExpandingString class 2021-01-05 10:52:00 +11:00
Andy Piper 5b5b9d57a1 AP_Scheduler: add per-task performance information accesible from @SYS/tasks.txt
print fully qualified name on most boards
remove old task slip message
Don't die on allocation failure.
dynamically allocation/free task info based on SCHED_OPTIONS
dynamically enable task info on ftp get
2020-09-09 17:06:12 +10:00
Andy Piper a16bb2f188 AP_Scheduler: allow registration of tasks at loop rate 2020-02-22 11:15:37 +11:00
Michael du Breuil c257cea375 AP_Scheduler: Add a lock that is held during all normal operations 2020-02-18 09:16:10 +11:00
Andy Piper debc13965a AP_Scheduler: add common tasks from AP_Vehicle and manage them 2019-12-30 13:02:04 +11:00
Andrew Tridgell 79acaeaef1 AP_Scheduler: cope with high CPU load by stretching loop times
this adds an extra budget of time per loop when we are not achieving
scheduled tasks at a rate of at least 1/8 of the desired rate. This
fixes an issue where a vehicle can become uncontrollable if the user
asks for a SCHED_LOOP_RATE which is not achievable. As these events
happen we add extra loop budget until we are able to run all tasks. We
drop the extra time when the CPU pressure eases.
2019-09-19 18:25:20 +10:00
Andrew Tridgell 49061aae67 AP_Scheduler: use persistent_data for current_task 2019-05-15 15:33:48 +10:00
Peter Barker 85b737db31 AP_Scheduler: add floating point specifier on constant 2019-04-05 23:04:17 -07:00
Tom Pittenger e9bb6a7d69 AP_Scheduler: rename dataflash to logger 2019-03-28 16:40:57 +11:00
Tom Pittenger 155a1b7ec7 AP_Scheduler: unify singleton naming to _singleton and get_singleton() 2019-02-10 19:09:58 -07:00
Peter Barker 01e0c03a12 AP_Scheduler: add singleton 2018-06-15 08:01:22 +10:00
Andrew Tridgell 8907cb3b23 AP_Scheduler: time in seconds should be a float 2018-02-13 17:15:05 +11:00
Andrew Tridgell 491715bec7 AP_Scheduler: added get_last_loop_time_s()
this gives compatibility with previous G_Dt in copter
2018-02-13 17:15:05 +11:00
Andrew Tridgell e0c9d9b592 AP_Scheduler: fixed loop time available 2018-02-13 17:15:05 +11:00
Andrew Tridgell 620d6ab4b8 AP_Scheduler: fixed merge issues 2018-02-13 17:15:05 +11:00
Peter Barker 73c0905b5e AP_Scheduler: pass log-performance-bit at init time rather than update time 2018-02-13 17:15:05 +11:00
Peter Barker 4672e9d4eb AP_Scheduler: resolve debug name conflict 2018-02-13 17:15:05 +11:00
Peter Barker d3c1b720c6 AP_Scheduler: move logging of PM messages to AP_Scheduler 2018-02-13 17:15:05 +11:00
Peter Barker d151b27e92 AP_Scheduler: move PERF: statustext sending into AP_Scheduler 2018-02-13 17:15:05 +11:00
Peter Barker 4909000441 AP_Scheduler: implement loop() 2018-02-13 17:15:05 +11:00
Peter Barker e713802c24 AP_Scheduler: add accessor for tick counter 2018-02-13 17:15:05 +11:00
Andrew Tridgell 8b0e9bcff4 AP_Scheduler: use pre-computed loop constants
this prevents changing the loop rate without a reboot. Too many
subsystems rely on a consistent loop rate to allow it to be changed
2018-01-20 15:35:58 +11:00
Peter Barker f2242e07db AP_Scheduler: remove memoisation in loop_period_s() 2018-01-20 15:35:58 +11:00
Peter Barker a6ac37d0ba AP_Scheduler: eliminate MAIN_LOOP_SECONDS macro 2018-01-20 15:35:58 +11:00
Andrew Tridgell 580af4a69a AP_Scheduler: removed create() method for objects
See discussion here:

  https://github.com/ArduPilot/ardupilot/issues/7331

we were getting some uninitialised variables. While it only showed up in
AP_SbusOut, it means we can't be sure it won't happen on other objects,
so safest to remove the approach

Thanks to assistance from Lucas, Peter and Francisco
2017-12-14 08:12:28 +11:00
Lucas De Marchi d3e12eb899 AP_Scheduler: add static create method 2017-09-26 03:01:21 +01:00
Peter Barker b445313bf1 AP_Scheduler: remove loop-period argument from load_average
This now comes from a parameter rather than being hard-set
in the vehicle code

Also adds a method returning the max loop period based on the
loop rate
2017-08-01 19:39:27 +01:00
Mathieu OTHACEHE 152edf7189 Global: remove mode line from headers
Using a global .dir-locals.el file is a better alternative than
reincluding the same emacs header in every file of the project.
2016-10-24 09:42:01 -02:00
murata bb1a787852 AP_Scheduler: To add a comment to _loop_rate_hz variable. 2016-10-16 00:02:40 -07:00
murata 7721290160 AP_Scheduler:time_available value type invalid uint16_t to valid uint32_t. 2016-07-25 20:18:16 -03:00
Andrew Tridgell ced4cce358 AP_Scheduler: added optional perf counters at SCHED_DEBUG >= 4 2016-04-21 16:45:02 +10:00
Lucas De Marchi f5437f30ac AP_Scheduler: replace header guard with pragma once 2016-02-18 14:52:35 -02:00
Andrew Tridgell 1b1be7e4a2 AP_Scheduler: switch to Hz based scheduler config 2015-12-27 14:57:06 +09:00
Gustavo Jose de Sousa 8fe466ce27 AP_Scheduler: add initializer for task field "name"
We use define it as an empty macro if on AVR board.
2015-09-01 20:22:18 +10:00
Gustavo Jose de Sousa 8018748fe2 AP_Scheduler: add field "name" to task structure for logging purposes
That field will be useful for logging as it is easier to know what task a log
is related to by using the task's name rather than using the number.
2015-09-01 20:22:18 +10:00
Gustavo Jose de Sousa c04b984e6c AP_Scheduler: standardize inclusion of libaries headers
This commit changes the way libraries headers are included in source files:

 - If the header is in the same directory the source belongs to, so the
 notation '#include ""' is used with the path relative to the directory
 containing the source.

 - If the header is outside the directory containing the source, then we use
 the notation '#include <>' with the path relative to libraries folder.

Some of the advantages of such approach:

 - Only one search path for libraries headers.

 - OSs like Windows may have a better lookup time.
2015-08-11 16:38:23 +10:00
Andrew Tridgell dd691ae75c AP_Scheduler: all vehicles now use functors 2015-06-01 15:18:31 +10:00