diff options
| author | Meco Man <[email protected]> | 2022-06-21 02:08:59 -0400 |
|---|---|---|
| committer | guo <[email protected]> | 2022-06-22 11:52:06 +0800 |
| commit | 4f1f8566f48961c7ee877d1d5226f0be03a06395 (patch) | |
| tree | 5ca0531c9dd872fd7d50d810e2d717e1f75de9af /components | |
| parent | d5afcd7f0de49c4df70fcd66aaaf6a62bf0413a6 (diff) | |
[spi] fix issue report #6008
rt_spi_sendrecv8()存在可能未初始化值返回的情况
Diffstat (limited to 'components')
| -rw-r--r-- | components/drivers/include/drivers/spi.h | 4 | ||||
| -rw-r--r-- | components/drivers/spi/device_driver_list.txt | 9 | ||||
| -rw-r--r-- | components/drivers/spi/spi_core.c | 1 |
3 files changed, 2 insertions, 12 deletions
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; } |
