Skip to content
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
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

No unreleased changes yet!
### Changed
* `embedded-io` version changed from 0.6.x to 0.7.x
* Rust edition changed from 2018 to 2024

### Added
* Implemented `core::fmt::Display` and `core::error::Error` for `io::Error` to
allow for compatability with `embedded-io` 0.7.x

## [0.2.2] - 2024-04-22

Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "usbd-serial"
description = "USB CDC-ACM serial port class for use with usb-device."
version = "0.2.2"
edition = "2018"
edition = "2024"
readme = "README.md"
keywords = ["no-std", "usb-device"]
license = "MIT"
Expand All @@ -13,4 +13,4 @@ repository = "https://github.com/mvirkkunen/usbd-serial"
embedded-hal = "0.2.4"
nb = "1"
usb-device = "0.3"
embedded-io = "0.6"
embedded-io = "0.7"
2 changes: 1 addition & 1 deletion src/cdc_acm.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use core::convert::TryInto;
use core::mem;
use usb_device::Result;
use usb_device::class_prelude::*;
use usb_device::descriptor::lang_id::LangID;
use usb_device::device::DEFAULT_ALTERNATE_SETTING;
use usb_device::Result;

/// This should be used as `device_class` when building the `UsbDevice`.
pub const USB_CLASS_CDC: u8 = 0x02;
Expand Down
8 changes: 8 additions & 0 deletions src/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ impl From<usb_device::UsbError> for Error {
}
}

impl core::fmt::Display for Error {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{:?}", self)
}
}

impl core::error::Error for Error {}

impl embedded_io::Error for Error {
fn kind(&self) -> embedded_io::ErrorKind {
match self.0 {
Expand Down
2 changes: 1 addition & 1 deletion src/serial_port.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ use crate::buffer::{Buffer, DefaultBufferStore};
use crate::cdc_acm::*;
use core::borrow::BorrowMut;
use core::slice;
use usb_device::Result;
use usb_device::class_prelude::*;
use usb_device::descriptor::lang_id::LangID;
use usb_device::Result;

/// USB (CDC-ACM) serial port with built-in buffering to implement stream-like behavior.
///
Expand Down
Loading