nrf8001: fix potential reference of uninitialized memory

Signed-off-by: Jon Trulson <jtrulson@ics.com>
This commit is contained in:
Jon Trulson 2016-10-25 16:31:15 -06:00
parent df0a23f702
commit d9850cf0f6

View File

@ -233,10 +233,10 @@ static bool m_aci_spi_transfer(hal_aci_data_t * data_to_send, hal_aci_data_t * r
max_bytes = HAL_ACI_MAX_LENGTH; max_bytes = HAL_ACI_MAX_LENGTH;
} }
// Transmit/receive the rest of the packet // Transmit/receive the rest of the packet (skip first byte - cmd)
for (byte_cnt = 0; byte_cnt < max_bytes; byte_cnt++) for (byte_cnt = 1; byte_cnt < max_bytes; byte_cnt++)
{ {
received_data->buffer[byte_cnt+1] = spi_readwrite(data_to_send->buffer[byte_sent_cnt++]); received_data->buffer[byte_cnt] = spi_readwrite(data_to_send->buffer[byte_sent_cnt++]);
} }
// RDYN should follow the REQN line in approx 100ns // RDYN should follow the REQN line in approx 100ns