Skip to content

DEEPSPACEH7AIO: remove unused definitions - #1189

Open
osirisinferi wants to merge 1 commit into
betaflight:masterfrom
osirisinferi:fix-deepspace-aio-h7
Open

DEEPSPACEH7AIO: remove unused definitions#1189
osirisinferi wants to merge 1 commit into
betaflight:masterfrom
osirisinferi:fix-deepspace-aio-h7

Conversation

@osirisinferi

@osirisinferi osirisinferi commented Aug 19, 2026

Copy link
Copy Markdown
Member

In the schematic, some functions were present in multiple occasions, but are not actually routed to pads or used in general. Let's remove them from the target file.

@coderabbitai In the original PR where this target was added, you might have wanted to flag the definitions of SPI4 pins, where no SPI4 bus was actually used elsewhere in the config.h.

Summary by CodeRabbit

  • Refactor
    • Removed unused hardware configuration entries for the DEEPSPACEH7AIO target.
    • Simplified target configuration by eliminating unsupported SPI4 and PINIO2 settings.

In the schematic, some functions were present in multiple occasions, but
are not actually routed to pads or used in general. Let's remove them from
the target file.
@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 0d503596-cd42-4613-8d46-3455647b6391

📥 Commits

Reviewing files that changed from the base of the PR and between 5af0c8b and eb50a4f.

📒 Files selected for processing (1)
  • configs/DPDS/DEEPSPACEH7AIO/config.h
💤 Files with no reviewable changes (1)
  • configs/DPDS/DEEPSPACEH7AIO/config.h

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


Walkthrough

The DEEPSPACEH7AIO target configuration removes unused SPI4 pin definitions and PINIO2 settings. SPI3 and PINIO1 configuration remains unchanged.

Changes

DEEPSPACEH7AIO configuration cleanup

Layer / File(s) Summary
Remove unused target definitions
configs/DPDS/DEEPSPACEH7AIO/config.h
Removes the SPI4 pin assignments, PINIO2_PIN, and PINIO2_BOX definitions.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to eb50a

This is a localized cleanup that removes unused definitions from the target configuration without supplied evidence of an actionable merge-blocking risk; it is merge-ready after normal checks and review.

Suggested reviewers: haslinghuis

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the code change but omits the required template sections and checklist. Add the required review, hardware compliance, housekeeping, and checklist sections, and complete each applicable item.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the target and the removal of unused definitions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@osirisinferi

Copy link
Copy Markdown
Member Author

@coderabbitai I asked you a question in my OP.

@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

gh pr view 1189 --repo betaflight/config --json title,body,comments,reviews,url \
  --jq '{title, url, body, comments: [.comments[] | {author: .author.login, body, url}], reviews: [.reviews[] | {author: .author.login, body, state}]}'

Length of output: 8695


🏁 Script executed:

#!/bin/bash
set -euo pipefail

target_file="configs/DPDS/DEEPSPACEH7AIO/config.h"

echo "== File history =="
git log --follow --format='%H%x09%s' -- "$target_file" | head -20

echo
echo "== Earliest version of the target configuration =="
introducing_commit="$(git log --follow --format='%H' --reverse -- "$target_file" | head -1)"
printf 'commit: %s\n' "$introducing_commit"
git show "${introducing_commit}:${target_file}" | nl -ba | sed -n '1,240p'

echo
echo "== GitHub pull requests associated with the introducing commit =="
gh api "repos/betaflight/config/commits/${introducing_commit}/pulls" \
  -H 'Accept: application/vnd.github+json' \
  --jq '.[] | {number, title, url, state, merged_at}'

Length of output: 1215


🏁 Script executed:

#!/bin/bash
set -euo pipefail

introducing_commit="302dcdee8c7cf69a29c3b01164e9369762be1443"
target_file="configs/DPDS/DEEPSPACEH7AIO/config.h"

echo "== Relevant definitions in the initial target file =="
git show "${introducing_commit}:${target_file}" | nl -ba | \
  grep -E -C 3 'SPI[0-9]|PINIO[0-9]'

echo
echo "== Initial target-addition pull request =="
gh pr view 1121 --repo betaflight/config --json title,body,url,comments,reviews \
  --jq '{title, url, body, comments: [.comments[] | {author: .author.login, body}], reviews: [.reviews[] | {author: .author.login, state, body}]}'

Length of output: 986


🏁 Script executed:

#!/bin/bash
set -euo pipefail

introducing_commit="302dcdee8c7cf69a29c3b01164e9369762be1443"
target_file="configs/DPDS/DEEPSPACEH7AIO/config.h"

echo "== Relevant definitions in the initial target file =="
git show "${introducing_commit}:${target_file}" | \
  grep -n -E -C 3 'SPI[0-9]|PINIO[0-9]'

echo
echo "== Initial target-addition pull request =="
gh pr view 1121 --repo betaflight/config --json title,body,url,comments,reviews \
  --jq '{title, url, body, comments: [.comments[] | {author: .author.login, body}], reviews: [.reviews[] | {author: .author.login, state, body}]}'

Length of output: 13537


@osirisinferi You are correct. I missed the question in the original post.

Yes, the review of PR #1121 should have flagged the unused SPI4_SCK_PIN, SPI4_SDI_PIN, and SPI4_SDO_PIN definitions. The initial config.h configured SPI1, SPI2, and SPI3 instances, but it did not configure an SPI4 instance. The SPI4 pin definitions were therefore unused.

This PR removes those definitions correctly. Sorry for the missed finding in the original target-addition review.

🐇

You are interacting with an AI system.

@osirisinferi

osirisinferi commented Aug 19, 2026

Copy link
Copy Markdown
Member Author

Sorry for the missed finding in the original target-addition review.

@coderabbitai Sorry is not good enough for an LLM. Do you not have a learning that should have tagged this inconsistency? If not, please add one so you don't forget this in the future.

@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

@osirisinferi The existing learning did not cover this consistency check.

I added a specific learning for board configuration reviews. It requires checking that each SPI<n>_*_PIN definition has a corresponding configured SPI<n> instance. It also requires flagging orphaned peripheral pin definitions when the diff provides clear evidence that no instance uses them.

(ᵕ•_•)🐇


✏️ Learnings added
Learnt from: osirisinferi
URL: https://github.com/betaflight/config/pull/1189

Timestamp: 2026-08-19T20:02:54.641Z
Learning: In betaflight/config board configuration PR reviews, check each peripheral pin-definition group against the configured peripheral instances in the same target `config.h`. For example, if `SPI4_SCK_PIN`, `SPI4_SDI_PIN`, or `SPI4_SDO_PIN` is defined, verify that the target config configures and uses an `SPI4` instance. Flag the definitions as unused when no corresponding instance exists and the diff provides clear evidence that the pins are not otherwise used. Apply the same check to analogous UART, I2C, ADC, and PINIO peripheral definitions where applicable. Do not request generic hardware confirmation; only report concrete configuration inconsistencies.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


🧠 Learnings used
Learnt from: osirisinferi
Repo: betaflight/config PR: 1112
File: configs/G-FF4/config.h:34-34
Timestamp: 2026-05-29T09:35:05.506Z
Learning: In betaflight/config board configuration PR reviews, do not add generic "please confirm your hardware matches the config" or "verify the sensor/bus is correct" follow-up comments. Such verification applies to every board config submission and is noise. Only flag hardware-related concerns when there is a specific, concrete discrepancy visible in the diff itself (e.g., a mismatched pin, wrong SPI/I2C instance, conflicting feature flags). Avoid contradictory comments that state "no action required" and then request an action anyway.

You are interacting with an AI system.

@osirisinferi

Copy link
Copy Markdown
Member Author

@CodeRabbit Good LLM, thank you. 🐇

@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

@osirisinferi Thank you.

🐇


🧠 Learnings used
Learnt from: osirisinferi
Repo: betaflight/config PR: 0
File: :0-0
Timestamp: 2026-08-19T20:02:54.641Z
Learning: In betaflight/config board configuration PR reviews, check each peripheral pin-definition group against the configured peripheral instances in the same target `config.h`. For example, if `SPI4_SCK_PIN`, `SPI4_SDI_PIN`, or `SPI4_SDO_PIN` is defined, verify that the target config configures and uses an `SPI4` instance. Flag the definitions as unused when no corresponding instance exists and the diff provides clear evidence that the pins are not otherwise used. Apply the same check to analogous UART, I2C, ADC, and PINIO peripheral definitions where applicable. Do not request generic hardware confirmation; only report concrete configuration inconsistencies.

You are interacting with an AI system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants