Skip to content
Commit 59f0c99f authored by Florian Vaussard's avatar Florian Vaussard Committed by Anas Nashif
Browse files

spi: stm32: Correctly apply CPOL and CPHA settings



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: default avatarFlorian Vaussard <florian.vaussard@gmail.com>
parent 5491c293
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment