Skip to content

ADS1115 v2: skip ADC loop during strip updates, bump deps and improve docs#5655

Merged
DedeHai merged 2 commits into
wled:mainfrom
dima-zhemkov:main
Jun 1, 2026
Merged

ADS1115 v2: skip ADC loop during strip updates, bump deps and improve docs#5655
DedeHai merged 2 commits into
wled:mainfrom
dima-zhemkov:main

Conversation

@dima-zhemkov
Copy link
Copy Markdown
Contributor

@dima-zhemkov dima-zhemkov commented May 29, 2026

This PR refactors the ADS1115 usermod loop to avoid running ADC processing while LED output is actively updating.

What changed

  • Added an early-return guard with strip.isUpdating in the ADS1115 loop.
  • Kept loop logic explicit and sequential: conversion check, result update, channel switch, next read start.
  • Updated Adafruit dependency versions in the usermod library metadata.
  • Reworked ADS1115 README for clearer features, compatibility, and installation notes.

Why

  • Prevent interference with time-sensitive LED bus updates.
  • Align ADS1115 scheduling behavior with existing WLED core/usermod patterns.
  • Improve maintainability and contributor/user clarity.

Validation:

  • Builds successfully for all default environments.
  • Runtime-tested on esp32dev and esp32s3dev_8MB_opi.

Summary by CodeRabbit

ADS1115 v2 Usermod Update

  • Bug Fixes

    • Fixed configuration output to prevent duplicate Loop Interval field
  • Documentation

    • Rewrote ADS1115 v2 documentation with comprehensive feature list, installation instructions, and compatibility requirements
  • Chores

    • Updated Adafruit BusIO library to v1.17.4
    • Updated Adafruit ADS1X15 library to v2.6.2

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 29, 2026

Walkthrough

This PR updates the ADS1115_v2 usermod with refactored loop control logic using early-return guards, upgraded Adafruit library dependencies, and comprehensive documentation rewrite describing v2 features and configuration options.

Changes

ADS1115_v2 Usermod Updates

Layer / File(s) Summary
Loop control flow and configuration
usermods/ADS1115_v2/ADS1115_v2.cpp
loop() adds an early-return guard combining disabled state, strip updating, and interval checks. addToConfig() ensures "Loop Interval" field is written once to the JSON config object.
Dependency version updates
usermods/ADS1115_v2/library.json
Adafruit BusIO updated from #1.13.2 to #1.17.4; Adafruit ADS1X15 updated from #2.4.0 to #2.6.2.
Documentation rewrite
usermods/ADS1115_v2/readme.md
v2 documentation now covers I2C ADC reading, 8 input modes, per-channel settings (enable/name/units/multiplier/offset/precision), and configurable measurement loop interval. Installation updated to reference custom_usermods configuration.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately captures the three main changes: adding skip logic for strip updates, bumping dependencies, and improving documentation.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@usermods/ADS1115_v2/readme.md`:
- Line 25: Update the installation instruction that currently tells users to add
"ADS1115" to custom_usermods in platformio.ini: change that string to the
correct module key "ADS1115_v2" (or explicitly note if the key is intentionally
different) so the README's add-to-custom_usermods instruction matches the
directory/module name; verify the README text near the
custom_usermods/platformio.ini mention and replace "ADS1115" with "ADS1115_v2".
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 68f92cbd-ac0c-422d-8a28-7f295ef4ed75

📥 Commits

Reviewing files that changed from the base of the PR and between f98e19c and 98964a1.

📒 Files selected for processing (3)
  • usermods/ADS1115_v2/ADS1115_v2.cpp
  • usermods/ADS1115_v2/library.json
  • usermods/ADS1115_v2/readme.md

Comment thread usermods/ADS1115_v2/readme.md
@DedeHai
Copy link
Copy Markdown
Collaborator

DedeHai commented Jun 1, 2026

thanks for the upate.
in general, loops can run in parallel to LED outputs no problem unless the driver hogs ISR's for a long time. Since polling the ADC is low priority, here the approach to skip while update is in progress is a safe bet.

@DedeHai DedeHai merged commit 659f698 into wled:main Jun 1, 2026
259 checks passed
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.

2 participants