We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 50330e4 + 43d3aed commit 70db3f9Copy full SHA for 70db3f9
adafruit_gps.py
@@ -145,6 +145,11 @@ def _parse_sentence(self):
145
# Parse any NMEA sentence that is available.
146
# pylint: disable=len-as-condition
147
# This needs to be refactored when it can be tested.
148
+
149
+ # Only continue if we have at least 64 bytes in the input buffer
150
+ if self._uart.in_waiting < 64:
151
+ return None
152
153
sentence = self._uart.readline()
154
if sentence is None or sentence == b'' or len(sentence) < 1:
155
return None
0 commit comments