Skip to content

Conversation

@vaussard
Copy link
Contributor

SPI_MODE_GET() returns a bitfield. It is thus wrong to test if a bit is
set using the equality operator. The bit-wise AND operator must be used
instead.

This can be tested by setting the SPI in mode 3 (CPOL + CPHA). Currently
both tests will fail and the result is a SPI configured in mode 0. This
was confirmed using an oscilloscope. Applying the patch fixes the
polarity.

SPI_MODE_GET() returns a bitfield. It is thus wrong to test if a bit is
set using the equality operator. The bit-wise AND operator must be used
instead.

This can be tested by setting the SPI in mode 3 (CPOL + CPHA). Currently
both tests will fail and the result is a SPI configured in mode 0. This
was confirmed using an oscilloscope. Applying the patch fixes the
polarity.

Signed-off-by: Florian Vaussard <[email protected]>
@vaussard vaussard requested a review from mbolivar as a code owner December 21, 2017 13:28
@ydamigos
Copy link
Contributor

Commit 17f4dd8b6096946e56fb33b94d18dbb6a9bfdf05 in PR #5413 is already addressing the issue.

@vaussard
Copy link
Contributor Author

@ydamigos Sorry I missed your patch, as the title of your PR was advertising only the F1 support. So you can disregard my PR.

@ydamigos
Copy link
Contributor

@vaussard it's my bad. I didn't update PR's message after pushing this commit.

Copy link
Contributor

@mbolivar mbolivar left a comment

Choose a reason for hiding this comment

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

Nice catch!

@ydamigos
Copy link
Contributor

I removed the same change from PR #5413.

@galak galak added the platform: STM32 ST Micro STM32 label Jan 9, 2018
@pfalcon pfalcon requested a review from erwango January 11, 2018 11:38
@pfalcon
Copy link
Contributor

pfalcon commented Jan 11, 2018

@nashif, @galak : Please merge.

@galak galak merged this pull request into zephyrproject-rtos:arm Jan 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

platform: STM32 ST Micro STM32

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants