mirror of
https://github.com/elua/elua.git
synced 2025-01-08 20:56:17 +08:00
Added option CON_CR_TO_LF to enable using console without having to change
settings of terminal software to use CR+LF on send.
This commit is contained in:
parent
922d70c12b
commit
a31daebc0a
@ -55,12 +55,15 @@ static _ssize_t std_read( struct _reent *r, int fd, void* vptr, size_t len )
|
|||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if( !isprint( c ) && c != '\n' && c != STD_CTRLZ_CODE )
|
if( !isprint( c ) && c != '\n' && c != '\r' && c != STD_CTRLZ_CODE )
|
||||||
continue;
|
continue;
|
||||||
if( c == STD_CTRLZ_CODE )
|
if( c == STD_CTRLZ_CODE )
|
||||||
return 0;
|
return 0;
|
||||||
else
|
#ifdef CON_CR_TO_LF
|
||||||
std_send_char_func( DM_STDOUT_NUM, c );
|
if ( c == '\r' )
|
||||||
|
c = '\n';
|
||||||
|
#endif
|
||||||
|
std_send_char_func( DM_STDOUT_NUM, c );
|
||||||
ptr[ i ] = c;
|
ptr[ i ] = c;
|
||||||
if( c == '\n' )
|
if( c == '\n' )
|
||||||
{
|
{
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
#define TERM_LINES 25
|
#define TERM_LINES 25
|
||||||
#define TERM_COLS 80
|
#define TERM_COLS 80
|
||||||
#define TERM_TIMEOUT 100000
|
#define TERM_TIMEOUT 100000
|
||||||
|
//#define CON_CR_TO_LF
|
||||||
|
|
||||||
// *****************************************************************************
|
// *****************************************************************************
|
||||||
// Auxiliary libraries that will be compiled for this platform
|
// Auxiliary libraries that will be compiled for this platform
|
||||||
|
Loading…
x
Reference in New Issue
Block a user