aboutsummaryrefslogtreecommitdiff
path: root/embassy-usb/src/control.rs
diff options
context:
space:
mode:
authoralexmoon <[email protected]>2022-03-28 20:10:13 -0400
committerDario Nieuwenhuis <[email protected]>2022-04-06 05:38:11 +0200
commitc53bb7394a20e180e2ac7e81cc468025018bd1da (patch)
tree8457402aeda554b448391ccc6d6fd409c10390d1 /embassy-usb/src/control.rs
parenta22639ad920fccfd909602f5c69147be911650eb (diff)
Switch to ControlHandler owned bufs for control_in()
Diffstat (limited to 'embassy-usb/src/control.rs')
-rw-r--r--embassy-usb/src/control.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/embassy-usb/src/control.rs b/embassy-usb/src/control.rs
index cdae2d977..195b218dc 100644
--- a/embassy-usb/src/control.rs
+++ b/embassy-usb/src/control.rs
@@ -133,8 +133,8 @@ pub enum OutResponse {
133 133
134#[derive(Copy, Clone, Eq, PartialEq, Debug)] 134#[derive(Copy, Clone, Eq, PartialEq, Debug)]
135#[cfg_attr(feature = "defmt", derive(defmt::Format))] 135#[cfg_attr(feature = "defmt", derive(defmt::Format))]
136pub enum InResponse { 136pub enum InResponse<'a> {
137 Accepted(usize), 137 Accepted(&'a [u8]),
138 Rejected, 138 Rejected,
139} 139}
140 140
@@ -164,8 +164,7 @@ pub trait ControlHandler {
164 /// # Arguments 164 /// # Arguments
165 /// 165 ///
166 /// * `req` - The request from the SETUP packet. 166 /// * `req` - The request from the SETUP packet.
167 /// * `resp` - The buffer for you to write the response. 167 fn control_in(&mut self, req: Request) -> InResponse<'_> {
168 fn control_in(&mut self, req: Request, resp: &mut [u8]) -> InResponse {
169 InResponse::Rejected 168 InResponse::Rejected
170 } 169 }
171} 170}