Skip to content

refactor(ch32v): apply board ISA/ABI as a pure config -> config function - #1609

Merged
zackees merged 1 commit into
mainfrom
refactor/pure-ch32v-isa
Oct 2, 2026
Merged

zackees merged 1 commit into
mainfrom
refactor/pure-ch32v-isa

Conversation

@zackees

@zackees zackees commented Oct 2, 2026

Copy link
Copy Markdown
Member

Replaces the in-place apply_board_isa(&mut config, march, mabi) and apply_board_isa_for_toolchain(&mut config, ...) with side-effect-free with_board_isa(config, ...) -> config and with_board_isa_for_toolchain(config, ...) -> config. These are composed from two named rules: march_for_toolchain (normalize for xPack, keep WCH's vendor extensions otherwise) and with_flag_value (set every -march=/-mabi= compiler-common and linker flag). The orchestrator applies the result in one line:

let mcu_config = with_board_isa_for_toolchain(get_ch32v_config_for_mcu(&series)?, march, mabi, &prefix);

Behaviour is unchanged. The existing tests are ported to the new signatures.

Same theme as the #1605 review: fixups should be pure state -> state functions applied once.

Local checks: fmt, clippy -p fbuild-build-mcu --all-targets -D warnings, and test -p fbuild-build-mcu (77 passed).

`apply_board_isa(_for_toolchain)(&mut config, ...)` rewrote flags in place.
Replace them with `with_board_isa(_for_toolchain)(config, ...) -> config`,
built from the named rules `march_for_toolchain` and `with_flag_value`, and
apply the result in one line where the MCU config is loaded.

Behaviour is unchanged.

Co-Authored-By: Claude <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 2, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 26 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository: FastLED/fbuild/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: c535e78d-cdf4-4873-aff4-085199e353bb

📥 Commits

Reviewing files that changed from the base of the PR and between 795ca58 and ee8da2c.

📒 Files selected for processing (4)
  • crates/fbuild-build-mcu/src/ch32v/ch32v_compiler.rs
  • crates/fbuild-build-mcu/src/ch32v/mcu_config.rs
  • crates/fbuild-build-mcu/src/ch32v/orchestrator.rs
  • crates/fbuild-build-mcu/src/ch32v/orchestrator_tests.rs
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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.

@zackees
zackees merged commit 84adb11 into main Oct 2, 2026
13 checks passed
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Oct 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

1 participant