Skip to content

[Bugfix] Arduino detection for headers.#1124

Open
h2zero wants to merge 1 commit intomasterfrom
bugfix/arduino-detect
Open

[Bugfix] Arduino detection for headers.#1124
h2zero wants to merge 1 commit intomasterfrom
bugfix/arduino-detect

Conversation

@h2zero
Copy link
Copy Markdown
Owner

@h2zero h2zero commented Mar 25, 2026

Summary by CodeRabbit

  • Refactor

    • Improved automatic detection of Arduino environment compatibility for enhanced String support handling
    • Reorganized preprocessor header detection logic for better build configuration
  • Chores

    • Minor code formatting adjustments

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 25, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 53dfcd23-db57-4eb6-a907-c4b8cd2cda4b

📥 Commits

Reviewing files that changed from the base of the PR and between 4746c60 and a2f4a6e.

📒 Files selected for processing (3)
  • src/NimBLEAttValue.h
  • src/NimBLEStream.h
  • src/nimconfig.h
💤 Files with no reviewable changes (1)
  • src/nimconfig.h

📝 Walkthrough

Walkthrough

These changes refactor how Arduino header availability is detected by decentralizing the logic from the central configuration file (nimconfig.h) into individual component headers (NimBLEAttValue.h and NimBLEStream.h) that use it. Each header now independently detects Arduino availability via __has_include(<Arduino.h>) when needed, eliminating the upfront global check.

Changes

Cohort / File(s) Summary
Arduino availability detection refactor
src/NimBLEAttValue.h, src/NimBLEStream.h, src/nimconfig.h
Moved Arduino header detection from central nimconfig.h to individual headers using __has_include(<Arduino.h>). Changed conditional compilation from #ifdef to #if directive. Removed global NIMBLE_CPP_ARDUINO_STRING_AVAILABLE macro definition and integrated detection at point of use.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

Headers now detect their own Arduino home,
No central config makes them roam,
With __has_include they gently probe,
Each file an independent globe,
Modular and wise, the changes hum ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title '[Bugfix] Arduino detection for headers.' directly aligns with the main change: refactoring how Arduino header availability is detected across multiple files, moving detection logic from nimconfig.h to individual headers.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bugfix/arduino-detect

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

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