kopia lustrzana https://github.com/micropython/micropython
rodzic
04fe62d06f
commit
2863dcdf4f
|
@ -156,6 +156,7 @@ SRC_LIB += $(addprefix lib/,\
|
||||||
libc/string0.c \
|
libc/string0.c \
|
||||||
mp-readline/readline.c \
|
mp-readline/readline.c \
|
||||||
utils/pyexec.c \
|
utils/pyexec.c \
|
||||||
|
utils/sys_stdio_mphal.c \
|
||||||
utils/interrupt_char.c \
|
utils/interrupt_char.c \
|
||||||
timeutils/timeutils.c \
|
timeutils/timeutils.c \
|
||||||
)
|
)
|
||||||
|
@ -342,7 +343,7 @@ $(BUILD)/$(OUTPUT_FILENAME).elf: $(OBJ)
|
||||||
$(Q)$(SIZE) $@
|
$(Q)$(SIZE) $@
|
||||||
|
|
||||||
# List of sources for qstr extraction
|
# List of sources for qstr extraction
|
||||||
SRC_QSTR += $(SRC_C) $(DRIVERS_SRC_C) $(SRC_BOARD_MODULES)
|
SRC_QSTR += $(SRC_C) $(SRC_LIB) $(DRIVERS_SRC_C) $(SRC_BOARD_MODULES)
|
||||||
|
|
||||||
# Append any auto-generated sources that are needed by sources listed in
|
# Append any auto-generated sources that are needed by sources listed in
|
||||||
# SRC_QSTR
|
# SRC_QSTR
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
#include "py/mphal.h"
|
#include "py/mphal.h"
|
||||||
#include "py/mperrno.h"
|
#include "py/mperrno.h"
|
||||||
#include "py/runtime.h"
|
#include "py/runtime.h"
|
||||||
|
#include "py/stream.h"
|
||||||
#include "uart.h"
|
#include "uart.h"
|
||||||
#include "nrfx_errors.h"
|
#include "nrfx_errors.h"
|
||||||
#include "nrfx_config.h"
|
#include "nrfx_config.h"
|
||||||
|
@ -53,6 +54,15 @@ void mp_hal_set_interrupt_char(int c) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !MICROPY_PY_BLE_NUS
|
#if !MICROPY_PY_BLE_NUS
|
||||||
|
uintptr_t mp_hal_stdio_poll(uintptr_t poll_flags) {
|
||||||
|
uintptr_t ret = 0;
|
||||||
|
if ((poll_flags & MP_STREAM_POLL_RD) && MP_STATE_PORT(board_stdio_uart) != NULL
|
||||||
|
&& uart_rx_any(MP_STATE_PORT(board_stdio_uart))) {
|
||||||
|
ret |= MP_STREAM_POLL_RD;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
int mp_hal_stdin_rx_chr(void) {
|
int mp_hal_stdin_rx_chr(void) {
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if (MP_STATE_PORT(board_stdio_uart) != NULL && uart_rx_any(MP_STATE_PORT(board_stdio_uart))) {
|
if (MP_STATE_PORT(board_stdio_uart) != NULL && uart_rx_any(MP_STATE_PORT(board_stdio_uart))) {
|
||||||
|
|
Ładowanie…
Reference in New Issue