nrf5/hal: Adding support for NULL pointer to be set if no rx buffer is of interest in SPI rx_tx function.

This commit is contained in:
Glenn Ruben Bakke 2017-01-05 21:56:17 +01:00
parent a8dc8cb236
commit 042e3653cf
1 changed files with 7 additions and 1 deletions

View File

@ -101,9 +101,15 @@ void hal_spi_master_tx_rx(NRF_SPI_Type * p_instance, uint16_t transfer_size, con
while (p_instance->EVENTS_READY == 0) {
;
}
p_instance->EVENTS_READY = 0;
rx_data[number_of_txd_bytes] = (uint8_t)p_instance->RXD;
uint8_t in_byte = (uint8_t)p_instance->RXD;
if (rx_data != NULL) {
rx_data[number_of_txd_bytes] = in_byte;
}
number_of_txd_bytes++;
};
}