Skip to content

Commit

Permalink
More fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanpallant authored and listochkin committed Nov 1, 2023
1 parent 3d0d5b8 commit a5f4703
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions exercise-book/src/nrf52-usb-data-stage.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Extend `usb-3.rs` so that it uses `Ep0In` to respond to the `GET_DESCRIPTOR Devi

### Values of the device descriptor

The raw values you need to pack into the descriptor are as follows. Note, we won't be doing this by hand, so read on before you start typing!

- `bLength = 18`, the size of the descriptor (must always be this value)
- `bDescriptorType = 1`, device descriptor type (must always be this value)
- `bDeviceClass = bDeviceSubClass = bDeviceProtocol = 0`, these are unimportant for enumeration
Expand Down
2 changes: 1 addition & 1 deletion exercise-book/src/nrf52-usb-setup-stage.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Modify `Request::parse()` in `nrf52-code/usb-lib/src/lib.rs` to recognize a `GET

When you need to write some `no_std` code that does not involve device-specific I/O you should consider writing it as a separate crate. This way, you can test it on your development machine (e.g. `x86_64`) using the standard `cargo test` functionality.

So that's what we'll do here. In `nrf52-code/usb-lib/src/lib.rs` you'll find starter code for writing a `no_std` SETUP data parser. The starter code contains some unit tests; you can run them with `cargo test` (from within the `usb` folder) or you can use Rust Analyzer's "Test" button in VS code.
So that's what we'll do here. In `nrf52-code/usb-lib/src/lib.rs` you'll find starter code for writing a `no_std` SETUP data parser. The starter code contains some unit tests; you can run them with `cargo test` (from within the `usb-lib` folder) or you can use Rust Analyzer's "Test" button in VS code.

The definition of `Descriptor::Configuration` as well as the associated test has been "commented out" using an `#[cfg(TODO)]` attribute because it is not handled by the firmware yet. Delete the `#[cfg(TODO)]` so that the unit tests can access it. This pattern is used for enum members and test functions throughout this workshop, so keep it in mind should you see it again.

Expand Down

0 comments on commit a5f4703

Please sign in to comment.