From 59ca87af0d1a6e47685fad09797f6deac86b2b87 Mon Sep 17 00:00:00 2001 From: LokLiang Date: Thu, 10 Apr 2025 09:52:19 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=97=A5=E5=BF=97=E7=BA=A7?= =?UTF-8?q?=E5=88=AB=E4=B8=BA=E8=AD=A6=E5=91=8A=EF=BC=8C=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=20ws2812=5Fspi=20=E7=BB=93=E6=9E=84=E4=BD=93=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=20spi=5Fpin=20=E7=B1=BB=E5=9E=8B=E4=B8=BA=20uint8=5Ft=EF=BC=8C?= =?UTF-8?q?=E5=B9=B6=E4=BC=98=E5=8C=96=20GPIO=20=E5=BC=95=E8=84=9A?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/drivers/data_port/socket_inet/wifi.c | 2 +- app/drivers/ws2812_spi/ws2812_spi.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/drivers/data_port/socket_inet/wifi.c b/app/drivers/data_port/socket_inet/wifi.c index be298dd..341a27d 100644 --- a/app/drivers/data_port/socket_inet/wifi.c +++ b/app/drivers/data_port/socket_inet/wifi.c @@ -7,7 +7,7 @@ #include "esp_netif_types.h" #include "esp_err.h" -#define CONFIG_SYS_LOG_LEVEL SYS_LOG_LEVEL_INF +#define CONFIG_SYS_LOG_LEVEL SYS_LOG_LEVEL_WRN #define SYS_LOG_DOMAIN "WIFI" #include "sys_log.h" diff --git a/app/drivers/ws2812_spi/ws2812_spi.c b/app/drivers/ws2812_spi/ws2812_spi.c index d396fe0..1adfe2f 100755 --- a/app/drivers/ws2812_spi/ws2812_spi.c +++ b/app/drivers/ws2812_spi/ws2812_spi.c @@ -52,7 +52,7 @@ static struct spi_host_device_t host_id; spi_device_handle_t spi_hdl; os_mutex_t mutex_hdl; - uint16_t spi_pin; + uint8_t spi_pin; int max_transfer_sz; } s_cm; @@ -103,7 +103,7 @@ void ws2812_spi_led_strip_init(uint8_t host_id, uint16_t max_led_num) ESP_ERROR_CHECK(ret); s_cm.host_id = host_id; - s_cm.spi_pin = -1; + s_cm.spi_pin = ~0; } if (!os_mutex_is_valid(&s_cm.mutex_hdl)) @@ -254,12 +254,12 @@ int ws2812_spi_led_strip_refresh(ws2812_spi_led_buf_t *buf, uint32_t leds, uint8 if (s_cm.spi_pin != pin) { - if (s_cm.spi_pin > 0) + if (GPIO_USED(s_cm.spi_pin)) { drv_gpio_pin_configure(s_cm.spi_pin, _GPIO_DIR_OUT, _GPIO_PUD_PULL_UP); } - if (pin > 0) + if (GPIO_USED(pin)) { drv_gpio_pin_configure(pin, _GPIO_DIR_OUT, _GPIO_PUD_PULL_UP); esp_rom_gpio_connect_out_signal(pin, spi_periph_signal[s_cm.host_id].spid_out, true, false);