From 670822a581bb3a582faa6e57fcb07e6851c816ea Mon Sep 17 00:00:00 2001 From: ccli8 Date: Tue, 1 Aug 2017 10:47:39 +0800 Subject: [PATCH] [M487] Update spi_master_block_write() API --- targets/TARGET_NUVOTON/TARGET_M480/spi_api.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/targets/TARGET_NUVOTON/TARGET_M480/spi_api.c b/targets/TARGET_NUVOTON/TARGET_M480/spi_api.c index 5075706f37..87f1daaecb 100644 --- a/targets/TARGET_NUVOTON/TARGET_M480/spi_api.c +++ b/targets/TARGET_NUVOTON/TARGET_M480/spi_api.c @@ -246,12 +246,12 @@ int spi_master_write(spi_t *obj, int value) return value2; } -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;