Skip to content

Commit 37d6518

Browse files
Revert "Rebase #144, formerly #133 to pull in USB for nrf52480"
This reverts commit 8a5ee04.
1 parent d3c8ba6 commit 37d6518

File tree

6 files changed

+9
-15
lines changed

6 files changed

+9
-15
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ lto = true
2222
opt-level = "s"
2323

2424
[patch.crates-io.usb-device]
25-
git = "https://github.com/unrelentingtech/usb-device.git"
25+
git = "https://github.com/jonas-schievink/usb-device.git"
2626
branch = "inhibit-setaddr-resp"

examples/usb/Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@ cortex-m-rt = "0.6.12"
1010
cortex-m-semihosting = "0.3.5"
1111
panic-semihosting = "0.5.3"
1212
nrf52840-pac = "0.9.0"
13-
usb-device = "0.2.7"
13+
usb-device = "0.2.5"
1414
usbd-serial = "0.1.0"
1515

1616
[dependencies.nrf52840-hal]
17-
version = "0.12.0"
17+
version = "0.10.0"
1818
path = "../../nrf52840-hal"
19-

examples/usb/src/main.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ fn main() -> ! {
5151
let p1 = p1::Parts::new(periph.P1);
5252

5353
let mut led = p0.p0_23.into_push_pull_output(Level::High);
54-
5554
let btn = p1.p1_00.into_pullup_input();
5655
while btn.is_high().unwrap() {}
5756

@@ -80,11 +79,6 @@ fn main() -> ! {
8079
if new_state != state {
8180
hprintln!("{:?} {:#x}", new_state, usb_dev.bus().device_address()).ok();
8281
state = new_state;
83-
84-
if state == UsbDeviceState::Configured {
85-
serial.write(b"Hello, world!\n").unwrap();
86-
serial.flush().unwrap();
87-
}
8882
}
8983
}
9084
}

nrf-hal-common/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ optional = true
3939
version = "0.9.0"
4040

4141
[dependencies.usb-device]
42-
version = "0.2.7"
42+
version = "0.2.5"
4343
optional = true
4444

4545
[dependencies.nrf52810-pac]

nrf-hal-common/src/usbd/mod.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ mod errata;
1010

1111
use crate::{
1212
clocks::{Clocks, ExternalOscillator},
13-
pac::USBD,
13+
target::USBD,
1414
};
1515
use core::sync::atomic::{compiler_fence, Ordering};
1616
use core::{cell::Cell, mem, ptr, slice};
@@ -470,7 +470,7 @@ impl UsbBus for Usbd<'_> {
470470
// stage and must be followed by us responding with an ACK token to an OUT token
471471
// sent from the host (AKA the status stage) -- `usb-device` provides no call back
472472
// for that so we'll trigger the status stage using a shortcut
473-
let is_short_packet = buf.len() < self.max_packet_size_0 as usize;
473+
let is_short_packet = buf.len() < self.max_packet_size_0.into();
474474
regs.shorts.modify(|_, w| {
475475
if is_short_packet {
476476
w.ep0datadone_ep0status().set_bit()
@@ -572,7 +572,7 @@ impl UsbBus for Usbd<'_> {
572572

573573
unsafe {
574574
if ep_addr.index() == 0 {
575-
regs.tasks_ep0stall.write(|w| w.tasks_ep0stall().bit(stalled));
575+
regs.tasks_ep0stall.write(|w| w.tasks_ep0stall().set_bit());
576576
} else {
577577
regs.epstall.write(|w| {
578578
w.ep()
@@ -607,6 +607,7 @@ impl UsbBus for Usbd<'_> {
607607
errata::pre_wakeup();
608608

609609
regs.lowpower.write(|w| w.lowpower().force_normal());
610+
610611
});
611612
}
612613

nrf52840-hal/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ nrf52840-pac = "0.9.0"
2222
[dependencies.nrf-hal-common]
2323
path = "../nrf-hal-common"
2424
default-features = false
25-
features = ["52840", "usb-device"]
25+
features = ["52840"]
2626
version = "=0.12.0"
2727

2828
[dependencies.embedded-hal]

0 commit comments

Comments
 (0)