mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-23 13:53:34 +08:00
serial_test: fix write for max buffer size
This commit is contained in:
@@ -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)
|
static void process_write_data(struct g_mod_t *g_mod, struct cli_args_t *g_cl)
|
||||||
{
|
{
|
||||||
ssize_t count = 0;
|
ssize_t count = 0;
|
||||||
int loops = 10;
|
|
||||||
int repeat = (g_cl->_tx_bytes == 0);
|
int repeat = (g_cl->_tx_bytes == 0);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
@@ -594,13 +593,11 @@ static void process_write_data(struct g_mod_t *g_mod, struct cli_args_t *g_cl)
|
|||||||
|
|
||||||
c = 0;
|
c = 0;
|
||||||
|
|
||||||
} else {
|
|
||||||
loops--;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
count += c;
|
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];
|
g_mod->_write_count_value = g_mod->_write_data[c];
|
||||||
repeat = 0;
|
repeat = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user