From 4f1f8566f48961c7ee877d1d5226f0be03a06395 Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Tue, 21 Jun 2022 02:08:59 -0400 Subject: [PATCH] =?UTF-8?q?[spi]=20fix=20issue=20report=20#6008=20rt=5Fspi?= =?UTF-8?q?=5Fsendrecv8()=E5=AD=98=E5=9C=A8=E5=8F=AF=E8=83=BD=E6=9C=AA?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E5=80=BC=E8=BF=94=E5=9B=9E=E7=9A=84?= =?UTF-8?q?=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/drivers/include/drivers/spi.h | 4 ++-- components/drivers/spi/device_driver_list.txt | 9 --------- components/drivers/spi/spi_core.c | 1 - 3 files changed, 2 insertions(+), 12 deletions(-) delete mode 100644 components/drivers/spi/device_driver_list.txt diff --git a/components/drivers/include/drivers/spi.h b/components/drivers/include/drivers/spi.h index 018d12139b..5bc46b3c1b 100644 --- a/components/drivers/include/drivers/spi.h +++ b/components/drivers/include/drivers/spi.h @@ -271,7 +271,7 @@ rt_inline rt_size_t rt_spi_send(struct rt_spi_device *device, rt_inline rt_uint8_t rt_spi_sendrecv8(struct rt_spi_device *device, rt_uint8_t data) { - rt_uint8_t value; + rt_uint8_t value = 0; rt_spi_send_then_recv(device, &data, 1, &value, 1); @@ -281,7 +281,7 @@ rt_inline rt_uint8_t rt_spi_sendrecv8(struct rt_spi_device *device, rt_inline rt_uint16_t rt_spi_sendrecv16(struct rt_spi_device *device, rt_uint16_t data) { - rt_uint16_t value; + rt_uint16_t value = 0; rt_spi_send_then_recv(device, &data, 2, &value, 2); diff --git a/components/drivers/spi/device_driver_list.txt b/components/drivers/spi/device_driver_list.txt deleted file mode 100644 index 939baa7531..0000000000 --- a/components/drivers/spi/device_driver_list.txt +++ /dev/null @@ -1,9 +0,0 @@ -spi_wifi_rw009.c/spi_wifi_rw009.h -RW009 -http://www.rt-thread.com/ - -enc28j60.c/enc28j60.h -http://www.microchip.com/ - -spi_flash_sfud: Serial Flash Universal Driver -https://github.com/armink/SFUD \ No newline at end of file diff --git a/components/drivers/spi/spi_core.c b/components/drivers/spi/spi_core.c index cc48f78dd9..ccfaecf387 100644 --- a/components/drivers/spi/spi_core.c +++ b/components/drivers/spi/spi_core.c @@ -300,7 +300,6 @@ rt_size_t rt_spi_transfer(struct rt_spi_device *device, else { rt_set_errno(-RT_EIO); - return 0; }