Skip to content

Commit b44f53a

Browse files
authored
Merge pull request #3 from cefn/master
Workaround for issue experienced with mktime on Micropython
2 parents c5436a3 + 559222c commit b44f53a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

adafruit_gps.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,10 @@ def _parse_gpgga(self, args):
162162
if data is None or len(data) != 14:
163163
return # Unexpected number of params.
164164
# Parse fix time.
165-
time_utc = _parse_float(data[0])
165+
time_utc = int(_parse_float(data[0]))
166166
if time_utc is not None:
167167
hours = time_utc // 10000
168-
mins = int((time_utc // 100) % 100)
168+
mins = (time_utc // 100) % 100
169169
secs = time_utc % 100
170170
# Set or update time to a friendly python time struct.
171171
if self.timestamp_utc is not None:
@@ -198,10 +198,10 @@ def _parse_gprmc(self, args):
198198
if data is None or len(data) < 11:
199199
return # Unexpected number of params.
200200
# Parse fix time.
201-
time_utc = _parse_float(data[0])
201+
time_utc = int(_parse_float(data[0]))
202202
if time_utc is not None:
203203
hours = time_utc // 10000
204-
mins = int((time_utc // 100) % 100)
204+
mins = (time_utc // 100) % 100
205205
secs = time_utc % 100
206206
# Set or update time to a friendly python time struct.
207207
if self.timestamp_utc is not None:

0 commit comments

Comments
 (0)