Skip to content

Commit

Permalink
Merge pull request #510 from eivindbergem/master
Browse files Browse the repository at this point in the history
Use latest version of `usb-device` and `usbd-serial`
  • Loading branch information
burrbull authored Oct 11, 2024
2 parents ec32a32 + 3d50d84 commit 6a8d6f4
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 16 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Check "device selected" in `build.rs` [#502]
- Use gpio field enums internally [#506]
- Unmacro `dma.rs` [#505]
- Updated `usb-device` and `usbd-serial` to latest versions [#510]
- Rework pin remaps, fix CAN1 remap [#511]
- Rework USART remap,

### Added

Expand Down Expand Up @@ -58,6 +60,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
[#505]: https://github.com/stm32-rs/stm32f1xx-hal/pull/505
[#506]: https://github.com/stm32-rs/stm32f1xx-hal/pull/506
[#509]: https://github.com/stm32-rs/stm32f1xx-hal/pull/509
[#510]: https://github.com/stm32-rs/stm32f1xx-hal/pull/510
[#511]: https://github.com/stm32-rs/stm32f1xx-hal/pull/511

## [v0.10.0] - 2022-12-12
Expand Down
12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ version = "1.0"
version = "0.6.1"

[dependencies.stm32-usbd]
version = "0.6.0"
version = "0.7.0"
optional = true

[dev-dependencies]
Expand All @@ -62,8 +62,8 @@ cortex-m-semihosting = "0.5.0"
heapless = "0.8.0"
mfrc522 = { version = "0.7.0", features = ["eh02"] }
mpu9250 = "0.25.0"
usb-device = "0.2.8"
usbd-serial = "0.1.1"
usb-device = "0.3.2"
usbd-serial = "0.2.2"

[features]
doc = []
Expand Down Expand Up @@ -101,15 +101,15 @@ lto = true

[[example]]
name = "usb_serial"
required-features = ["stm32-usbd"]
required-features = ["stm32f103", "stm32-usbd"]

[[example]]
name = "usb_serial_interrupt"
required-features = ["stm32-usbd"]
required-features = ["stm32f103", "stm32-usbd"]

[[example]]
name = "usb_serial_rtic"
required-features = ["stm32-usbd"]
required-features = ["stm32f103", "stm32-usbd"]

[[example]]
name = "blinky_timer_irq"
Expand Down
8 changes: 5 additions & 3 deletions examples/usb_serial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,12 @@ fn main() -> ! {
let mut serial = SerialPort::new(&usb_bus);

let mut usb_dev = UsbDeviceBuilder::new(&usb_bus, UsbVidPid(0x16c0, 0x27dd))
.manufacturer("Fake company")
.product("Serial port")
.serial_number("TEST")
.device_class(USB_CLASS_CDC)
.strings(&[StringDescriptors::default()
.manufacturer("Fake Company")
.product("Serial port")
.serial_number("TEST")])
.unwrap()
.build();

loop {
Expand Down
8 changes: 5 additions & 3 deletions examples/usb_serial_interrupt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,12 @@ fn main() -> ! {
USB_SERIAL = Some(SerialPort::new(USB_BUS.as_ref().unwrap()));

let usb_dev = UsbDeviceBuilder::new(USB_BUS.as_ref().unwrap(), UsbVidPid(0x16c0, 0x27dd))

Check warning on line 63 in examples/usb_serial_interrupt.rs

View workflow job for this annotation

GitHub Actions / check (nightly, stm32f103, true)

creating a shared reference to mutable static is discouraged

Check warning on line 63 in examples/usb_serial_interrupt.rs

View workflow job for this annotation

GitHub Actions / check (nightly, stm32f103, true)

creating a shared reference to mutable static is discouraged
.manufacturer("Fake company")
.product("Serial port")
.serial_number("TEST")
.device_class(USB_CLASS_CDC)
.strings(&[StringDescriptors::default()
.manufacturer("Fake Company")
.product("Serial port")
.serial_number("TEST")])
.unwrap()
.build();

USB_DEVICE = Some(usb_dev);
Expand Down
8 changes: 5 additions & 3 deletions examples/usb_serial_rtic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,12 @@ mod app {
unsafe { USB_BUS.as_ref().unwrap() },

Check warning on line 67 in examples/usb_serial_rtic.rs

View workflow job for this annotation

GitHub Actions / check (nightly, stm32f103, true)

creating a shared reference to mutable static is discouraged
UsbVidPid(0x16c0, 0x27dd),
)
.manufacturer("Fake company")
.product("Serial port")
.serial_number("TEST")
.device_class(usbd_serial::USB_CLASS_CDC)
.strings(&[StringDescriptors::default()
.manufacturer("Fake Company")
.product("Serial port")
.serial_number("TEST")])
.unwrap()
.build();

(Shared { usb_dev, serial }, Local {}, init::Monotonics())
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ pub mod spi;
pub mod time;
pub mod timer;
#[cfg(feature = "stm32-usbd")]
#[cfg(feature = "stm32f103")]
pub mod usb;
pub mod watchdog;

Expand Down
2 changes: 1 addition & 1 deletion tools/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def main():

crate_info = cargo_meta["packages"][0]

features = ["{},rtic,high".format(x)
features = ["{},rtic,high,stm32-usbd".format(x)
for x in crate_info["features"].keys()
if x.startswith("stm32f1")]

Expand Down

0 comments on commit 6a8d6f4

Please sign in to comment.