Skip to content

Commit f0682af

Browse files
committed
Move restart after powerOn, otherwise it will never restart
1 parent 83b9450 commit f0682af

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/Modem.cpp

+8-5
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,6 @@ int ModemClass::begin(bool restart)
6161
// datasheet warns not to use _resetPin, this may lead to an unrecoverable state
6262
digitalWrite(_resetPin, LOW);
6363

64-
if (restart) {
65-
shutdown();
66-
end();
67-
}
68-
6964
_uart->begin(_baud > 115200 ? 115200 : _baud);
7065

7166
// power on module
@@ -80,6 +75,14 @@ int ModemClass::begin(bool restart)
8075
}
8176
}
8277

78+
if (restart) {
79+
shutdown();
80+
end();
81+
delay(1500);
82+
setVIntPin(SARA_VINT_OFF);
83+
begin(false);
84+
}
85+
8386
if (!autosense()) {
8487
return 0;
8588
}

0 commit comments

Comments
 (0)