X-Git-Url: https://git.cryptolib.org/?a=blobdiff_plain;f=test_src%2Fcli.c;h=b9659fe2cd544fe1a9814a31343d8faf6cdb75ad;hb=32e8c149a5d05724c3cf32a9ec9b795ac9e87be3;hp=5fe4c8eac3e6257aa92b50c1d729fa22735a8b3e;hpb=a0ce7501a539a69774754515268ab02297dabba7;p=avr-crypto-lib.git diff --git a/test_src/cli.c b/test_src/cli.c index 5fe4c8e..b9659fe 100644 --- a/test_src/cli.c +++ b/test_src/cli.c @@ -81,6 +81,17 @@ void cli_putstr_P(PGM_P s){ } } +uint8_t cli_getsn(char* s, uint16_t n){ + char c; + if(n==0) + return 2; + while((c=cli_getc_cecho())!='\0' && c!='\r' && n--){ + *s++=c; + } + *s='\0'; + return (c=='\r')?0:1; +} + void cli_hexdump(void* data, uint16_t length){ char hex_tab[] = {'0', '1', '2', '3', '4', '5', '6', '7',