From 26592429921fcc51bdc6150037582f6e9849490c Mon Sep 17 00:00:00 2001 From: Florian Gilcher Date: Mon, 13 Jul 2020 10:45:44 +0200 Subject: [PATCH] usb-2: make clearer which file is to be edited --- advanced/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/advanced/README.md b/advanced/README.md index eeb01a4..707c89a 100644 --- a/advanced/README.md +++ b/advanced/README.md @@ -270,11 +270,13 @@ The definition of `Descriptor::Configuration` as well as the associated test has Now, proceed as follows: 1. **Parse GET_DESCRIPTOR requests:** -Modify `Request::parse()` in `advanced/common/usb` to recognize a GET_DESCRIPTOR request so that the `get_descriptor_device` test passes. Note that the parser already handles SET_ADDRESS requests. +Modify `Request::parse()` in `advanced/common/usb/src/lib.rs` to recognize a GET_DESCRIPTOR request so that the `get_descriptor_device` test passes. Note that the parser already handles SET_ADDRESS requests. - check table 9-4 in the USB specification for Request Codes - remember that you can define binary literals by prefixing them with `0b` - you can use bit shifts (`>>`) and casts (`as u8`) to get the high/low bytes of a `u16` +See `advanced/common/usb/src/get-descriptor-device.rs` for a solution. + 2. **Read incoming request information and pass it to the parser:** modify `usb-2.rs` to read `USBD` registers and parse the SETUP data when an EPSETUP event is received. - for a mapping of register names to the `USBD` API, check the entry for `nrf52840_hal::target::usbd` in the documentation you've created using `cargo doc`