Skip to content

Commit

Permalink
serial_test: fix write for max buffer size
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor-Misic authored and bkueng committed Jul 25, 2022
1 parent 21cb0ef commit 32ca7ad
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/systemcmds/serial_test/serial_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,6 @@ static void process_read_data(struct g_mod_t *g_mod, struct cli_args_t *g_cl)
static void process_write_data(struct g_mod_t *g_mod, struct cli_args_t *g_cl)
{
ssize_t count = 0;
int loops = 10;
int repeat = (g_cl->_tx_bytes == 0);

do {
Expand All @@ -594,13 +593,11 @@ static void process_write_data(struct g_mod_t *g_mod, struct cli_args_t *g_cl)

c = 0;

} else {
loops--;
}

count += c;

if (loops == 0 || c < g_mod->_write_size) {
if (c <= g_mod->_write_size) {
g_mod->_write_count_value = g_mod->_write_data[c];
repeat = 0;
}
Expand Down

0 comments on commit 32ca7ad

Please sign in to comment.