Fix _parseCSV() array index bug: lon and ele always returned lat value#180
Fix _parseCSV() array index bug: lon and ele always returned lat value#180mikeysklar wants to merge 2 commits into
Conversation
In _parseCSV(), all three location fields (lat, lon, ele) were reading from fields[1], meaning lon and ele always returned the latitude value instead of their own data. Also removes an unreachable return statement at the end of the function.
|
Been testing this and while the code fixes one issue it also crashes from another. So I'll be doing further testing. |
|
@mikeysklar To confirm, does the crash occur when the user tries to run the |
|
Looks like
I'll try to repro. |
|
fyi, esp8266 need lots of wdt kicks with yield()! |
|
I've seen the crash on two different boards Feather V2 and Qt Py ESP32-S3 using.
I think it is a missing (but necessary) trailing comma with parse_csv that will resolve it. Testing and will update PR. |
|
@mikeysklar If fixing it keeps causing another bug, please lmk and I can investigate. |
End-to-end verified on Feather ESP32 V2 and QT Py ESP32-S3 (with companion PR #181)Ran the stock Feather ESP32 V2: Note: on The two fixes
They mask each other: this PR's index bug kept readers away from |
|
I can do further testing. I would appreciate if others would confirm these two pull work or if there are any other downstream concerns with these changes. |
|
In my queue to test this morning |
|
Sounds good. Testing went well for myself and forum user gadgeteer yesterday. |
|
@mikeysklar Can you please check out a PR for the combined PR branch instead of having two separate PRs open? Plz checkout a PR for branch Then tag me for review. |
|
Works on ESP8266 |
|
Cool. Glad to hear it works. See PR #182 for combined PRs. |
|
Closing in favor of #182 |
Bug found and reported by gadgeteer on the forums.
In
_parseCSV(), all three location fields hardcodefields[1], solonandelealways return the latitude value.Before (buggy):
After (fixed):
Also removes the unreachable
return true;at the end of the function.