aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordjstrickland <[email protected]>2023-12-16 08:19:52 -0500
committerdjstrickland <[email protected]>2023-12-16 08:19:52 -0500
commita5379e708cab6e284a00f8b01e9db3d5c2eb400c (patch)
treeef22f002b01eec8ce76307f1475a1b6fda11315e
parent6bf70e14fb14882ce6adf0d47179b7408bdcb184 (diff)
remove `suspendable` field from `embassy_usb::builder::Config`
-rw-r--r--embassy-usb/src/builder.rs10
-rw-r--r--embassy-usb/src/lib.rs8
2 files changed, 3 insertions, 15 deletions
diff --git a/embassy-usb/src/builder.rs b/embassy-usb/src/builder.rs
index ebc1283e6..c4705d041 100644
--- a/embassy-usb/src/builder.rs
+++ b/embassy-usb/src/builder.rs
@@ -94,15 +94,6 @@ pub struct Config<'a> {
94 /// Default: 100mA 94 /// Default: 100mA
95 /// Max: 500mA 95 /// Max: 500mA
96 pub max_power: u16, 96 pub max_power: u16,
97
98 /// Allow the bus to be suspended.
99 ///
100 /// If set to `true`, the bus will put itself in the suspended state
101 /// when it receives a `driver::Event::Suspend` bus event. If you wish
102 /// to override this behavior, set this field to `false`.
103 ///
104 /// Default: `true`
105 pub suspendable: bool,
106} 97}
107 98
108impl<'a> Config<'a> { 99impl<'a> Config<'a> {
@@ -123,7 +114,6 @@ impl<'a> Config<'a> {
123 supports_remote_wakeup: false, 114 supports_remote_wakeup: false,
124 composite_with_iads: false, 115 composite_with_iads: false,
125 max_power: 100, 116 max_power: 100,
126 suspendable: true,
127 } 117 }
128 } 118 }
129} 119}
diff --git a/embassy-usb/src/lib.rs b/embassy-usb/src/lib.rs
index ff3295871..241e33a78 100644
--- a/embassy-usb/src/lib.rs
+++ b/embassy-usb/src/lib.rs
@@ -471,11 +471,9 @@ impl<'d, D: Driver<'d>> Inner<'d, D> {
471 } 471 }
472 Event::Suspend => { 472 Event::Suspend => {
473 trace!("usb: suspend"); 473 trace!("usb: suspend");
474 if self.config.suspendable { 474 self.suspended = true;
475 self.suspended = true; 475 for h in &mut self.handlers {
476 for h in &mut self.handlers { 476 h.suspended(true);
477 h.suspended(true);
478 }
479 } 477 }
480 } 478 }
481 Event::PowerDetected => { 479 Event::PowerDetected => {