diff --git a/ports/esp32/machine_hw_spi.c b/ports/esp32/machine_hw_spi.c index 662d0e5994..2f4509f302 100644 --- a/ports/esp32/machine_hw_spi.c +++ b/ports/esp32/machine_hw_spi.c @@ -232,7 +232,7 @@ STATIC void machine_hw_spi_init_internal( #ifdef FSPI_HOST && self->host != FSPI_HOST #endif - #ifdef SPI3_HOST + #if SOC_SPI_PERIPH_NUM > 2 && self->host != SPI3_HOST #endif ) {