mirror of
https://github.com/letscontrolit/ESPEasy.git
synced 2026-07-28 04:07:47 +00:00
[ESPeasy Serial] Update to 1.0.12 to allow invalid pin config
This commit is contained in:
@@ -34,10 +34,12 @@ void ESPeasySerial::begin(unsigned long baud, uint32_t config
|
||||
// Make sure the extra bit is set for the config. The config differs between ESP32 and ESP82xx
|
||||
config = config | 0x8000000;
|
||||
|
||||
// Timeout added for 1.0.1
|
||||
// See: https://github.com/espressif/arduino-esp32/commit/233d31bed22211e8c85f82bcf2492977604bbc78
|
||||
// getHW()->begin(baud, config, _receivePin, _transmitPin, invert, timeout_ms);
|
||||
getHW()->begin(baud, config, _receivePin, _transmitPin, _inverse_logic);
|
||||
if (isValid()) {
|
||||
// Timeout added for 1.0.1
|
||||
// See: https://github.com/espressif/arduino-esp32/commit/233d31bed22211e8c85f82bcf2492977604bbc78
|
||||
//getHW()->begin(baud, config, _receivePin, _transmitPin, invert, timeout_ms);
|
||||
getHW()->begin(baud, config, _receivePin, _transmitPin, _inverse_logic);
|
||||
}
|
||||
}
|
||||
|
||||
void ESPeasySerial::end() {
|
||||
|
||||
@@ -111,12 +111,16 @@ struct ESPeasySerialType {
|
||||
if (receivePin == 3 && transmitPin == 1) {
|
||||
return serialtype::serial0; // UART0
|
||||
}
|
||||
// Serial1 on ESP32 uses default pins connected to flash
|
||||
// So must make sure to set them to other pins.
|
||||
if (receivePin == 13 && transmitPin == 15) {
|
||||
return serialtype::serial1; // UART1
|
||||
}
|
||||
if (receivePin == 16 && transmitPin == 17) {
|
||||
return serialtype::serial2; // UART2
|
||||
}
|
||||
// Serial1 on ESP32 uses default pins connected to flash
|
||||
// So must make sure to set them to other pins.
|
||||
return serialtype::serial1;
|
||||
|
||||
return serialtype::MAX_SERIAL_TYPE;
|
||||
}
|
||||
|
||||
#endif // ESP32
|
||||
@@ -137,6 +141,10 @@ struct ESPeasySerialType {
|
||||
// it's RX pin is occupied for flash chip connection.
|
||||
return serialtype::serial1;
|
||||
}
|
||||
if (receivePin == -1 && transmitPin == -1) {
|
||||
// No pins set, so no serial type
|
||||
return serialtype::MAX_SERIAL_TYPE;
|
||||
}
|
||||
return serialtype::software;
|
||||
}
|
||||
#endif // ESP8266
|
||||
|
||||
@@ -37,7 +37,7 @@ ESPeasySerial::ESPeasySerial(int receivePin, int transmitPin, bool inverse_logic
|
||||
_serialtype = ESPeasySerialType::getSerialType(receivePin, transmitPin);
|
||||
if (isSWserial()) {
|
||||
_swserial = new ESPeasySoftwareSerial(receivePin, transmitPin, inverse_logic, buffSize);
|
||||
} else {
|
||||
} else if (isValid()) {
|
||||
getHW()->pins(transmitPin, receivePin);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ESPeasySerial",
|
||||
"version": "1.0.10",
|
||||
"version": "1.0.12",
|
||||
"keywords": [
|
||||
"serial", "io", "softwareserial", "hardwareserial"
|
||||
],
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
name=ESPeasySerial
|
||||
version=1.0.10
|
||||
version=1.0.12
|
||||
author=Gijs Noorlander
|
||||
maintainer=Gijs Noorlander <gijs.noorlander@gmail.com>
|
||||
sentence=Wrapper for SoftwareSerial and HardwareSerial for ESP8266 and ESP32.
|
||||
|
||||
Reference in New Issue
Block a user