Skip to content

Commit

Permalink
Use 0 for class and sub_class in readme example to make it work on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
sourcebox committed May 25, 2024
1 parent 1b96b98 commit 726f677
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ usb-device traits.
## Example

### Receive MIDI

Turn on the integrated LED of a STM32 BluePill board as long as C2 is pressed

```rust
fn main() -> ! {
let dp = pac::Peripherals::take().unwrap();
Expand All @@ -39,8 +41,8 @@ fn main() -> ! {

let mut usb_dev = UsbDeviceBuilder::new(&usb_bus, UsbVidPid(0x16c0, 0x5e4))
.product("MIDI Test")
.device_class(USB_AUDIO_CLASS)
.device_sub_class(USB_MIDISTREAMING_SUBCLASS)
.device_class(0)
.device_sub_class(0)
.build();

loop {
Expand Down Expand Up @@ -77,6 +79,7 @@ than one input or output port requires the `control-buffer-256` feature of
the usb-device crate:

Cargo.toml:

```
usb-device = { version = ">=0.2.1", features = ["control-buffer-256"] }
```
Expand Down

0 comments on commit 726f677

Please sign in to comment.