mirror of
https://github.com/micropython/micropython.git
synced 2026-01-04 11:10:14 +01:00
rp2/mphalport: Add optional dupterm support.
This commit is contained in:
committed by
Damien George
parent
f44fb76055
commit
5db278f1dd
@@ -26,6 +26,7 @@
|
|||||||
|
|
||||||
#include "py/objstr.h"
|
#include "py/objstr.h"
|
||||||
#include "py/runtime.h"
|
#include "py/runtime.h"
|
||||||
|
#include "extmod/misc.h"
|
||||||
#include "extmod/vfs.h"
|
#include "extmod/vfs.h"
|
||||||
#include "extmod/vfs_fat.h"
|
#include "extmod/vfs_fat.h"
|
||||||
#include "extmod/vfs_lfs.h"
|
#include "extmod/vfs_lfs.h"
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
#include "py/runtime.h"
|
#include "py/runtime.h"
|
||||||
#include "py/stream.h"
|
#include "py/stream.h"
|
||||||
#include "py/mphal.h"
|
#include "py/mphal.h"
|
||||||
|
#include "extmod/misc.h"
|
||||||
#include "shared/timeutils/timeutils.h"
|
#include "shared/timeutils/timeutils.h"
|
||||||
#include "tusb.h"
|
#include "tusb.h"
|
||||||
#include "uart.h"
|
#include "uart.h"
|
||||||
@@ -74,6 +75,9 @@ uintptr_t mp_hal_stdio_poll(uintptr_t poll_flags) {
|
|||||||
ret |= MP_STREAM_POLL_RD;
|
ret |= MP_STREAM_POLL_RD;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#if MICROPY_PY_OS_DUPTERM
|
||||||
|
ret |= mp_uos_dupterm_poll(poll_flags);
|
||||||
|
#endif
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,6 +99,12 @@ int mp_hal_stdin_rx_chr(void) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#if MICROPY_PY_OS_DUPTERM
|
||||||
|
int dupterm_c = mp_uos_dupterm_rx_chr();
|
||||||
|
if (dupterm_c >= 0) {
|
||||||
|
return dupterm_c;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
MICROPY_EVENT_POLL_HOOK
|
MICROPY_EVENT_POLL_HOOK
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -123,6 +133,10 @@ void mp_hal_stdout_tx_strn(const char *str, mp_uint_t len) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if MICROPY_PY_OS_DUPTERM
|
||||||
|
mp_uos_dupterm_tx_strn(str, len);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void mp_hal_delay_ms(mp_uint_t ms) {
|
void mp_hal_delay_ms(mp_uint_t ms) {
|
||||||
|
|||||||
Reference in New Issue
Block a user