properly fill dummy arrays

This commit is contained in:
Alexey Starikovskiy 2023-09-20 15:01:07 +03:00 committed by Gwenhael Goavec-Merou
parent d3410e0e30
commit b10be9ae8a
3 changed files with 5 additions and 2 deletions

View File

@ -469,6 +469,7 @@ int Efinix::spi_wait(uint8_t cmd, uint8_t mask, uint8_t cond,
uint32_t timeout, bool verbose)
{
uint8_t rx[2], dummy[2], tmp;
memset(dummy, 0xff, sizeof(dummy));
uint8_t tx = EfinixHexParser::reverseByte(cmd);
uint32_t count = 0;

View File

@ -89,7 +89,8 @@ bool Ice40::program_cram(const uint8_t *data, uint32_t length)
progress.done();
/* send 48 to 100 dummy bits */
uint8_t dummy[12] = {0xff};
uint8_t dummy[12];
memset(dummy, 0xff, sizeof(dummy));
_spi->spi_put(dummy, NULL, 12);
/* wait CDONE */

View File

@ -1577,7 +1577,8 @@ int Xilinx::spi_wait(uint8_t cmd, uint8_t mask, uint8_t cond,
uint32_t timeout, bool verbose)
{
uint8_t rx[2];
uint8_t dummy[2] = {0xff};
uint8_t dummy[2];
memset(dummy, 0xff, sizeof(dummy));
uint8_t tmp;
uint8_t tx = McsParser::reverseByte(cmd);
uint32_t count = 0;