Unverified Commit ca4637d1 authored by LinusHeu's avatar LinusHeu Committed by GitHub

SPI debugging: tiny fix & log actual baudrate (#1641)

parent 313caf40
......@@ -177,7 +177,7 @@ void SPIClassRP2040::transfer(const void *txbuf, void *rxbuf, size_t count) {
}
void SPIClassRP2040::beginTransaction(SPISettings settings) {
DEBUGSPI("SPI::beginTransaction(clk=%lu, bo=%s\n", _spis.getClockFreq(), (_spis.getBitOrder() == MSBFIRST) ? "MSB" : "LSB");
DEBUGSPI("SPI::beginTransaction(clk=%lu, bo=%s)\n", settings.getClockFreq(), (settings.getBitOrder() == MSBFIRST) ? "MSB" : "LSB");
if (_initted && settings == _spis) {
DEBUGSPI("SPI: Reusing existing initted SPI\n");
} else {
......@@ -188,6 +188,7 @@ void SPIClassRP2040::beginTransaction(SPISettings settings) {
}
DEBUGSPI("SPI: initting SPI\n");
spi_init(_spi, _spis.getClockFreq());
DEBUGSPI("SPI: actual baudrate=%u\n", spi_get_baudrate(_spi));
_initted = true;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment