1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-24 16:55:36 +03:00
Commit graph

64 commits

Author SHA1 Message Date
Martin Luessi
f3464d90cc Flashfs: Add support for asynchronous complete erase 2022-07-08 06:48:56 -07:00
Štěpán Dalecký
f85ebba6a4 Refactoring of IMU and ACC 2022-06-28 18:26:10 +02:00
J Blackman
eb31068614
Merge pull request #11500 from klutvott123/crsf-baud-negotiation-improvements-2
Fix CRSF baud negotiation
2022-04-22 10:31:25 +10:00
Hans Christian Olaussen
205b8cd2ad Initialize tasks data earlier 2022-04-16 16:01:50 +02:00
Hans Christian Olaussen
97b934a436 Change speed negotiation task priority
from lowest to low. same as telemetry task. should make it run more often when in failsafe for example
2022-04-15 17:53:15 +02:00
haslinghuis
5b5df65934
Merge pull request #11439 from SteveCEvans/compass_timing
Perform compass reads in the background
2022-03-01 21:37:07 +01:00
Steve Evans
fc8640154a Interrupt/DMA driven SX1280 interaction for ELRS 2022-02-28 19:50:36 +00:00
Steve Evans
8ac81f86b2 Perform compass reads in the background 2022-02-27 14:24:55 +00:00
Steve Evans
cc67b2e87c Naming changes suggested by Hydra 2022-01-28 20:31:47 +00:00
Mark Haslinghuis
a1a383d812 Rename attr
Keep single and plurar definition
2022-01-17 03:10:16 +01:00
Steve Evans
e7b61a928f Still update duration of next anticipated state even is current execution time is ignored 2022-01-14 03:22:52 +00:00
Steve Evans
c05ad2ec9b Fix issues impacting RX_STATE_MODES state duration and add DEBUG_RX_STATE_TIME 2022-01-12 23:38:03 +00:00
haslinghuis
8d52a36150
Merge pull request #11269 from SteveCEvans/rx_timing
Ignore duration of calcActiveAdjustmentRanges() and optimize RX_TASK_DECAY_SHIFT
2022-01-11 17:28:23 +01:00
J Blackman
51f870f1e8
Merge pull request #11261 from daleckystepan/tasks
Rename task id to task attr
2022-01-11 10:37:53 +11:00
Steve Evans
1526adfb44 Ignore duration of calcActiveAdjustmentRanges() and optimize RX_TASK_DECAY_SHIFT 2022-01-10 18:45:37 +00:00
Steve Evans
c71302b35f Set CAMCTL task priority to TASK_PRIORITY_LOW 2022-01-09 23:10:01 +00:00
Štěpán Dalecký
a2debf5fbf Rename task id to task attr 2022-01-09 20:46:32 +01:00
Steve Evans
f5ee6cfd08 Ignore time taken to update profile with stick commands 2022-01-06 01:18:19 +00:00
Steve Evans
573984eb2a Support dynamic priority for all tasks priorities 2022-01-06 01:18:18 +00:00
Steve Evans
9bdf9c11e9 Split initialised/non-initialised task data 2022-01-06 01:18:17 +00:00
Steve Evans
7f147479fc If GPS serial data remains, reschedule task to run again after 1ms 2021-12-20 07:48:06 +00:00
Steve Evans
29d221502e Use peak tracking as default for task duration estimation rather than a moving average 2021-12-17 22:09:52 +00:00
Steve Evans
ab1baccc66 Track state execution time for OSD, baro, rx and GPS tasks and inform scheduler of next state execution time 2021-12-17 15:40:01 +00:00
Steve Evans
d5f62be013 Trigger gyro SPI DMA reads in EXTI handler if supported and lock gyroTask loop to gyro to eliminate missed updates and jitter 2021-09-28 01:38:18 +13:00
Steve Evans
3087d10f53 Report task rate/Hz based on execution of whole state machine, not individual states where appropriate 2021-05-20 18:27:27 +01:00
tbs-fpv
761a0d2b1f cosmetic changes & minor improvements on speed negotiation logic 2021-05-20 11:09:35 +08:00
tbs-fpv
5ec30726a9 support baud rate negotiation if telemetry is disabled 2021-05-10 13:32:16 +08:00
mikeller
82ff9fb007 Fixed RX task check. 2021-03-31 08:21:26 +13:00
Steve Evans
25fcacf4c5 Split rx processing into three states to eliminate cycle time jitter
Allow tasks with state machines to control which state determines task duration

Fix unit tests
2021-03-27 23:28:41 +00:00
Bruce Luckcuck
f7d992b2bd Improve OSD blink logic
Changes the blink logic to be OSD task loop based instead of time based.

The previous logic used a 200ms time interval for the blinking which didn't align well with the default 12hz OSD update frequency resulting in the logic periodically missing intervals resulting in an inconsistent blinking.

As the revised logic is now tied to the OSD task iterations the blinking will be consistent. However due to the timing the blink will be slightly faster - 167ms (6hz) vs. the previous 200ms (5hz) intervals. Technically the blinking was 6hz before but stuttered every 5th blink.

Since the OSD task rate can be changed from the default 60hz, the logic will fall back to the time-based implementation for non-default task rates.
2020-12-25 12:41:44 -05:00
Alexey Stankevich
6bab981ff5 Move OSD task frequency logic to tasks.c 2020-10-05 22:08:58 +03:00
Michael Keller
94cd650472
Merge pull request #9981 from mikeller/fix_max7456_delay_problems
Fixed the MAX7456 loop time problems introduced by #9948.
2020-07-26 15:31:16 +12:00
mikeller
81abf873da Fixed stack size monitoring. 2020-07-08 20:08:39 +12:00
mikeller
cfc89c98a8 Fixed the MAX7456 loop time problems introduced by #9948. 2020-07-05 22:00:13 +12:00
Michael Keller
4e7f7112d0
Merge pull request #9682 from etracer65/piniobox_task
Only enable PINIOBOX task when needed
2020-06-22 00:28:27 +12:00
mikeller
4923057eb3 Fixed rangefinder reading. 2020-06-01 15:19:44 +12:00
Bruce Luckcuck
f688227db6 Only enable PINIOBOX task when needed
Previously the task was always enabled and there's no reason for it to be running if there are no boxID associations.

Saves a few cycles by not running. But has a bigger effect on the scheduler by minimizing the number of active tasks when possible.
2020-04-12 20:31:32 -04:00
Bruce Luckcuck
9fa0c3bb1e Fix CMS task rate; correct cmsDeviceCount logic; coding style cleanup
The CMS task was configured to run at 60hz but there was limiting logic in place to restrict it to every 50ms (20hz). Remove the extra logic and simply run the task at 20hz.

There was incorrect logic that checked if `(cmsDeviceCount < 0)` to not run the task. Firstly `cmsDeviceCount` can never be < 0, and secondly the task should not run when it is 0 as that means there are no registered `displayPort` devices. Generally fix the logic to used `unsigned` for `cmsDeviceCount`. It can only ever be increaded (new device registered) and there is no mechanism to "unregister" a device.

Lots of coding style cleanup.
2020-04-10 10:01:51 -04:00
mikeller
b020917c4b Prevent 0 in 'vbat_display_lpf_period' to avoid division by zero. 2020-03-25 00:41:50 +13:00
ctzsnooze
d63ba914c6 motor output scale
First draft

Change method to percentage compensation

fast sag filter with fast battery updates

Renaming, moving factors to init where possible

Names changed, display update frequency reverted to 50hz as it was

50Hz ESC Voltage sampling, battery sag lowpass for PID compensation.

increment PG_PID_PROFILE, element added to end of batteryConfig_t

all HZ_TO_INTERVALs set back to 200 to match battery task frequency of 200hz.

Add a flag to control vbat comp

Flag vbat_sag_comp_enabled allows battery compensation to be enabled or
disabled from the CLI. When disabled the battery voltage task is run at
50Hz and the battery compensation code is not run. When enabled the
voltage task is run at 200Hz and the compensation code runs. Constants
for the fast and slow rates are added to tasks.h. The default value for
vbat_sag_compensation is changed to 100 as we no longer need to use it
to disable the feature.

Fixed variable task frequency setting.

Added config validation to disable sag compensation unless ADC is used as the voltage data source.

Added conditionals, fixed naming.

Fixed build.
2020-03-22 17:15:08 +13:00
mikeller
db4bd1f186 Cleaned up the scheduler. 2020-03-16 08:35:58 +13:00
mikeller
d13e83b91b Cleaned up the RX handler some. 2020-03-10 00:55:52 +13:00
mikeller
ec5816eae0 Switched FPort to use RX frame deltas for refresh rate calculate. 2020-03-06 09:35:00 +13:00
mikeller
dc5671f34c Added protocol level RX frame rate measurement for FrSky FPort. 2020-03-06 09:35:00 +13:00
mikeller
53318e5e4d Renamed the existing RC smoothing related functionality. 2020-03-06 09:35:00 +13:00
jflyper
ff16686893 White space tidy 2020-02-17 23:54:57 +13:00
Bruce Luckcuck
f584780944 Gyro native rate sampling, filtering, and scheduler restructuring 2020-02-04 18:19:35 -05:00
Bruce Luckcuck
79dd6b6bcc Move the receiver inter-frame measurements down into the protocol layer
Adds accuracy to the frame rate measurements used to configure RC smoothing. Prevents looptime delays and jitter from affecting the calculations. Significantly improves the accuracy of the measurement in cases where CPU load is high.

Implemented so that each protocol can individually provide the functionality if appropriate. If a protocol doesn't support the more granular measurement then the system will fallback to the original measurement calculated in the RX task.
2019-11-19 14:45:07 -05:00
mikeller
4a7904695e Moved 'config.[ch]' into the 'config/' directory. 2019-10-28 11:17:25 +13:00
Michael Keller
e853636080
Cleaned up 'taskUpdateRxMain'. (#9073)
Cleaned up 'taskUpdateRxMain'.
2019-10-22 11:27:51 +13:00