Skip to content

sam0/spi: fix SPI mode assignment#9885

Merged
PeterKietzmann merged 1 commit intoRIOT-OS:masterfrom
dylad:sam0_fix_spi_mode
Sep 10, 2018
Merged

sam0/spi: fix SPI mode assignment#9885
PeterKietzmann merged 1 commit intoRIOT-OS:masterfrom
dylad:sam0_fix_spi_mode

Conversation

@dylad
Copy link
Copy Markdown
Member

@dylad dylad commented Sep 4, 2018

Contribution description

This PR provides a fix for #9695
The SPI mode selection is done using two bits in the SERCOM CTRLA register, bit 28 and bit 29.
The mode variable can be 0, 1, 2 or 3 but this variable was shifted to bit 29 instead of bit 28 (CPOL instead of CPHA) so the SPI mode was not set correctly.

More info in #9695

Thanks @leandrolanzieri for spotting this issue.

Testing procedure

Issues/PRs references

@dylad dylad added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Area: drivers Area: Device drivers labels Sep 4, 2018
@dylad dylad added this to the Release 2018.10 milestone Sep 4, 2018
@dylad dylad added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Sep 4, 2018
@dylad
Copy link
Copy Markdown
Member Author

dylad commented Sep 4, 2018

@miri64 Any idea why Murdock complains here ? this is outside the scope of this PR right ?

@dylad dylad added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Sep 4, 2018
@dylad
Copy link
Copy Markdown
Member Author

dylad commented Sep 4, 2018

I retrigger Murdock and the previous error vanish...
Sorry for the noise.

@PeterKietzmann
Copy link
Copy Markdown
Member

@leandrolanzieri the code change seems reasonable. Can you confirm that it fixes #9695?

@leandrolanzieri
Copy link
Copy Markdown
Contributor

@PeterKietzmann yes, I scoped the signals and everything is looking good.

@PeterKietzmann
Copy link
Copy Markdown
Member

Great, thanks!

Copy link
Copy Markdown
Member

@PeterKietzmann PeterKietzmann left a comment

Choose a reason for hiding this comment

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

ACK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: drivers Area: Device drivers CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants