Skip to content

Commit 9fc3f1e

Browse files
committed
Fix wrong SPI peripheral enabled
Related: espressif#634
1 parent 29a253a commit 9fc3f1e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cores/esp32/esp32-hal-spi.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -407,14 +407,14 @@ spi_t * spiStartBus(uint8_t spi_num, uint32_t clockDiv, uint8_t dataMode, uint8_
407407
#endif
408408

409409
if(spi_num == HSPI) {
410-
DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_SPI_CLK_EN_1);
411-
DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_SPI_RST_1);
410+
DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_SPI_CLK_EN);
411+
DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_SPI_RST);
412412
} else if(spi_num == VSPI) {
413413
DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_SPI_CLK_EN_2);
414414
DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_SPI_RST_2);
415415
} else {
416-
DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_SPI_CLK_EN);
417-
DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_SPI_RST);
416+
DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_SPI_CLK_EN_1);
417+
DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_SPI_RST_1);
418418
}
419419

420420
spiStopBus(spi);

0 commit comments

Comments
 (0)