Skip to content

Commit 1211767

Browse files
committed
fix(xiao): keep SPI3 MOSI in board pin namespace
1 parent 73e186f commit 1211767

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

‎libraries/SPI/src/utility/spi_com.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,9 @@ spi_status_e spi_transfer(spi_t *obj, const uint8_t *tx_buffer, uint8_t *rx_buff
578578
#if defined(USE_HALV2_DRIVER)
579579
uint32_t start_us;
580580
#endif
581+
if (obj == NULL || obj->spi == NP) {
582+
return SPI_ERROR;
583+
}
581584
SPI_TypeDef *_SPI = obj->spi;
582585
uint8_t *tx_buf = (uint8_t *)tx_buffer;
583586

‎variants/STM32C5xx/C593C(E-G)(T-U)_C5A3CG(T-U)/variant_XIAO_STM32C5.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
#define PIN_SPI_SS1 NUM_DIGITAL_PINS
4343
#define PIN_SPI_SS2 NUM_DIGITAL_PINS
4444
#define PIN_SPI_SS3 NUM_DIGITAL_PINS
45-
#define PIN_SPI_MOSI PB_15_ALT2
45+
#define PIN_SPI_MOSI (PB15 | ALT2)
4646
#define PIN_SPI_MISO PB0
4747
#define PIN_SPI_SCK PE2
4848

0 commit comments

Comments
 (0)