LPC MCUXpresso: fix write_fill argument for block write function

The latest HAL extension was not applied to the LPC MCUXpresso targets.
pull/4807/head
Martin Kojtal 2017-07-25 10:26:40 +01:00
parent 1f94ede86c
commit c8d43aeb2d
1 changed files with 3 additions and 2 deletions

View File

@ -154,11 +154,12 @@ int spi_master_write(spi_t *obj, int value)
return rx_data & 0xffff; return rx_data & 0xffff;
} }
int spi_master_block_write(spi_t *obj, const char *tx_buffer, int tx_length, char *rx_buffer, int rx_length) { int spi_master_block_write(spi_t *obj, const char *tx_buffer, int tx_length,
char *rx_buffer, int rx_length, char write_fill) {
int total = (tx_length > rx_length) ? tx_length : rx_length; int total = (tx_length > rx_length) ? tx_length : rx_length;
for (int i = 0; i < total; i++) { for (int i = 0; i < total; i++) {
char out = (i < tx_length) ? tx_buffer[i] : 0xff; char out = (i < tx_length) ? tx_buffer[i] : write_fill;
char in = spi_master_write(obj, out); char in = spi_master_write(obj, out);
if (i < rx_length) { if (i < rx_length) {
rx_buffer[i] = in; rx_buffer[i] = in;