Skip to content

Commit

Permalink
sys/console: Make echo of LF optional in silenced NLIP
Browse files Browse the repository at this point in the history
Code was echoing back LF character even when application
requested to silence non-NLIP data on input.
Now this behaviour is still possible but require explicit
setting CONSOLE_NLIP_ECHO_LF which is disabled by default.
  • Loading branch information
kasjer committed Mar 9, 2020
1 parent 8a017bc commit 3c88a94
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sys/console/full/src/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -1021,8 +1021,8 @@ handle_nlip(uint8_t byte)
} else if (byte == CONSOLE_NLIP_PKT_START1) {
nlip_state = NLIP_PKT_START1;
} else {
/* For old code compatibility end of lines characters pass through */
handled = g_console_ignore_non_nlip && byte != '\r' && byte != '\n';
handled = g_console_ignore_non_nlip &&
!MYNEWT_VAL(CONSOLE_NLIP_ECHO_LF) && byte != '\r' && byte != '\n';
}
break;
}
Expand Down
7 changes: 7 additions & 0 deletions sys/console/full/syscfg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ syscfg.defs:
CONSOLE_NLIP:
description: 'Enable NLIP handling in console code'
value: 1
CONSOLE_NLIP_ECHO_LF:
description: >
Enable LF echo even if function console_ignore_non_nlip()
was called to ignore any non NLIP input. This allows for
simple check if application is running correctly
by using simple terminal.
value: 0
CONSOLE_COMPAT:
description: 'Console backward compatibility'
value: 1
Expand Down

0 comments on commit 3c88a94

Please sign in to comment.