Skip to content

Commit

Permalink
Merge pull request #124 from bmourit/patch-2
Browse files Browse the repository at this point in the history
SPI fix for MSB code
  • Loading branch information
maxgerhardt authored Apr 20, 2024
2 parents 8f14963 + 89ed65b commit c9e2b2f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libraries/SPI/src/SPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,11 @@ uint16_t SPIClass::transfer16(uint16_t val16)
if (spisettings.bitorder == LSBFIRST) {
rec_data0 = transfer(trans_data0);
rec_data1 = transfer(trans_data1);
out_halfword = uint16_t(rec_data0 || rec_data1 << 8);
out_halfword = uint16_t(rec_data0 | (rec_data1 << 8));
} else {
rec_data0 = transfer(trans_data1);
rec_data1 = transfer(trans_data0);
out_halfword = uint16_t(rec_data1 || rec_data0 << 8);
out_halfword = uint16_t(rec_data1 | (rec_data0 << 8));
}

return out_halfword;
Expand Down

0 comments on commit c9e2b2f

Please sign in to comment.