Ignore '\r' char in board_get

This commit is contained in:
Ivan Baravy 2023-07-19 21:52:00 +01:00
parent 8848ad6833
commit d6081382bc
5 changed files with 15 additions and 7 deletions

View File

@ -4085,7 +4085,7 @@ cmd_board_get(struct shell_ctx *ctx, int argc, char **argv) {
COVERAGE_ON();
c = umka_sys_board_get();
COVERAGE_OFF();
if (c.status) {
if (c.status && (c.value != '\r')) {
fputc(c.value, ctx->fout);
}
} while (c.status && ((c.value != '\n') || flush));

View File

@ -18,12 +18,14 @@ hi
/> board_put \n
/> board_put b
/> board_put c
/> board_put \r
/> board_put \n
/> board_put \r
/> board_put d
/> board_put e
/> board_put f
/>
/> board_get -f
/> board_get -fn
a
bc
def
def

View File

@ -14,9 +14,11 @@ board_put a
board_put \n
board_put b
board_put c
board_put \r
board_put \n
board_put \r
board_put d
board_put e
board_put f
board_get -f
board_get -fn

View File

@ -18,12 +18,14 @@ hi
/> board_put \n
/> board_put b
/> board_put c
/> board_put \r
/> board_put \n
/> board_put \r
/> board_put d
/> board_put e
/> board_put f
/>
/> board_get -f
/> board_get -fn
a
bc
def
def

View File

@ -14,9 +14,11 @@ board_put a
board_put \n
board_put b
board_put c
board_put \r
board_put \n
board_put \r
board_put d
board_put e
board_put f
board_get -f
board_get -fn