-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add a build option for USB-C version #55
Conversation
Reviewer's Guide by SourceryThis pull request adds a build option for a USB-C version of the firmware. It modifies the build process to generate two versions of the firmware: one for USB-C and one for Micro-B. The changes include updates to the GitHub Actions workflow, Makefile, and LED driver code to support this new build option. Sequence DiagramsequenceDiagram
participant GH as GitHub Actions
participant M as Make
participant A as Artifacts
participant B as Bin Branch
GH->>M: Build USB-C version
M-->>GH: USB-C firmware
GH->>M: Build Micro-B version
M-->>GH: Micro-B firmware
GH->>A: Upload both versions
GH->>B: Commit both versions
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @kienvo - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 2 issues found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
@@ -32,13 +33,15 @@ jobs: | |||
- name: Build firmware | |||
run: | | |||
export PREFIX=${{ env.MRS_TOOLCHAIN }}/RISC-V_Embedded_GCC/bin/riscv-none-embed- | |||
export BUILD_DIR=${{ env.BUILD_DIR }} | |||
make -j$(nproc) | |||
BUILD_DIR=${{ env.USBC_BUILD_DIR }} USBC_VERSION=1 make -j$(nproc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Consider using separate make targets for USB-C and Micro-B builds
This would make the build process more explicit and easier to maintain. It could also simplify adding more variants in the future.
- name: Build USB-C version
run: make usb-c -j$(nproc)
- name: Build Micro-B version
run: make micro-b -j$(nproc)
@@ -88,7 +88,11 @@ static const pinctrl_t led_pins[LED_PINCOUNT] = { | |||
PINCTRL(B, 4), // Q | |||
PINCTRL(B, 2), // R | |||
PINCTRL(B, 1), // S | |||
#ifdef USBC_VERSION |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Consider using a more descriptive macro name for hardware version
A name like HARDWARE_VERSION_USBC might be clearer and more self-documenting.
#ifdef HARDWARE_VERSION_USBC
Resolve #43.
Summary by Sourcery
Add a build option for the USB-C version of the firmware, updating the Makefile and CI workflow to support separate configurations and build directories for USB-C and Micro-B versions.
New Features:
Enhancements:
CI: