Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on May 12, 2022. It is now read-only.

Commit a0ef17a

Browse filesBrowse files
author
kabir-plod
authored
Use non-deprecated DPORT values in SPI HAL (espressif#4682)
1 parent be77bd4 commit a0ef17a
Copy full SHA for a0ef17a

File tree

1 file changed

+8
-8
lines changed
Filter options

1 file changed

+8
-8
lines changed

‎cores/esp32/esp32-hal-spi.c

Copy file name to clipboardExpand all lines: cores/esp32/esp32-hal-spi.c
+8-8Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -402,9 +402,9 @@ void spiStopBus(spi_t * spi)
402402
if(!spi) {
403403
return;
404404
}
405-
405+
406406
removeApbChangeCallback(spi, _on_apb_change);
407-
407+
408408
SPI_MUTEX_LOCK();
409409
spiInitBus(spi);
410410
SPI_MUTEX_UNLOCK();
@@ -428,14 +428,14 @@ spi_t * spiStartBus(uint8_t spi_num, uint32_t clockDiv, uint8_t dataMode, uint8_
428428
#endif
429429

430430
if(spi_num == HSPI) {
431-
DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_SPI_CLK_EN);
432-
DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_SPI_RST);
431+
DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_SPI2_CLK_EN);
432+
DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_SPI2_RST);
433433
} else if(spi_num == VSPI) {
434-
DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_SPI_CLK_EN_2);
435-
DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_SPI_RST_2);
434+
DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_SPI3_CLK_EN);
435+
DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_SPI3_RST);
436436
} else {
437-
DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_SPI_CLK_EN_1);
438-
DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_SPI_RST_1);
437+
DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_SPI01_CLK_EN);
438+
DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_SPI01_RST);
439439
}
440440

441441
SPI_MUTEX_LOCK();

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.