esp32/machine_hw_spi: Fix access of SPI(2).

SPI3_HOST is not a macro but rather an enum, so use SOC_SPI_PERIPH_NUM to
detect if it's defined.

Fixes issue #11919.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George 2023-07-25 10:52:50 +10:00
parent 975a687447
commit aab8061dce
1 changed files with 1 additions and 1 deletions

View File

@ -232,7 +232,7 @@ STATIC void machine_hw_spi_init_internal(
#ifdef FSPI_HOST #ifdef FSPI_HOST
&& self->host != FSPI_HOST && self->host != FSPI_HOST
#endif #endif
#ifdef SPI3_HOST #if SOC_SPI_PERIPH_NUM > 2
&& self->host != SPI3_HOST && self->host != SPI3_HOST
#endif #endif
) { ) {