Commit Graph

70 Commits

Author SHA1 Message Date
Andrew Tridgell
4e799be144 AP_Scheduler: use fill_nanf() on each scheduler function 2020-02-05 10:10:37 +11:00
Andrew Tridgell
ae4bcf0f6f 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-22 21:08:34 +10:00
Andrew Tridgell
4027d61e17 AP_Scheduler: log I2C ISR count 2019-08-26 09:13:39 +10:00
Peter Barker
cc7044b360 AP_Scheduler: include internal error count in PM log message 2019-06-12 10:05:59 +10:00
Andrew Tridgell
4888583e17 AP_Scheduler: use task -3 for wait_for_sample() 2019-05-17 09:00:22 +10:00
Andrew Tridgell
e801821f0c AP_Scheduler: log SPI and I2C counters in PM msg 2019-05-17 08:56:06 +10:00
Andrew Tridgell
49061aae67 AP_Scheduler: use persistent_data for current_task 2019-05-15 15:33:48 +10:00
Peter Barker
82f8a7fa1b AP_Scheduler: include internal errors in dataflash PM message 2019-03-21 21:34:33 +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
6fc76a32af GLOBAL: use AP::logger() and strip redundant Log_ from methods 2019-01-18 18:08:20 +11:00
Peter Barker
b47733142f GLOBAL: rename DataFlash_Class to AP_Logger 2019-01-18 18:08:20 +11:00
Peter Barker
01e0c03a12 AP_Scheduler: add singleton 2018-06-15 08:01:22 +10:00
Peter Barker
c4ea83177f AP_Scheduler: remove unused ins error count logging 2018-04-04 14:21:20 +01:00
Peter Barker
d5c57d949b AP_Scheduler: eliminate goto update_spare_ticks 2018-03-22 10:01:45 +11:00
Peter Barker
badfde6f18 AP_Scheduler: use continue instead of nested-if (NFC) 2018-03-22 10:01:45 +11:00
Peter Barker
224ea50260 AP_Scheduler: continue in place of nested if (NFC) 2018-03-22 10:01:45 +11:00
Mark Whitehorn
919383a739 AP_Scheduler: add load_average() to PM log message 2018-02-21 23:53:08 +10:00
Andrew Tridgell
6cc007598e AP_Scheduler: initialise _last_loop_time_s in init() 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
f436901517 AP_Scheduler: fixed perf info to match previous behaviour 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
24d6493453 AP_Scheduler: make loop times cover INS wait_for_sample
this matches past behaviour, and gives much more useful information to
a user wanting to know if their board it meeting its desired loop rate
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
baa6e04854 AP_Scheduler: change loop time to remove sleeping in wait_for_sample 2018-02-13 17:15:05 +11:00
Peter Barker
4909000441 AP_Scheduler: implement loop() 2018-02-13 17:15:05 +11:00
Andrew Tridgell
8dcf89b2b7 AP_Scheduler: put scheduler debug on console 2018-02-08 17:36:33 +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
Andrew Tridgell
44dd079cb9 AP_Scheduler: allow for loop rates above 400Hz
with ChibiOS we can run copter at 1KHz with no scheduling misses. This
small PR allows that to be configured.
2018-01-20 10:40:37 +11: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
Andrew Tridgell
56aa467d60 AP_Scheduler: adjust debug levels
this is more useful for performance analysis of scheduler, using perf
command
2017-05-01 15:02:34 +10:00
jaxxzer
ccb6434831 AP_Scheduler: Set main loop rate to 400hz for Sub 2017-02-21 11:26:14 +11: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
7721290160 AP_Scheduler:time_available value type invalid uint16_t to valid uint32_t. 2016-07-25 20:18:16 -03:00
Andrew Tridgell
63d0c040e4 AP_Scheduler: expose loop rate on all builds
as discussed with Randy
2016-06-17 15:02:28 +10:00
Andrew Tridgell
fb4cdafef8 AP_Scheduler: allow SCHED_LOOP_RATE for copter in SITL
very useful for slow simulation environment
2016-06-17 15:01:18 +10:00
Andrew Tridgell
ced4cce358 AP_Scheduler: added optional perf counters at SCHED_DEBUG >= 4 2016-04-21 16:45:02 +10:00
Andrew Tridgell
cc25575b3a AP_Scheduler: prevent a startup crash in autotest for Rover 2016-01-05 16:31:06 +11:00
Andrew Tridgell
c3829dfb64 AP_Scheduler: allow for arbitrary loop rates
it turns out 300Hz is pretty useful as it allows for triple EKF on
pixhawk
2016-01-04 08:37:31 +11:00
Lucas De Marchi
eb9fd96d5c AP_Scheduler: remove trailing whitespace 2015-12-27 15:58:12 -02:00
Lucas De Marchi
3375b6b01c AP_Scheduler: stop using Progmem.h 2015-12-27 15:58:12 -02:00
Andrew Tridgell
1b1be7e4a2 AP_Scheduler: switch to Hz based scheduler config 2015-12-27 14:57:06 +09:00
Caio Marcelo de Oliveira Filho
81186e5416 AP_Scheduler: use millis/micros/panic functions 2015-11-20 12:34:17 +09:00
Lucas De Marchi
5244559010 Minimize AP_Progmem.h includes
Most of AP_Progmem is already gone so we can stop including it in most
of the places. The only places that need it are the ones using
pgm_read_*() APIs.

In some cases the header needed to be added in the .cpp since it was
removed from the .h to reduce scope. In those cases the headers were
also reordered.
2015-10-30 14:35:32 +09:00
Lucas De Marchi
20c6ffc5e3 Replace use of UARTDriver::printf_P() with UARTDriver::printf()
This also starts to show warnings on places that were already using
wrong printf format strings.
2015-10-30 14:35:25 +09:00
Lucas De Marchi
831d8acca5 Remove use of PROGMEM
Now variables don't have to be declared with PROGMEM anymore, so remove
them. This was automated with:

    git grep -l -z PROGMEM | xargs -0 sed -i 's/ PROGMEM / /g'
    git grep -l -z PROGMEM | xargs -0 sed -i 's/PROGMEM//g'

The 2 commands were done so we don't leave behind spurious spaces.

AVR-specific places were not changed.
2015-10-30 14:35:16 +09:00
Lucas De Marchi
2c38e31c93 Remove use of PSTR
The PSTR is already define as a NOP for all supported platforms. It's
only needed for AVR so here we remove all the uses throughout the
codebase.

This was automated with a simple python script so it also converts
places which spans to multiple lines, removing the matching parentheses.

AVR-specific places were not changed.
2015-10-30 14:35:04 +09:00
Gustavo Jose de Sousa
53b5b70960 AP_Scheduler: use also task name besides the id for logging
This makes it easier to identify for which task a log line is.
2015-09-01 20:22:19 +10:00