This commit is contained in:
2026-02-20 02:29:17 +08:00
parent 030a8f7825
commit f375363f74
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -2,7 +2,7 @@ dependencies:
idf: idf:
source: source:
type: idf type: idf
version: 5.3.1 version: 5.5.2
manifest_hash: a52a8cabe7f10f1636effa39e0be0f2d62531803ed5f518e7921b728e64c8752 manifest_hash: a52a8cabe7f10f1636effa39e0be0f2d62531803ed5f518e7921b728e64c8752
target: esp32c3 target: esp32c3
version: 2.0.0 version: 2.0.0
+3 -3
View File
@@ -1,6 +1,6 @@
#include "spi.h" #include "spi.h"
#define SPI_HOST SPI2_HOST #define USE_SPI_HOST SPI2_HOST
static const char *TAG = "SPI_2"; static const char *TAG = "SPI_2";
@@ -24,7 +24,7 @@ void spi_init()
}; };
// 2. 初始化 SPI 总线 // 2. 初始化 SPI 总线
ret = spi_bus_initialize(SPI_HOST, &buscfg, SPI_DMA_CH_AUTO); ret = spi_bus_initialize(USE_SPI_HOST, &buscfg, SPI_DMA_CH_AUTO);
if (ret != ESP_OK) if (ret != ESP_OK)
{ {
ESP_LOGE(TAG, "IO总线初始化失败"); ESP_LOGE(TAG, "IO总线初始化失败");
@@ -50,7 +50,7 @@ void spi_init()
}; };
ret = spi_bus_add_device(SPI_HOST, &devcfg, &lcd_spi); ret = spi_bus_add_device(USE_SPI_HOST, &devcfg, &lcd_spi);
if (ret != ESP_OK) if (ret != ESP_OK)
{ {
ESP_LOGE(TAG, "SPI 设备配置失败"); ESP_LOGE(TAG, "SPI 设备配置失败");