Skip to content

Commit 74cd0a9

Browse files
decsnykartben
authored andcommitted
spi_nxp_lpspi: Fix TX word formation for multibyte
For multi-byte word, there is clearly a bug in that the same byte is written to each spot in the word instead of writing all the bytes properly. Signed-off-by: Declan Snyder <[email protected]> (cherry picked from commit 97e29a9)
1 parent 8da58ff commit 74cd0a9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/spi/spi_nxp_lpspi/spi_nxp_lpspi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ static inline uint32_t lpspi_next_tx_word(const struct device *dev, int offset)
115115
uint32_t next_word = 0;
116116

117117
for (uint8_t i = 0; i < num_bytes; i++) {
118-
next_word |= *byte << (BITS_PER_BYTE * i);
118+
next_word |= byte[i] << (BITS_PER_BYTE * i);
119119
}
120120

121121
return next_word;

0 commit comments

Comments
 (0)