Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/reduce scheduler timebase #102

Merged
merged 4 commits into from
Jun 11, 2023
Merged

Conversation

damosvil
Copy link
Contributor

@damosvil damosvil commented Jun 6, 2023

This pr reduces the scheduler timebase from 16ms to 128ms to interfere the minimum with commutation.
t2_int triggers every 32ms before arming. After arming sysclk is increased from 24.5Mhz to 49Mhz, so timer2 interrupt triggers every 16ms instead of 32ms.
As it is not really necessary to run the scheduler so fast (it is in charge of prepare telemetry frames, and updates pwm limit based on temperature) it is better to reduce its frequency of operation to 128ms, instead 16ms to avoid causing trouble on commutation.

@damosvil damosvil self-assigned this Jun 6, 2023
@damosvil damosvil changed the base branch from main to v0.20 June 6, 2023 17:58
@damosvil damosvil requested a review from stylesuxx June 6, 2023 18:02
@github-actions
Copy link

github-actions bot commented Jun 6, 2023

Build artifacts:

@damosvil damosvil marked this pull request as draft June 7, 2023 15:45
@damosvil damosvil marked this pull request as ready for review June 7, 2023 16:45
@damosvil damosvil requested a review from stylesuxx June 7, 2023 16:45
src/Modules/Scheduler.asm Outdated Show resolved Hide resolved
src/Modules/Scheduler.asm Outdated Show resolved Hide resolved
@stylesuxx stylesuxx added the fix label Jun 9, 2023
Added parameter to select timebase depending on the needs. Scheduler cycle set to 1024ms by default.
@damosvil damosvil requested a review from stylesuxx June 10, 2023 09:01
Copy link
Contributor

@stylesuxx stylesuxx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect!

@stylesuxx stylesuxx merged commit 8c5044a into v0.20 Jun 11, 2023
@stylesuxx stylesuxx added this to the v0.20.0 milestone Jun 15, 2023
@stylesuxx stylesuxx deleted the bugfix/reduce_scheduler_timebase branch July 2, 2023 13:31
@stylesuxx stylesuxx mentioned this pull request Jul 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants