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

dshot: fixed timer wrap bug in DShot decode #76

Merged
merged 1 commit into from
Sep 13, 2024

Conversation

tridge
Copy link
Member

@tridge tridge commented Aug 29, 2024

when a 16 bit timer is being used for DShot capture wraps we get dma_buffer[] values that wrap back from 655xx to low values. The subtraction needs to be done as uint16_t to cope correctly with the wrap

this fixes a bug that caused dshot_badcount to tick over on each timer wrap where a DShot pulse was present
the screenshot below shows the dma_buffer[] in a debug session when the bug happens:
image

when a 16 bit timer is being used for DShot capture wraps we get
dma_buffer[] values that wrap back from 655xx to low values. The
subtraction needs to be done as uint16_t to cope correctly with the
wrap

this fixes a bug that caused dshot_badcount to tick over on each timer
wrap where a DShot pulse was present
@freasy freasy merged commit b381092 into am32-firmware:main Sep 13, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants