Skip to content

Commit 670822a

Browse files
committed
[M487] Update spi_master_block_write() API
1 parent bc71935 commit 670822a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

targets/TARGET_NUVOTON/TARGET_M480/spi_api.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,12 +246,12 @@ int spi_master_write(spi_t *obj, int value)
246246
return value2;
247247
}
248248

249-
int spi_master_block_write(spi_t *obj, const char *tx_buffer, int tx_length, char *rx_buffer, int rx_length)
250-
{
249+
int spi_master_block_write(spi_t *obj, const char *tx_buffer, int tx_length,
250+
char *rx_buffer, int rx_length, char write_fill) {
251251
int total = (tx_length > rx_length) ? tx_length : rx_length;
252252

253253
for (int i = 0; i < total; i++) {
254-
char out = (i < tx_length) ? tx_buffer[i] : 0xff;
254+
char out = (i < tx_length) ? tx_buffer[i] : write_fill;
255255
char in = spi_master_write(obj, out);
256256
if (i < rx_length) {
257257
rx_buffer[i] = in;

0 commit comments

Comments
 (0)