Skip to content

Commit e3b2a3c

Browse files
authored
Merge pull request #5 from sparkfun/NoTouchSerialPort
Add software serial support for ESP32
2 parents 38336e5 + 3be8766 commit e3b2a3c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/SparkFun_u-blox_SARA-R5_Arduino_Library.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3246,7 +3246,8 @@ SARA_R5_error_t SARA_R5::init(unsigned long baud,
32463246

32473247
if (_printDebug == true) _debugPort->println(F("Begin module init."));
32483248

3249-
beginSerial(baud); // Begin serial
3249+
if(hwAvailable() == -1)
3250+
beginSerial(baud); // If port is null, begin serial
32503251

32513252
if (initType == SARA_R5_INIT_AUTOBAUD)
32523253
{
@@ -3798,6 +3799,7 @@ void SARA_R5::beginSerial(unsigned long baud)
37983799
#ifdef SARA_R5_SOFTWARE_SERIAL_ENABLED
37993800
else if (_softSerial != NULL)
38003801
{
3802+
_softSerial->end();
38013803
_softSerial->begin(baud);
38023804
}
38033805
#endif

0 commit comments

Comments
 (0)