From d6488fafc31f1625aadefb92821aea301f537ed1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Mi=C5=A1i=C4=87?= Date: Mon, 25 Jul 2022 10:51:05 +0200 Subject: [PATCH] serial_test: fix first write_count_value for next write --- src/systemcmds/serial_test/serial_test.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/systemcmds/serial_test/serial_test.c b/src/systemcmds/serial_test/serial_test.c index f2b21607f2..1faf45ad77 100644 --- a/src/systemcmds/serial_test/serial_test.c +++ b/src/systemcmds/serial_test/serial_test.c @@ -598,7 +598,14 @@ static void process_write_data(struct g_mod_t *g_mod, struct cli_args_t *g_cl) count += c; if (c <= g_mod->_write_size) { - g_mod->_write_count_value = g_mod->_write_data[c]; + + if (c == 0) { + g_mod->_write_count_value = g_mod->_write_data[0]; + + } else { + g_mod->_write_count_value = next_count_value(g_mod->_write_data[c - 1], g_cl->_ascii_range); + } + repeat = 0; } } while (repeat);