Version using RawSerial instead of Serial (thread safe)
Fork of FONA_Cellphone_Library by
Diff: Adafruit_FONA.cpp
- Revision:
- 3:7916fb0cc4b0
- Parent:
- 2:f292ec14f01e
- Child:
- 4:243ae42bfd65
diff -r f292ec14f01e -r 7916fb0cc4b0 Adafruit_FONA.cpp --- a/Adafruit_FONA.cpp Fri Jun 30 09:27:36 2017 +0000 +++ b/Adafruit_FONA.cpp Tue Jul 04 08:40:08 2017 +0000 @@ -37,28 +37,28 @@ // INIT Reboot process _rstpin = HIGH; - wait_ms(10); + Thread::wait(10); _rstpin = LOW; - wait_ms(100); + Thread::wait(100); _rstpin = HIGH; // give 3 seconds to reboot - wait_ms(3000); + Thread::wait(3000); // flushes the serial port while (readable()) getc(); // Make sure FONA is alive sendCheckReply("AT", "OK"); - wait_ms(100); + Thread::wait(100); sendCheckReply("AT", "OK"); - wait_ms(100); + Thread::wait(100); sendCheckReply("AT", "OK"); - wait_ms(100); + Thread::wait(100); // turn off Echo! sendCheckReply("ATE0", "OK"); - wait_ms(100); + Thread::wait(100); // Just checks if the FONA even responds, if it doesnt, then return false if (! sendCheckReply("ATE0", "OK")) { @@ -1190,7 +1190,7 @@ getc(); timeoutloop = 0; // If char was received reset the timer } - wait_ms(1); + Thread::wait(1); } } @@ -1237,7 +1237,7 @@ if (timeout == 0) { break; } - wait_ms(1); + Thread::wait(1); } replybuffer[replyidx] = 0; // null term return replyidx;