[spi] fix issue report #6008

rt_spi_sendrecv8()存在可能未初始化值返回的情况
This commit is contained in:
Meco Man 2022-06-21 02:08:59 -04:00 committed by guo
parent d5afcd7f0d
commit 4f1f8566f4
3 changed files with 2 additions and 12 deletions

View File

@ -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);

View File

@ -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

View File

@ -300,7 +300,6 @@ rt_size_t rt_spi_transfer(struct rt_spi_device *device,
else
{
rt_set_errno(-RT_EIO);
return 0;
}