diff --git a/src/emsuart.cpp b/src/emsuart.cpp index 0724b29db..6744f0c5c 100644 --- a/src/emsuart.cpp +++ b/src/emsuart.cpp @@ -109,7 +109,7 @@ void ICACHE_FLASH_ATTR emsuart_init() { USC0(EMSUART_UART) |= (tmp); // set bits USC0(EMSUART_UART) &= ~(tmp); // clear bits - // conf 1 params + // conf1 params // UCTOE = RX TimeOut enable (default is 1) // UCTOT = RX TimeOut Threshold (7bit) = want this when no more data after 2 characters. (default is 2) // UCFFT = RX FIFO Full Threshold (7 bit) = want this to be 31 for 32 bytes of buffer. (default was 127). @@ -137,6 +137,14 @@ void ICACHE_FLASH_ATTR emsuart_init() { system_uart_swap(); } +/* + * stop UART0 driver + */ +void ICACHE_FLASH_ATTR emsuart_stop() { + ETS_UART_INTR_DISABLE(); + ETS_UART_INTR_ATTACH(NULL, NULL); +} + /* * Send a BRK signal * Which is a 11-bit set of zero's (11 cycles) diff --git a/src/emsuart.h b/src/emsuart.h index f3d3f6739..e4c7bf617 100644 --- a/src/emsuart.h +++ b/src/emsuart.h @@ -28,6 +28,7 @@ typedef struct { } _EMSRxBuf; void ICACHE_FLASH_ATTR emsuart_init(); +void ICACHE_FLASH_ATTR emsuart_stop(); void ICACHE_FLASH_ATTR emsuart_tx_buffer(uint8_t * buf, uint8_t len); void ICACHE_FLASH_ATTR emsaurt_tx_poll(); void ICACHE_FLASH_ATTR emsuart_tx_brk();