File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,6 +38,11 @@ static os_event_t uart_evt_queue[16];
3838
3939static void uart0_rx_intr_handler (void * para );
4040
41+ void soft_reset (void );
42+ void mp_keyboard_interrupt (void );
43+
44+ int interrupt_char ;
45+
4146/******************************************************************************
4247 * FunctionName : uart_config
4348 * Description : Internal used function
@@ -168,7 +173,11 @@ static void uart0_rx_intr_handler(void *para) {
168173
169174 while (READ_PERI_REG (UART_STATUS (uart_no )) & (UART_RXFIFO_CNT << UART_RXFIFO_CNT_S )) {
170175 uint8 RcvChar = READ_PERI_REG (UART_FIFO (uart_no )) & 0xff ;
171- ringbuf_put (& input_buf , RcvChar );
176+ if (RcvChar == interrupt_char ) {
177+ mp_keyboard_interrupt ();
178+ } else {
179+ ringbuf_put (& input_buf , RcvChar );
180+ }
172181 }
173182
174183 mp_hal_signal_input ();
@@ -237,10 +246,6 @@ void ICACHE_FLASH_ATTR uart_reattach() {
237246#include "py/obj.h"
238247#include "lib/utils/pyexec.h"
239248
240- void soft_reset (void );
241- void mp_keyboard_interrupt (void );
242-
243- int interrupt_char ;
244249#if MICROPY_REPL_EVENT_DRIVEN
245250void uart_task_handler (os_event_t * evt ) {
246251 if (pyexec_repl_active ) {
You can’t perform that action at this time.
0 commit comments