Skip to content

Update GPIO driver usage#23

Merged
KenVanHoeylandt merged 2 commits intomainfrom
gpio-updates
Feb 12, 2026
Merged

Update GPIO driver usage#23
KenVanHoeylandt merged 2 commits intomainfrom
gpio-updates

Conversation

@KenVanHoeylandt
Copy link
Contributor

@KenVanHoeylandt KenVanHoeylandt commented Feb 12, 2026

Recently the SDK removed GPIO functionality because pins are now exclusively claimed by a driver. That means the GPIO app can't claim pins that are already in use... except when it calls the ESP-IDF driver code directly, which is what the app now does.

Summary by CodeRabbit

  • Refactor

    • Streamlined GPIO implementation for more efficient and reliable hardware interaction while preserving existing UI behavior.
    • Improved internal pin handling for consistent status reporting.
  • Chores

    • App version bumped to 0.4.0 to reflect the update.

@coderabbitai
Copy link

coderabbitai bot commented Feb 12, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

The GPIO app was modified to use the ESP-IDF GPIO driver directly instead of the HAL GPIO abstraction. CMakeLists.txt was updated to add the driver dependency. Gpio.cpp now includes driver/gpio.h, replaces HAL calls (e.g., tt_hal_gpio_get_level) with gpio_get_level((gpio_num_t)...), and uses a fixed GPIO_PIN_COUNT for sizing and loop bounds.

🚥 Pre-merge checks | ✅ 2 | ❌ 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 (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Update GPIO driver usage' accurately reflects the main change: replacing HAL GPIO API calls with direct ESP-IDF GPIO driver calls due to SDK changes.

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

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch gpio-updates

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

@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

🧹 Nitpick comments (1)
Apps/GPIO/main/Source/Gpio.cpp (1)

14-18: Calling gpio_get_level on unconfigured pins — confirm this is intentional.

gpio_get_level((gpio_num_t)i) is called for every pin index without first configuring the pin direction via gpio_set_direction. Per the ESP-IDF docs, gpio_get_level can be called without prior configuration on most ESP32 variants (the input is always connected), but this is an implementation detail rather than a documented guarantee. Since this app is intentionally bypassing the HAL to read pins that may be claimed by other drivers, this is likely acceptable — just worth noting.

@KenVanHoeylandt KenVanHoeylandt merged commit 9ba1d46 into main Feb 12, 2026
0 of 11 checks passed
@KenVanHoeylandt KenVanHoeylandt deleted the gpio-updates branch February 12, 2026 07:35
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