File tree 1 file changed +12
-14
lines changed
1 file changed +12
-14
lines changed Original file line number Diff line number Diff line change @@ -147,7 +147,6 @@ static int call_dupterm_read(size_t idx) {
147
147
#endif
148
148
149
149
int mp_hal_stdin_rx_chr (void ) {
150
- unsigned char c ;
151
150
#if MICROPY_PY_OS_DUPTERM
152
151
// TODO only support dupterm one slot at the moment
153
152
if (MP_STATE_VM (dupterm_objs [0 ]) != MP_OBJ_NULL ) {
@@ -162,21 +161,20 @@ int mp_hal_stdin_rx_chr(void) {
162
161
c = '\r' ;
163
162
}
164
163
return c ;
165
- } else {
166
- main_term :;
167
- #endif
168
- MP_THREAD_GIL_EXIT ();
169
- int ret = read (0 , & c , 1 );
170
- MP_THREAD_GIL_ENTER ();
171
- if (ret == 0 ) {
172
- c = 4 ; // EOF, ctrl-D
173
- } else if (c == '\n' ) {
174
- c = '\r' ;
175
- }
176
- return c ;
177
- #if MICROPY_PY_OS_DUPTERM
178
164
}
165
+ main_term :;
179
166
#endif
167
+
168
+ MP_THREAD_GIL_EXIT ();
169
+ unsigned char c ;
170
+ int ret = read (0 , & c , 1 );
171
+ MP_THREAD_GIL_ENTER ();
172
+ if (ret == 0 ) {
173
+ c = 4 ; // EOF, ctrl-D
174
+ } else if (c == '\n' ) {
175
+ c = '\r' ;
176
+ }
177
+ return c ;
180
178
}
181
179
182
180
void mp_hal_stdout_tx_strn (const char * str , size_t len ) {
You can’t perform that action at this time.
0 commit comments