unix/unix_mphal: Adjust #if in mp_hal_stdin_rx_chr to improve format.
This commit is contained in:
parent
a642241a12
commit
73670ef281
@ -147,7 +147,6 @@ static int call_dupterm_read(size_t idx) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
int mp_hal_stdin_rx_chr(void) {
|
int mp_hal_stdin_rx_chr(void) {
|
||||||
unsigned char c;
|
|
||||||
#if MICROPY_PY_OS_DUPTERM
|
#if MICROPY_PY_OS_DUPTERM
|
||||||
// TODO only support dupterm one slot at the moment
|
// TODO only support dupterm one slot at the moment
|
||||||
if (MP_STATE_VM(dupterm_objs[0]) != MP_OBJ_NULL) {
|
if (MP_STATE_VM(dupterm_objs[0]) != MP_OBJ_NULL) {
|
||||||
@ -162,10 +161,12 @@ int mp_hal_stdin_rx_chr(void) {
|
|||||||
c = '\r';
|
c = '\r';
|
||||||
}
|
}
|
||||||
return c;
|
return c;
|
||||||
} else {
|
}
|
||||||
main_term:;
|
main_term:;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
MP_THREAD_GIL_EXIT();
|
MP_THREAD_GIL_EXIT();
|
||||||
|
unsigned char c;
|
||||||
int ret = read(0, &c, 1);
|
int ret = read(0, &c, 1);
|
||||||
MP_THREAD_GIL_ENTER();
|
MP_THREAD_GIL_ENTER();
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
@ -174,9 +175,6 @@ int mp_hal_stdin_rx_chr(void) {
|
|||||||
c = '\r';
|
c = '\r';
|
||||||
}
|
}
|
||||||
return c;
|
return c;
|
||||||
#if MICROPY_PY_OS_DUPTERM
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void mp_hal_stdout_tx_strn(const char *str, size_t len) {
|
void mp_hal_stdout_tx_strn(const char *str, size_t len) {
|
||||||
|
Loading…
Reference in New Issue
Block a user