diff options
| author | alexmoon <[email protected]> | 2022-04-05 22:04:11 -0400 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2022-04-09 01:48:17 +0200 |
| commit | e867364d42477ecf3dc48e6fd787dff96cb6fadf (patch) | |
| tree | 9bd64f21d1343b60186ce437f576c6a0fbbfdda6 /embassy-usb-serial/src | |
| parent | b2cdaa56c1dca5ce293dad3b1e450f97bcf85251 (diff) | |
Unify ReadError and WriteError into EndpointError
Diffstat (limited to 'embassy-usb-serial/src')
| -rw-r--r-- | embassy-usb-serial/src/lib.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/embassy-usb-serial/src/lib.rs b/embassy-usb-serial/src/lib.rs index 07352fac5..7b25398d0 100644 --- a/embassy-usb-serial/src/lib.rs +++ b/embassy-usb-serial/src/lib.rs | |||
| @@ -10,7 +10,7 @@ use core::mem::{self, MaybeUninit}; | |||
| 10 | use core::sync::atomic::{AtomicBool, Ordering}; | 10 | use core::sync::atomic::{AtomicBool, Ordering}; |
| 11 | use embassy::blocking_mutex::CriticalSectionMutex; | 11 | use embassy::blocking_mutex::CriticalSectionMutex; |
| 12 | use embassy_usb::control::{self, ControlHandler, InResponse, OutResponse, Request}; | 12 | use embassy_usb::control::{self, ControlHandler, InResponse, OutResponse, Request}; |
| 13 | use embassy_usb::driver::{Endpoint, EndpointIn, EndpointOut, ReadError, WriteError}; | 13 | use embassy_usb::driver::{Endpoint, EndpointError, EndpointIn, EndpointOut}; |
| 14 | use embassy_usb::{driver::Driver, types::*, UsbDeviceBuilder}; | 14 | use embassy_usb::{driver::Driver, types::*, UsbDeviceBuilder}; |
| 15 | 15 | ||
| 16 | /// This should be used as `device_class` when building the `UsbDevice`. | 16 | /// This should be used as `device_class` when building the `UsbDevice`. |
| @@ -265,12 +265,12 @@ impl<'d, D: Driver<'d>> CdcAcmClass<'d, D> { | |||
| 265 | } | 265 | } |
| 266 | 266 | ||
| 267 | /// Writes a single packet into the IN endpoint. | 267 | /// Writes a single packet into the IN endpoint. |
| 268 | pub async fn write_packet(&mut self, data: &[u8]) -> Result<(), WriteError> { | 268 | pub async fn write_packet(&mut self, data: &[u8]) -> Result<(), EndpointError> { |
| 269 | self.write_ep.write(data).await | 269 | self.write_ep.write(data).await |
| 270 | } | 270 | } |
| 271 | 271 | ||
| 272 | /// Reads a single packet from the OUT endpoint. | 272 | /// Reads a single packet from the OUT endpoint. |
| 273 | pub async fn read_packet(&mut self, data: &mut [u8]) -> Result<usize, ReadError> { | 273 | pub async fn read_packet(&mut self, data: &mut [u8]) -> Result<usize, EndpointError> { |
| 274 | self.read_ep.read(data).await | 274 | self.read_ep.read(data).await |
| 275 | } | 275 | } |
| 276 | 276 | ||
