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

SPI: Fix prescaler at low baudrates #794

Merged
merged 2 commits into from
Nov 27, 2019
Merged

Conversation

LinoBarreca
Copy link
Contributor

@LinoBarreca LinoBarreca commented Nov 26, 2019

Summary
The current prescaler, if the user requests a slow clock, is set to a value which makes no sense.
We should give a frequency closer to what the user asks.

This PR fixes/implements the following bugs/features

  • BUG: Clock is too high when the user requests a slow clock.

motivation for making this change:
If a SPI device can't handle high speed clock and the user requests a slow one we should give him the slowest clock we can. The code, before the PR, had unexpected behavior which makes difficult to track down where the problem is.

Validation
Should work.

cores/arduino/stm32/spi_com.c Outdated Show resolved Hide resolved
@fpistm fpistm added the enhancement New feature or request label Nov 26, 2019
@fpistm fpistm added this to the 1.8.0🎄 🎅 milestone Nov 26, 2019
Copy link
Member

@fpistm fpistm left a comment

Choose a reason for hiding this comment

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

Thanks @LinoBarreca

@LinoBarreca
Copy link
Contributor Author

Thanks @LinoBarreca

no, thank you :)

@fpistm fpistm merged commit aff9601 into stm32duino:master Nov 27, 2019
@LinoBarreca LinoBarreca deleted the SPIClock branch November 27, 2019 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants