Skip to content

Commit ca4637d

Browse files
authored
SPI debugging: tiny fix & log actual baudrate (#1641)
1 parent 313caf4 commit ca4637d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

libraries/SPI/src/SPI.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ void SPIClassRP2040::transfer(const void *txbuf, void *rxbuf, size_t count) {
177177
}
178178

179179
void SPIClassRP2040::beginTransaction(SPISettings settings) {
180-
DEBUGSPI("SPI::beginTransaction(clk=%lu, bo=%s\n", _spis.getClockFreq(), (_spis.getBitOrder() == MSBFIRST) ? "MSB" : "LSB");
180+
DEBUGSPI("SPI::beginTransaction(clk=%lu, bo=%s)\n", settings.getClockFreq(), (settings.getBitOrder() == MSBFIRST) ? "MSB" : "LSB");
181181
if (_initted && settings == _spis) {
182182
DEBUGSPI("SPI: Reusing existing initted SPI\n");
183183
} else {
@@ -188,6 +188,7 @@ void SPIClassRP2040::beginTransaction(SPISettings settings) {
188188
}
189189
DEBUGSPI("SPI: initting SPI\n");
190190
spi_init(_spi, _spis.getClockFreq());
191+
DEBUGSPI("SPI: actual baudrate=%u\n", spi_get_baudrate(_spi));
191192
_initted = true;
192193
}
193194
}

0 commit comments

Comments
 (0)