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