Fix LTR390 interval lambda: handle NAN state, remove boot timing guard#63
Fix LTR390 interval lambda: handle NAN state, remove boot timing guard#63
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Version: 26.3.2.1
What does this implement/fix?
Fixes two issues in the LTR390 interval lambda introduced in #56:
(uint32_t)id(ltr390_update_interval).stateis undefined behavior when the template number hasn't initialized yet (state is NAN). Replaced with a ternary that falls back to 60s when the value is not>= 1.0f— NAN comparisons return false so this handles both cases.last_update == 0 && current_time > 0prevented the immediate boot update from firing in the first second (millis() / 1000 == 0). Removedcurrent_time > 0so the update fires on the first tick wheneverlast_update == 0.Types of changes
Checklist / Checklijst:
If user-visible functionality or configuration variables are added/modified: