mirror of https://github.com/ARMmbed/mbed-os.git
STM: SPI: Initialize Rx in spi_master_write
In case Rx is not initiliased its content might be random from stack. This is causing problem in case of 8 bits read only as the left-side 8 bits of the returned int value may contain this random byte data. This was for instance detected when using SDFileSystem Lib.pull/3540/head
parent
e7361ebc44
commit
fd3a3f9de8
|
@ -344,7 +344,8 @@ static inline int ssp_busy(spi_t *obj)
|
|||
|
||||
int spi_master_write(spi_t *obj, int value)
|
||||
{
|
||||
uint16_t size, Rx, ret;
|
||||
uint16_t size, ret;
|
||||
int Rx = 0;
|
||||
struct spi_s *spiobj = SPI_S(obj);
|
||||
SPI_HandleTypeDef *handle = &(spiobj->handle);
|
||||
|
||||
|
|
Loading…
Reference in New Issue