Skip to content

Commit

Permalink
Point to imxrt-hal for hardware examples
Browse files Browse the repository at this point in the history
imxrt-hal has infrastructure for testing across multiple boards. Since
imxrt-hal already re-exports imxrt-usbd through its public API, we can
test -usbd there. This commit removes the examples from this repository.
  • Loading branch information
mciantyre committed May 18, 2023
1 parent b585e6d commit a2f2ce5
Show file tree
Hide file tree
Showing 16 changed files with 13 additions and 967 deletions.
49 changes: 1 addition & 48 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ on:

jobs:

# Ensure Rust code formatting is consistent across all source code
#
# This checks the main library, and all examples.
# Ensure Rust code formatting is consistent across all source code.
format:
runs-on: ubuntu-latest
steps:
Expand All @@ -21,11 +19,6 @@ jobs:
with:
command: fmt
args: --verbose --all -- --check
- name: Check examples/teensy4 formatting
uses: actions-rs/cargo@v1
with:
command: fmt
args: --manifest-path examples/teensy4/Cargo.toml --verbose --all -- --check

# For each chip, build and lint the main library
clippy:
Expand Down Expand Up @@ -56,46 +49,6 @@ jobs:
command: test
args: --verbose

# Build & lint the teensy4 examples
teensy4-clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: clippy
target: thumbv7em-none-eabihf
override: true
profile: minimal
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --manifest-path examples/teensy4/Cargo.toml --verbose --target thumbv7em-none-eabihf -- -D warnings
name: Lint the teensy4 examples

# Ensure that the Teensy 4 examples build across all hosts
teensy4-xplat:
strategy:
matrix:
host: [ macos-latest, ubuntu-latest, windows-latest ]
runs-on: ${{ matrix.host }}
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: thumbv7em-none-eabihf
override: true
- name: Build examples/teensy4 for ${{ matrix.os }}
uses: actions-rs/cargo@v1
env:
RUSTFLAGS: -C link-arg=-Tt4link.x
with:
command: build
args: --manifest-path examples/teensy4/Cargo.toml --verbose --target thumbv7em-none-eabihf

# Make sure documentation builds, and doclinks are valid
doc:
env:
Expand Down
37 changes: 11 additions & 26 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,35 +34,20 @@ examples. These tests run on your host system.

To **debug** the library, enable the internal `__log` feature. The feature
enables the library's internal [`log`](https://crates.io/crates/log) hooks.
Then, initialize your logger of choice in your program. See the Teensy 4
examples to see how you might use a UART logger to debug your program. You may
also need to configure the maximum log level as a feature on the `log` crate.
Then, initialize your logger of choice in your program. You may also need to
configure the maximum log level as a feature on the `log` crate.

To test on **hardware**, either
To test on **hardware**, refer to the hardware examples maintained in the
[imxrt-hal project](https://github.com/imxrt-rs/imxrt-hal). Those examples
work on multiple development boards. We welcome new USB example contributions
there. If the imxrt-hal project does not support your development board, open
an issue in the imxrt-hal issue tracker.

- use an existing example package, or
- contribute a new example package for your system
If you're testing imxrt-usbd changes with the imxrt-hal examples, you'll need
a way to integrate your patches into that project's build. [Consider using
patches to override dependencies][patch].

To **test `usb-device` compatibility**, use [the `usb-device` test class][test-class]
program in each example.

1. Build and flash the `test_class` example onto your hardware. See your
example's documentation for build and flash instructions. Keep your board
connected to your host.
2. Clone and enter [the `usb-device` repository][usb-device-repo]

```
git clone https://github.com/mvirkkunen/usb-device.git && cd usb-device
```
3. Run `cargo test --features=test-class-high-speed` in the `usb-device` directory.
[test-class]: https://docs.rs/usb-device/0.2.7/usb_device/test_class/index.html
[usb-device-repo]: https://github.com/mvirkkunen/usb-device
By default, examples build a high-speed USB device. To force a low / full speed
device, disable the example's default features. If you're testing a low / full
speed device with the `test_class`, remove the `--features=test-class-high-speed`
in step 3, above, so that the test evaluates a low / full speed test class.
[patch]: https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html

For **design** information, see the API docs. Most modules include a high-level
blurb that talks about what's going on. There are also public-facing design
Expand Down
6 changes: 0 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ USB driver for NXP iMX RT processors
"""
exclude = [
".github/*",
"examples/*",
".gitignore",
]

Expand All @@ -34,11 +33,6 @@ __log = ["log"]
[package.metadata.docs.rs]
default-target = "thumbv7em-none-eabihf"

[workspace]
members = [
"examples/teensy4"
]

[workspace.package]
edition = "2021"

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ embedded Rust program. It should support all i.MX RT microcontrollers.
[`usb-device`]: https://crates.io/crates/usb-device

See the API docs for usage, features, and examples. To try examples on actual
hardware, see the [`examples` directory](./examples).
hardware, see the [imxrt-hal examples](https://github.com/imxrt-rs/imxrt-hal).


License
Expand Down
5 changes: 0 additions & 5 deletions examples/README.md

This file was deleted.

7 changes: 0 additions & 7 deletions examples/teensy4/.cargo/config.toml

This file was deleted.

2 changes: 0 additions & 2 deletions examples/teensy4/.gitignore

This file was deleted.

89 changes: 0 additions & 89 deletions examples/teensy4/Cargo.toml

This file was deleted.

34 changes: 0 additions & 34 deletions examples/teensy4/README.md

This file was deleted.

47 changes: 0 additions & 47 deletions examples/teensy4/src/configured.rs

This file was deleted.

Loading

0 comments on commit a2f2ce5

Please sign in to comment.