Skip to content

Commit 1adf2c9

Browse files
authored
Merge pull request #221 from korken89/stm32-usbd_v0.6
Updated stm32-usbd to v0.6
2 parents ff2fcd8 + 6f26693 commit 1adf2c9

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
@@ -46,8 +46,7 @@ version = "0.2.3"
4646
features = ["unproven"]
4747

4848
[dependencies.stm32-usbd]
49-
version = "0.5.0"
50-
features = ["ram_access_2x16"]
49+
version = "0.6.0"
5150
optional = true
5251

5352
[dependencies.synopsys-usb-otg]

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)