Skip to content

Commit fa34053

Browse files
authored
better yield instead of delay
1 parent f6a8275 commit fa34053

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/SparkFun_u-blox_SARA-R5_Arduino_Library.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ bool SARA_R5::bufferedPoll(void)
247247
_saraRXBuffer[avail++] = c;
248248
timeIn = millis();
249249
} else {
250-
delay(SARA_R5_READ_NODATA_DELAY);
250+
yield();
251251
}
252252
}
253253

@@ -681,7 +681,7 @@ bool SARA_R5::poll(void)
681681
c = readChar();
682682
_saraRXBuffer[avail++] = c;
683683
} else {
684-
delay(SARA_R5_READ_NODATA_DELAY);
684+
yield();
685685
}
686686
}
687687

@@ -5483,7 +5483,7 @@ SARA_R5_error_t SARA_R5::waitForResponse(const char *expectedResponse, const cha
54835483
_saraResponseBacklog[_saraResponseBacklogLength++] = c;
54845484
}
54855485
} else {
5486-
delay(SARA_R5_READ_NODATA_DELAY);
5486+
yield();
54875487
}
54885488
}
54895489

@@ -5606,7 +5606,7 @@ SARA_R5_error_t SARA_R5::sendCommandWithResponse(
56065606
_saraResponseBacklog[_saraResponseBacklogLength++] = c;
56075607
}
56085608
} else {
5609-
delay(SARA_R5_READ_NODATA_DELAY);
5609+
yield();
56105610
}
56115611
}
56125612

@@ -5673,7 +5673,7 @@ void SARA_R5::sendCommand(const char *command, bool at)
56735673
_saraResponseBacklog[_saraResponseBacklogLength++] = c;
56745674
timeIn = millis();
56755675
} else {
5676-
delay(SARA_R5_READ_NODATA_DELAY);
5676+
yield();
56775677
}
56785678
}
56795679
}

src/SparkFun_u-blox_SARA-R5_Arduino_Library.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@
8888
#define SARA_R5_POWER_OFF_TIMEOUT 40000 // Datasheet says 40 seconds...
8989
#define SARA_R5_IP_CONNECT_TIMEOUT 130000
9090
#define SARA_R5_POLL_DELAY 1
91-
#define SARA_R5_READ_NODATA_DELAY 1 // in case the hw has do data in the interface delay to give a chance to ther tasks.
9291
#define SARA_R5_SOCKET_WRITE_TIMEOUT 10000
9392

9493
// ## Suported AT Commands

0 commit comments

Comments
 (0)