From f465a7c9c4970e68e4143b22d49962467cf80af5 Mon Sep 17 00:00:00 2001 From: RudolphRiedel <31180093+RudolphRiedel@users.noreply.github.com> Date: Sat, 20 Jan 2024 15:43:01 +0100 Subject: [PATCH] - fix for #244, byte-order wrong for LSBFIRST buffer transfers --- libraries/SPI/SPI.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/SPI/SPI.cpp b/libraries/SPI/SPI.cpp index 96651d023..10ec722bf 100644 --- a/libraries/SPI/SPI.cpp +++ b/libraries/SPI/SPI.cpp @@ -444,7 +444,7 @@ void ArduinoSPI::configSpi(arduino::SPISettings const & settings) /* register undocumented for the RA4M1 but found to be working and necessary */ /* BYSW - Byte Swap Operating Mode Select - 1 = Byte Swap ON - essential for 32 bit transfers */ - _spi_ctrl.p_regs->SPDCR2_b.BYSW = 1; + _spi_ctrl.p_regs->SPDCR2_b.BYSW = ~bit_order; _spi_ctrl.p_regs->SPCKD = 0;