Fix #1
This commit is contained in:
@@ -23,12 +23,12 @@
|
|||||||
#include <TinyGsmFifo.h>
|
#include <TinyGsmFifo.h>
|
||||||
|
|
||||||
#if defined(__AVR__)
|
#if defined(__AVR__)
|
||||||
#define GSM_PROGMEM PROGMEM
|
#define TINY_GSM_PROGMEM PROGMEM
|
||||||
typedef const __FlashStringHelper* GsmConstStr;
|
typedef const __FlashStringHelper* GsmConstStr;
|
||||||
#define GFP(x) (reinterpret_cast<GsmConstStr>(x))
|
#define GFP(x) (reinterpret_cast<GsmConstStr>(x))
|
||||||
#define GF(x) F(x)
|
#define GF(x) F(x)
|
||||||
#else
|
#else
|
||||||
#define GSM_PROGMEM
|
#define TINY_GSM_PROGMEM
|
||||||
typedef const char* GsmConstStr;
|
typedef const char* GsmConstStr;
|
||||||
#define GFP(x) x
|
#define GFP(x) x
|
||||||
#define GF(x) x
|
#define GF(x) x
|
||||||
@@ -42,8 +42,10 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define GSM_NL "\r\n"
|
#define GSM_NL "\r\n"
|
||||||
static const char GSM_OK[] GSM_PROGMEM = "OK" GSM_NL;
|
static const char GSM_OK[] TINY_GSM_PROGMEM = "OK" GSM_NL;
|
||||||
static const char GSM_ERROR[] GSM_PROGMEM = "ERROR" GSM_NL;
|
static const char GSM_ERROR[] TINY_GSM_PROGMEM = "ERROR" GSM_NL;
|
||||||
|
|
||||||
|
#define TINY_GSM_YIELD() delay(0)
|
||||||
|
|
||||||
enum SimStatus {
|
enum SimStatus {
|
||||||
SIM_ERROR = 0,
|
SIM_ERROR = 0,
|
||||||
@@ -563,6 +565,7 @@ private:
|
|||||||
void sendAT(Args... cmd) {
|
void sendAT(Args... cmd) {
|
||||||
streamWrite("AT", cmd..., GSM_NL);
|
streamWrite("AT", cmd..., GSM_NL);
|
||||||
stream.flush();
|
stream.flush();
|
||||||
|
TINY_GSM_YIELD();
|
||||||
//DBG("### AT:", cmd...);
|
//DBG("### AT:", cmd...);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -583,6 +586,7 @@ private:
|
|||||||
int index = 0;
|
int index = 0;
|
||||||
unsigned long startMillis = millis();
|
unsigned long startMillis = millis();
|
||||||
do {
|
do {
|
||||||
|
TINY_GSM_YIELD();
|
||||||
while (stream.available() > 0) {
|
while (stream.available() > 0) {
|
||||||
int a = streamRead();
|
int a = streamRead();
|
||||||
if (a <= 0) continue; // Skip 0x00 bytes, just in case
|
if (a <= 0) continue; // Skip 0x00 bytes, just in case
|
||||||
|
|||||||
Reference in New Issue
Block a user