From c8d43aeb2dbfac18c37b9bfa8ef1b8768b76cae0 Mon Sep 17 00:00:00 2001 From: Martin Kojtal <0xc0170@gmail.com> Date: Tue, 25 Jul 2017 10:26:40 +0100 Subject: [PATCH] LPC MCUXpresso: fix write_fill argument for block write function The latest HAL extension was not applied to the LPC MCUXpresso targets. --- targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/api/spi_api.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/api/spi_api.c b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/api/spi_api.c index d941b5c8be..75d906156c 100644 --- a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/api/spi_api.c +++ b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/api/spi_api.c @@ -154,11 +154,12 @@ int spi_master_write(spi_t *obj, int value) 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; 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); if (i < rx_length) { rx_buffer[i] = in;