usb: builtin handling of interface alternate settings
The stack reads its own descriptors to figure out which endpoints are used in which alt settings, and enables/disables them as needed. The ControlHandler has a callback so it can get notified of alternate setting changes, which is purely informative (it doesn't have to do anything).
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
use super::builder::Config;
|
||||
use super::{types::*, CONFIGURATION_VALUE, DEFAULT_ALTERNATE_SETTING};
|
||||
use super::{types::*, CONFIGURATION_VALUE};
|
||||
|
||||
/// Standard descriptor types
|
||||
#[allow(missing_docs)]
|
||||
@ -192,7 +192,7 @@ impl<'a> DescriptorWriter<'a> {
|
||||
interface_protocol: u8,
|
||||
interface_string: Option<StringIndex>,
|
||||
) {
|
||||
if alternate_setting == DEFAULT_ALTERNATE_SETTING {
|
||||
if alternate_setting == 0 {
|
||||
match self.num_interfaces_mark {
|
||||
Some(mark) => self.buf[mark] += 1,
|
||||
None => {
|
||||
|
Reference in New Issue
Block a user