From a31daebc0a059c41e007d1ad093552e86496070f Mon Sep 17 00:00:00 2001 From: James Snyder Date: Sat, 7 Mar 2009 23:37:28 +0000 Subject: [PATCH] Added option CON_CR_TO_LF to enable using console without having to change settings of terminal software to use CR+LF on send. --- src/newlib/genstd.c | 9 ++++++--- src/platform/lm3s/platform_conf.h | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/newlib/genstd.c b/src/newlib/genstd.c index ff60f286..031d36de 100644 --- a/src/newlib/genstd.c +++ b/src/newlib/genstd.c @@ -55,12 +55,15 @@ static _ssize_t std_read( struct _reent *r, int fd, void* vptr, size_t len ) } continue; } - if( !isprint( c ) && c != '\n' && c != STD_CTRLZ_CODE ) + if( !isprint( c ) && c != '\n' && c != '\r' && c != STD_CTRLZ_CODE ) continue; if( c == STD_CTRLZ_CODE ) return 0; - else - std_send_char_func( DM_STDOUT_NUM, c ); +#ifdef CON_CR_TO_LF + if ( c == '\r' ) + c = '\n'; +#endif + std_send_char_func( DM_STDOUT_NUM, c ); ptr[ i ] = c; if( c == '\n' ) { diff --git a/src/platform/lm3s/platform_conf.h b/src/platform/lm3s/platform_conf.h index d2d057dd..35ed229c 100644 --- a/src/platform/lm3s/platform_conf.h +++ b/src/platform/lm3s/platform_conf.h @@ -33,6 +33,7 @@ #define TERM_LINES 25 #define TERM_COLS 80 #define TERM_TIMEOUT 100000 +//#define CON_CR_TO_LF // ***************************************************************************** // Auxiliary libraries that will be compiled for this platform