File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ static char *heap = RT_NULL;
6868void mpy_main (const char * filename ) {
6969 int stack_dummy ;
7070 stack_top = (void * )& stack_dummy ;
71+ rt_uint16_t old_flag ;
7172
7273 rtt_getchar_init ();
7374
@@ -98,6 +99,11 @@ void mpy_main(const char *filename) {
9899 mp_obj_list_init (mp_sys_argv , 0 );
99100 readline_init0 ();
100101
102+ /* Save the open flag */
103+ old_flag = rt_console_get_device ()-> open_flag ;
104+ /* clean the stream flag. stream flag will automatically append '\r' */
105+ rt_console_get_device ()-> open_flag &= ~RT_DEVICE_FLAG_STREAM ;
106+
101107 if (filename ) {
102108#ifndef MICROPYTHON_USING_UOS
103109 rt_kprintf ("Please enable uos module in sys module option first.\n" );
@@ -137,6 +143,9 @@ void mpy_main(const char *filename) {
137143 }
138144 }
139145
146+ /* restore the open flag */
147+ rt_console_get_device ()-> open_flag = old_flag ;
148+
140149 gc_sweep_all ();
141150
142151 mp_deinit ();
You can’t perform that action at this time.
0 commit comments