Skip to content

Commit 6f26693

Browse files
committed
Updated stm32-usbd to v0.6
1 parent 266e62f commit 6f26693

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ version = "0.2.3"
4848
features = ["unproven"]
4949

5050
[dependencies.stm32-usbd]
51-
version = "0.5.0"
52-
features = ["ram_access_2x16"]
51+
version = "0.6.0"
5352
optional = true
5453

5554
[package.metadata.docs.rs]

examples/usb_serial.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,7 @@ fn main() -> ! {
4444
let _clocks = rcc
4545
.cfgr
4646
.hsi48(true)
47-
.sysclk(48.mhz())
48-
.pclk1(24.mhz())
49-
.pclk2(24.mhz())
47+
.sysclk(80.mhz())
5048
.freeze(&mut flash.acr, &mut pwr);
5149

5250
enable_crs();
@@ -59,7 +57,7 @@ fn main() -> ! {
5957
let mut led = gpiob
6058
.pb3
6159
.into_push_pull_output(&mut gpiob.moder, &mut gpiob.otyper);
62-
led.set_low(); // Turn off
60+
led.set_low().ok(); // Turn off
6361

6462
let mut gpioa = dp.GPIOA.split(&mut rcc.ahb2);
6563

@@ -88,7 +86,7 @@ fn main() -> ! {
8886

8987
match serial.read(&mut buf) {
9088
Ok(count) if count > 0 => {
91-
led.set_high(); // Turn on
89+
led.set_high().ok(); // Turn on
9290

9391
// Echo back in upper case
9492
for c in buf[0..count].iter_mut() {
@@ -110,6 +108,6 @@ fn main() -> ! {
110108
_ => {}
111109
}
112110

113-
led.set_low(); // Turn off
111+
led.set_low().ok(); // Turn off
114112
}
115113
}

src/usb.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ unsafe impl UsbPeripheral for Peripheral {
2525
const DP_PULL_UP_FEATURE: bool = true;
2626
const EP_MEMORY: *const () = 0x4000_6c00 as _;
2727
const EP_MEMORY_SIZE: usize = 1024;
28+
const EP_MEMORY_ACCESS_2X16: bool = true;
2829

2930
fn enable() {
3031
let rcc = unsafe { (&*RCC::ptr()) };

0 commit comments

Comments
 (0)