mirror of https://github.com/arendst/Tasmota.git
Update TasmotaSerial to 2.3.0
Update TasmotaSerial to 2.3.0
This commit is contained in:
parent
9c8af6428e
commit
c998760deb
|
@ -14,6 +14,7 @@ TasmotaSerial KEYWORD1
|
||||||
#######################################
|
#######################################
|
||||||
|
|
||||||
begin KEYWORD2
|
begin KEYWORD2
|
||||||
|
hardwareSerial KEYWORD2
|
||||||
read KEYWORD2
|
read KEYWORD2
|
||||||
write KEYWORD2
|
write KEYWORD2
|
||||||
available KEYWORD2
|
available KEYWORD2
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "TasmotaSerial",
|
"name": "TasmotaSerial",
|
||||||
"version": "2.2.0",
|
"version": "2.3.0",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"serial", "io", "TasmotaSerial"
|
"serial", "io", "TasmotaSerial"
|
||||||
],
|
],
|
|
@ -1,5 +1,5 @@
|
||||||
name=TasmotaSerial
|
name=TasmotaSerial
|
||||||
version=2.2.0
|
version=2.3.0
|
||||||
author=Theo Arends
|
author=Theo Arends
|
||||||
maintainer=Theo Arends <theo@arends.com>
|
maintainer=Theo Arends <theo@arends.com>
|
||||||
sentence=Implementation of software serial with hardware serial fallback for ESP8266.
|
sentence=Implementation of software serial with hardware serial fallback for ESP8266.
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
TasmotaSerial.cpp - Minimal implementation of software serial for Tasmota
|
TasmotaSerial.cpp - Minimal implementation of software serial for Tasmota
|
||||||
|
|
||||||
Copyright (C) 2018 Theo Arends
|
Copyright (C) 2019 Theo Arends
|
||||||
|
|
||||||
This library is free software: you can redistribute it and/or modify
|
This library is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -100,7 +100,7 @@ TasmotaSerial::TasmotaSerial(int receive_pin, int transmit_pin, int hardware_fal
|
||||||
m_buffer = (uint8_t*)malloc(TM_SERIAL_BUFFER_SIZE);
|
m_buffer = (uint8_t*)malloc(TM_SERIAL_BUFFER_SIZE);
|
||||||
if (m_buffer == NULL) return;
|
if (m_buffer == NULL) return;
|
||||||
// Use getCycleCount() loop to get as exact timing as possible
|
// Use getCycleCount() loop to get as exact timing as possible
|
||||||
m_bit_time = ESP.getCpuFreqMHz() *1000000 /TM_SERIAL_BAUDRATE;
|
m_bit_time = F_CPU / TM_SERIAL_BAUDRATE;
|
||||||
pinMode(m_rx_pin, INPUT);
|
pinMode(m_rx_pin, INPUT);
|
||||||
tms_obj_list[m_rx_pin] = this;
|
tms_obj_list[m_rx_pin] = this;
|
||||||
attachInterrupt(m_rx_pin, ISRList[m_rx_pin], FALLING);
|
attachInterrupt(m_rx_pin, ISRList[m_rx_pin], FALLING);
|
||||||
|
@ -145,7 +145,7 @@ bool TasmotaSerial::begin(long speed, int stop_bits) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Use getCycleCount() loop to get as exact timing as possible
|
// Use getCycleCount() loop to get as exact timing as possible
|
||||||
m_bit_time = ESP.getCpuFreqMHz() *1000000 /speed;
|
m_bit_time = F_CPU / speed;
|
||||||
m_high_speed = (speed > 9600);
|
m_high_speed = (speed > 9600);
|
||||||
}
|
}
|
||||||
return m_valid;
|
return m_valid;
|
||||||
|
@ -257,7 +257,7 @@ void TasmotaSerial::rxRead()
|
||||||
TM_SERIAL_WAIT;
|
TM_SERIAL_WAIT;
|
||||||
}
|
}
|
||||||
// Store the received value in the buffer unless we have an overflow
|
// Store the received value in the buffer unless we have an overflow
|
||||||
int next = (m_in_pos+1) % TM_SERIAL_BUFFER_SIZE;
|
unsigned int next = (m_in_pos+1) % TM_SERIAL_BUFFER_SIZE;
|
||||||
if (next != (int)m_out_pos) {
|
if (next != (int)m_out_pos) {
|
||||||
m_buffer[m_in_pos] = rec;
|
m_buffer[m_in_pos] = rec;
|
||||||
m_in_pos = next;
|
m_in_pos = next;
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
TasmotaSerial.h - Minimal implementation of software serial for Tasmota
|
TasmotaSerial.h - Minimal implementation of software serial for Tasmota
|
||||||
|
|
||||||
Copyright (C) 2018 Theo Arends
|
Copyright (C) 2019 Theo Arends
|
||||||
|
|
||||||
This library is free software: you can redistribute it and/or modify
|
This library is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -22,7 +22,7 @@
|
||||||
/*********************************************************************************************\
|
/*********************************************************************************************\
|
||||||
* TasmotaSerial supports up to 115200 baud with fixed buffer size of 64 bytes using optional no iram
|
* TasmotaSerial supports up to 115200 baud with fixed buffer size of 64 bytes using optional no iram
|
||||||
*
|
*
|
||||||
* Based on EspSoftwareSerial v3.3.1 by Peter Lerup (https://github.com/plerup/espsoftwareserial)
|
* Based on EspSoftwareSerial v3.4.3 by Peter Lerup (https://github.com/plerup/espsoftwareserial)
|
||||||
\*********************************************************************************************/
|
\*********************************************************************************************/
|
||||||
|
|
||||||
#define TM_SERIAL_BAUDRATE 9600 // Default baudrate
|
#define TM_SERIAL_BAUDRATE 9600 // Default baudrate
|
Loading…
Reference in New Issue