usb: move all control-related stuff to mod control.

This commit is contained in:
Dario Nieuwenhuis
2022-03-28 03:27:21 +02:00
parent 15cc97d794
commit 2b547f311e
5 changed files with 109 additions and 111 deletions

View File

@ -3,8 +3,9 @@ use core::mem::{self, MaybeUninit};
use core::sync::atomic::{AtomicBool, Ordering};
use defmt::info;
use embassy::blocking_mutex::CriticalSectionMutex;
use embassy_usb::class::{ControlHandler, ControlInRequestStatus, RequestStatus};
use embassy_usb::control::{self, Request};
use embassy_usb::control::{
self, ControlHandler, ControlIn, ControlInRequestStatus, Request, RequestStatus,
};
use embassy_usb::driver::{Endpoint, EndpointIn, EndpointOut, ReadError, WriteError};
use embassy_usb::{driver::Driver, types::*, UsbDeviceBuilder};
@ -124,7 +125,7 @@ impl ControlHandler for Control {
fn control_in<'a>(
&mut self,
req: Request,
control: embassy_usb::class::ControlIn<'a>,
control: ControlIn<'a>,
) -> ControlInRequestStatus<'a> {
match req.request {
// REQ_GET_ENCAPSULATED_COMMAND is not really supported - it will be rejected below.