mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-24 03:06:33 +00:00
Moved kTasmotaSerialConfig to TasmotaSerial.h from Tasmota.h.
This commit is contained in:
parent
3c8cda25fb
commit
30d35b8c15
@ -28,12 +28,6 @@ extern "C" {
|
||||
#include <TasmotaSerial.h>
|
||||
|
||||
#ifdef ESP8266
|
||||
|
||||
// added to access kTasmotaSerialConfig
|
||||
#include "../../../../tasmota/tasmota_compat.h"
|
||||
#include "../../../../tasmota/tasmota.h"
|
||||
|
||||
|
||||
void IRAM_ATTR callRxRead(void *self) { ((TasmotaSerial*)self)->rxRead(); };
|
||||
|
||||
// As the Arduino attachInterrupt has no parameter, lists of objects
|
||||
|
@ -35,6 +35,27 @@
|
||||
#include <HardwareSerial.h>
|
||||
#endif
|
||||
|
||||
#ifdef ESP8266
|
||||
const uint8_t kTasmotaSerialConfig[] PROGMEM = {
|
||||
SERIAL_5N1, SERIAL_6N1, SERIAL_7N1, SERIAL_8N1,
|
||||
SERIAL_5N2, SERIAL_6N2, SERIAL_7N2, SERIAL_8N2,
|
||||
SERIAL_5E1, SERIAL_6E1, SERIAL_7E1, SERIAL_8E1,
|
||||
SERIAL_5E2, SERIAL_6E2, SERIAL_7E2, SERIAL_8E2,
|
||||
SERIAL_5O1, SERIAL_6O1, SERIAL_7O1, SERIAL_8O1,
|
||||
SERIAL_5O2, SERIAL_6O2, SERIAL_7O2, SERIAL_8O2
|
||||
};
|
||||
#endif // ESP8266
|
||||
#ifdef ESP32
|
||||
const uint32_t kTasmotaSerialConfig[] PROGMEM = {
|
||||
SERIAL_5N1, SERIAL_6N1, SERIAL_7N1, SERIAL_8N1,
|
||||
SERIAL_5N2, SERIAL_6N2, SERIAL_7N2, SERIAL_8N2,
|
||||
SERIAL_5E1, SERIAL_6E1, SERIAL_7E1, SERIAL_8E1,
|
||||
SERIAL_5E2, SERIAL_6E2, SERIAL_7E2, SERIAL_8E2,
|
||||
SERIAL_5O1, SERIAL_6O1, SERIAL_7O1, SERIAL_8O1,
|
||||
SERIAL_5O2, SERIAL_6O2, SERIAL_7O2, SERIAL_8O2
|
||||
};
|
||||
#endif // ESP32
|
||||
|
||||
class TasmotaSerial : public Stream {
|
||||
public:
|
||||
TasmotaSerial(int receive_pin, int transmit_pin, int hardware_fallback = 0, int nwmode = 0, int buffer_size = TM_SERIAL_BUFFER_SIZE);
|
||||
|
@ -28,6 +28,7 @@ bool knx_started = false;
|
||||
/*********************************************************************************************\
|
||||
* Watchdog extension (https://github.com/esp8266/Arduino/issues/1532)
|
||||
\*********************************************************************************************/
|
||||
#include <TasmotaSerial.h>
|
||||
|
||||
#ifdef ESP8266
|
||||
#include <Ticker.h>
|
||||
|
@ -431,27 +431,6 @@ enum TasmotaSerialConfig {
|
||||
TS_SERIAL_5O1, TS_SERIAL_6O1, TS_SERIAL_7O1, TS_SERIAL_8O1,
|
||||
TS_SERIAL_5O2, TS_SERIAL_6O2, TS_SERIAL_7O2, TS_SERIAL_8O2 };
|
||||
|
||||
#ifdef ESP8266
|
||||
const SerConfu8 kTasmotaSerialConfig[] PROGMEM = {
|
||||
SERIAL_5N1, SERIAL_6N1, SERIAL_7N1, SERIAL_8N1,
|
||||
SERIAL_5N2, SERIAL_6N2, SERIAL_7N2, SERIAL_8N2,
|
||||
SERIAL_5E1, SERIAL_6E1, SERIAL_7E1, SERIAL_8E1,
|
||||
SERIAL_5E2, SERIAL_6E2, SERIAL_7E2, SERIAL_8E2,
|
||||
SERIAL_5O1, SERIAL_6O1, SERIAL_7O1, SERIAL_8O1,
|
||||
SERIAL_5O2, SERIAL_6O2, SERIAL_7O2, SERIAL_8O2
|
||||
};
|
||||
#endif // ESP8266
|
||||
#ifdef ESP32
|
||||
const uint32_t kTasmotaSerialConfig[] PROGMEM = {
|
||||
SERIAL_5N1, SERIAL_6N1, SERIAL_7N1, SERIAL_8N1,
|
||||
SERIAL_5N2, SERIAL_6N2, SERIAL_7N2, SERIAL_8N2,
|
||||
SERIAL_5E1, SERIAL_6E1, SERIAL_7E1, SERIAL_8E1,
|
||||
SERIAL_5E2, SERIAL_6E2, SERIAL_7E2, SERIAL_8E2,
|
||||
SERIAL_5O1, SERIAL_6O1, SERIAL_7O1, SERIAL_8O1,
|
||||
SERIAL_5O2, SERIAL_6O2, SERIAL_7O2, SERIAL_8O2
|
||||
};
|
||||
#endif // ESP32
|
||||
|
||||
enum TuyaSupportedFunctions { TUYA_MCU_FUNC_NONE,
|
||||
TUYA_MCU_FUNC_SWT1 = 1, TUYA_MCU_FUNC_SWT2, TUYA_MCU_FUNC_SWT3, TUYA_MCU_FUNC_SWT4,
|
||||
TUYA_MCU_FUNC_REL1 = 11, TUYA_MCU_FUNC_REL2, TUYA_MCU_FUNC_REL3, TUYA_MCU_FUNC_REL4, TUYA_MCU_FUNC_REL5,
|
||||
|
Loading…
x
Reference in New Issue
Block a user