mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #12819 from kyle-cypress/pr/psoc6-spi-memfix
Cypress: Fix unitialized memory in spi_master_writepull/12830/head
commit
a1c7cf5e73
|
@ -140,9 +140,9 @@ void spi_frequency(spi_t *obj, int hz)
|
|||
int spi_master_write(spi_t *obj, int value)
|
||||
{
|
||||
struct spi_s *spi = cy_get_spi(obj);
|
||||
int received;
|
||||
uint8_t received;
|
||||
|
||||
if (CY_RSLT_SUCCESS != cyhal_spi_transfer(&(spi->hal_spi), (const uint8_t *)&value, 1, (uint8_t *)&received, 1, 0xff)) {
|
||||
if (CY_RSLT_SUCCESS != cyhal_spi_transfer(&(spi->hal_spi), (const uint8_t *)&value, 1, &received, 1, 0xff)) {
|
||||
MBED_ERROR(MBED_MAKE_ERROR(MBED_MODULE_DRIVER_SPI, MBED_ERROR_CODE_FAILED_OPERATION), "cyhal_spi_transfer");
|
||||
}
|
||||
return received;
|
||||
|
|
Loading…
Reference in New Issue