Skip to content

Commit 43d3aed

Browse files
committed
Update adafruit_gps.py
1 parent 5ffed45 commit 43d3aed

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

adafruit_gps.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,11 @@ def _parse_sentence(self):
142142
# Parse any NMEA sentence that is available.
143143
# pylint: disable=len-as-condition
144144
# This needs to be refactored when it can be tested.
145+
146+
# Only continue if we have at least 64 bytes in the input buffer
147+
if self._uart.in_waiting < 64:
148+
return None
149+
145150
sentence = self._uart.readline()
146151
if sentence is None or sentence == b'' or len(sentence) < 1:
147152
return None

0 commit comments

Comments
 (0)