Skip to content

Commit c7cd9b6

Browse files
committed
[NANO130] Change dummy to spi_fill in spi_api.c
1 parent 5f58104 commit c7cd9b6

File tree

1 file changed

+3
-2
lines changed
  • targets/TARGET_NUVOTON/TARGET_NANO100

1 file changed

+3
-2
lines changed

targets/TARGET_NUVOTON/TARGET_NANO100/spi_api.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,12 +284,13 @@ int spi_master_write(spi_t *obj, int value)
284284
return value2;
285285
}
286286

287-
int spi_master_block_write(spi_t *obj, const char *tx_buffer, int tx_length, char *rx_buffer, int rx_length)
287+
int spi_master_block_write(spi_t *obj, const char *tx_buffer, int tx_length,
288+
char *rx_buffer, int rx_length, char write_fill)
288289
{
289290
int total = (tx_length > rx_length) ? tx_length : rx_length;
290291

291292
for (int i = 0; i < total; i++) {
292-
char out = (i < tx_length) ? tx_buffer[i] : 0xff;
293+
char out = (i < tx_length) ? tx_buffer[i] : write_fill;
293294
char in = spi_master_write(obj, out);
294295
if (i < rx_length) {
295296
rx_buffer[i] = in;

0 commit comments

Comments
 (0)