fix(t1000-e): fix extended uptime failures in GPS and sensor code#2074
Open
NickDunklee wants to merge 1 commit intomeshcore-dev:devfrom
Open
fix(t1000-e): fix extended uptime failures in GPS and sensor code#2074NickDunklee wants to merge 1 commit intomeshcore-dev:devfrom
NickDunklee wants to merge 1 commit intomeshcore-dev:devfrom
Conversation
NickDunklee
commented
Mar 17, 2026
- Fix millis() wraparound (49-day) in T1000SensorManager::loop() and MicroNMEALocationProvider::loop() by switching from absolute comparison (millis() > next_) to elapsed-time arithmetic ((uint32_t)(millis() - last_) >= interval) with uint32_t timestamps; previous pattern could stall GPS updates and time sync for up to ~24 days after wraparound
- Fix div-by-zero crash in get_heater_temperature() when ntc_volt == 0 (open circuit or bad ADC read); now returns 0.0f safely
- Fix out-of-bounds array access in get_heater_temperature(): loop exit at i == 0 caused ntc_res2[i-1] / ntc_temp2[i-1] at index -1; loop exhaustion at i == 136 caused ntc_res2[136] one-past-end read; clamped i to [1, 135] with early-exit returns for edge temperatures and guarded interpolation denominator against zero
- Fix millis() wraparound (49-day) in T1000SensorManager::loop() and MicroNMEALocationProvider::loop() by switching from absolute comparison (millis() > next_*) to elapsed-time arithmetic ((uint32_t)(millis() - last_*) >= interval) with uint32_t timestamps; previous pattern could stall GPS updates and time sync for up to ~24 days after wraparound - Fix division-by-zero crash in get_heater_temperature() when ntc_volt == 0 (open circuit or bad ADC read); now returns 0.0f safely - Fix out-of-bounds array access in get_heater_temperature(): loop exit at i == 0 caused ntc_res2[i-1] / ntc_temp2[i-1] at index -1; loop exhaustion at i == 136 caused ntc_res2[136] one-past-end read; clamped i to [1, 135] with early-exit returns for edge temperatures and guarded interpolation denominator against zero
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.