Skip to content

fix(t1000-e): fix extended uptime failures in GPS and sensor code#2074

Open
NickDunklee wants to merge 1 commit intomeshcore-dev:devfrom
NickDunklee:t1000e-fixes
Open

fix(t1000-e): fix extended uptime failures in GPS and sensor code#2074
NickDunklee wants to merge 1 commit intomeshcore-dev:devfrom
NickDunklee:t1000e-fixes

Conversation

@NickDunklee
Copy link

  • 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
@NickDunklee NickDunklee changed the base branch from main to dev March 17, 2026 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant