Skip to content

♻️ refactor(uvc): clean up code and improve cargo aliases#58

Merged
ZR233 merged 1 commit intomainfrom
fmt
Jan 27, 2026
Merged

♻️ refactor(uvc): clean up code and improve cargo aliases#58
ZR233 merged 1 commit intomainfrom
fmt

Conversation

@ZR233
Copy link
Member

@ZR233 ZR233 commented Jan 27, 2026

  • add uvc-parse cargo alias for easier frame parsing workflow
  • update test README to use new cargo aliases
  • remove commented out code and unused field in UvcDevice
  • fix build.rs condition to only enable umod when libusb feature is active
  • improve code maintainability by removing dead code

- add uvc-parse cargo alias for easier frame parsing workflow
- update test README to use new cargo aliases
- remove commented out code and unused field in UvcDevice
- fix build.rs condition to only enable umod when libusb feature is active
- improve code maintainability by removing dead code
Copilot AI review requested due to automatic review settings January 27, 2026 09:28
@ZR233 ZR233 merged commit 7a42976 into main Jan 27, 2026
2 checks passed
@ZR233 ZR233 deleted the fmt branch January 27, 2026 09:28
@ZR233 ZR233 mentioned this pull request Jan 27, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors UVC-related code and improves developer workflow by introducing a new Cargo alias for parsing captured UVC frames, updating documentation accordingly, and tightening build configuration so umod is only enabled when the libusb feature is active.

Changes:

  • Gate umod cfg emission in usb-host/build.rs behind the libusb Cargo feature.
  • Remove dead/commented-out UVC code and an unused UvcDevice field.
  • Add uvc-parse Cargo alias and update the UVC test README to use the aliases.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
usb-host/build.rs Only enables umod cfg when the libusb feature is enabled.
usb-device/uvc/src/lib.rs Removes unused video_control_interface_num and dead commented code.
test_crates/test_xhci_uvc/README.md Switches instructions to use the Cargo aliases.
.cargo/config.toml Adds uvc-parse alias (and keeps test-uvc-uboot alias).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

test-uboot = "test -p test_hub --test test --target aarch64-unknown-none-softfloat -- uboot"
test-dwc = "test -p test_dwc --test test_dwc --target aarch64-unknown-none-softfloat -- uboot"
test-uvc-uboot = "test -p test_xhci_uvc --test test --target aarch64-unknown-none-softfloat -- uboot | tee target/uvc.log" No newline at end of file
test-uvc-uboot = "test -p test_xhci_uvc --test test --target aarch64-unknown-none-softfloat -- uboot | tee target/uvc.log"
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test-uvc-uboot uses a shell pipe (| tee ...). Cargo aliases don’t invoke a shell unless the command is prefixed with !, so this will be tokenized as arguments to cargo test and the log won’t be captured. Consider changing the alias to a shell alias (e.g., !sh -c ...) or removing the pipe and documenting a separate tee step.

Suggested change
test-uvc-uboot = "test -p test_xhci_uvc --test test --target aarch64-unknown-none-softfloat -- uboot | tee target/uvc.log"
test-uvc-uboot = "!sh -c 'cargo test -p test_xhci_uvc --test test --target aarch64-unknown-none-softfloat -- uboot | tee target/uvc.log'"

Copilot uses AI. Check for mistakes.
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.

2 participants