From fc475c50dfe6ec564d0d4ee2e1172c677c85e815 Mon Sep 17 00:00:00 2001 From: MichaelDvP <59284019+MichaelDvP@users.noreply.github.com> Date: Tue, 24 Nov 2020 14:34:34 +0100 Subject: [PATCH] fix uart8266 --- src/uart/emsuart_esp8266.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/uart/emsuart_esp8266.cpp b/src/uart/emsuart_esp8266.cpp index d73cb1b4d..e6abdbe9a 100644 --- a/src/uart/emsuart_esp8266.cpp +++ b/src/uart/emsuart_esp8266.cpp @@ -41,7 +41,6 @@ bool EMSuart::sending_ = false; // Important: must not use ICACHE_FLASH_ATTR // void ICACHE_RAM_ATTR EMSuart::emsuart_rx_intr_handler(void * para) { - static uint8_t uart_buffer[EMS_MAXBUFFERSIZE + 2]; if (USIS(EMSUART_UART) & ((1 << UIBD))) { // BREAK detection = End of EMS data block USC0(EMSUART_UART) &= ~(1 << UCBRK); // reset tx-brk @@ -49,8 +48,9 @@ void ICACHE_RAM_ATTR EMSuart::emsuart_rx_intr_handler(void * para) { drop_next_rx = true; // we have trash in buffer } - USIC(EMSUART_UART) = (1 << UIBD); // INT clear the BREAK detect interrupt - static uint8_t length = 0; + USIC(EMSUART_UART) = (1 << UIBD); // INT clear the BREAK detect interrupt + uint8_t length = 0; + uint8_t uart_buffer[EMS_MAXBUFFERSIZE + 2]; while ((USS(EMSUART_UART) >> USRXC) & 0x0FF) { // read fifo into buffer uint8_t rx = USF(EMSUART_UART); @@ -334,4 +334,4 @@ uint16_t ICACHE_FLASH_ATTR EMSuart::transmit(uint8_t * buf, uint8_t len) { } // namespace emsesp -#endif \ No newline at end of file +#endif