uart driver installed, events

This commit is contained in:
MichaelDvP
2022-04-29 11:52:39 +02:00
parent 43d838548b
commit 53e3600af7
4 changed files with 355 additions and 386 deletions

View File

@@ -20,18 +20,10 @@
/*
* ESP32 UART port by @ArwedL and improved by @MichaelDvP. See https://github.com/emsesp/EMS-ESP/issues/380
*/
#if defined(ESP32)
#ifndef EMSESP_EMSUART_H
#define EMSESP_EMSUART_H
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/ringbuf.h"
#include "freertos/queue.h"
#include "driver/uart.h"
#include "soc/uart_struct.h"
#define EMS_MAXBUFFERSIZE 33 // max size of the buffer. EMS packets are max 32 bytes, plus extra for BRK
#define EMSUART_NUM UART_NUM_2 // on the ESP32 we're using UART2
@@ -76,12 +68,9 @@ class EMSuart {
static uint16_t transmit(const uint8_t * buf, const uint8_t len);
private:
static void emsuart_recvTask(void * para);
static void IRAM_ATTR emsuart_rx_intr_handler(void * para);
static void restart();
static void uart_event_task(void * pvParameters);
};
} // namespace emsesp
#endif
#endif