Skip to content

Use latest version of usb-device and usbd-serial #510

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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))
.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() },
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
Loading