diff options
| author | Dario Nieuwenhuis <[email protected]> | 2022-05-09 02:07:48 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2022-05-09 02:07:48 +0200 |
| commit | 2e104170de36295243608fbbebebdc6f52e8f8d0 (patch) | |
| tree | dd9c72b14006ee682eef35000f6f1744d8b897dc /embassy-usb | |
| parent | e9ab960ebf1ab5da2e062663079b77aebf51c40f (diff) | |
usb: remove address arg from endpoint allocation.
Diffstat (limited to 'embassy-usb')
| -rw-r--r-- | embassy-usb/src/builder.rs | 14 | ||||
| -rw-r--r-- | embassy-usb/src/driver.rs | 2 |
2 files changed, 6 insertions, 10 deletions
diff --git a/embassy-usb/src/builder.rs b/embassy-usb/src/builder.rs index 8cf9c82a9..698a5f765 100644 --- a/embassy-usb/src/builder.rs +++ b/embassy-usb/src/builder.rs | |||
| @@ -372,7 +372,6 @@ impl<'a, 'd, D: Driver<'d>> InterfaceAltBuilder<'a, 'd, D> { | |||
| 372 | 372 | ||
| 373 | fn endpoint_in( | 373 | fn endpoint_in( |
| 374 | &mut self, | 374 | &mut self, |
| 375 | ep_addr: Option<EndpointAddress>, | ||
| 376 | ep_type: EndpointType, | 375 | ep_type: EndpointType, |
| 377 | max_packet_size: u16, | 376 | max_packet_size: u16, |
| 378 | interval: u8, | 377 | interval: u8, |
| @@ -380,7 +379,7 @@ impl<'a, 'd, D: Driver<'d>> InterfaceAltBuilder<'a, 'd, D> { | |||
| 380 | let ep = self | 379 | let ep = self |
| 381 | .builder | 380 | .builder |
| 382 | .driver | 381 | .driver |
| 383 | .alloc_endpoint_in(ep_addr, ep_type, max_packet_size, interval) | 382 | .alloc_endpoint_in(ep_type, max_packet_size, interval) |
| 384 | .expect("alloc_endpoint_in failed"); | 383 | .expect("alloc_endpoint_in failed"); |
| 385 | 384 | ||
| 386 | self.builder.config_descriptor.endpoint(ep.info()); | 385 | self.builder.config_descriptor.endpoint(ep.info()); |
| @@ -390,7 +389,6 @@ impl<'a, 'd, D: Driver<'d>> InterfaceAltBuilder<'a, 'd, D> { | |||
| 390 | 389 | ||
| 391 | fn endpoint_out( | 390 | fn endpoint_out( |
| 392 | &mut self, | 391 | &mut self, |
| 393 | ep_addr: Option<EndpointAddress>, | ||
| 394 | ep_type: EndpointType, | 392 | ep_type: EndpointType, |
| 395 | max_packet_size: u16, | 393 | max_packet_size: u16, |
| 396 | interval: u8, | 394 | interval: u8, |
| @@ -398,7 +396,7 @@ impl<'a, 'd, D: Driver<'d>> InterfaceAltBuilder<'a, 'd, D> { | |||
| 398 | let ep = self | 396 | let ep = self |
| 399 | .builder | 397 | .builder |
| 400 | .driver | 398 | .driver |
| 401 | .alloc_endpoint_out(ep_addr, ep_type, max_packet_size, interval) | 399 | .alloc_endpoint_out(ep_type, max_packet_size, interval) |
| 402 | .expect("alloc_endpoint_out failed"); | 400 | .expect("alloc_endpoint_out failed"); |
| 403 | 401 | ||
| 404 | self.builder.config_descriptor.endpoint(ep.info()); | 402 | self.builder.config_descriptor.endpoint(ep.info()); |
| @@ -411,7 +409,7 @@ impl<'a, 'd, D: Driver<'d>> InterfaceAltBuilder<'a, 'd, D> { | |||
| 411 | /// Descriptors are written in the order builder functions are called. Note that some | 409 | /// Descriptors are written in the order builder functions are called. Note that some |
| 412 | /// classes care about the order. | 410 | /// classes care about the order. |
| 413 | pub fn endpoint_bulk_in(&mut self, max_packet_size: u16) -> D::EndpointIn { | 411 | pub fn endpoint_bulk_in(&mut self, max_packet_size: u16) -> D::EndpointIn { |
| 414 | self.endpoint_in(None, EndpointType::Bulk, max_packet_size, 0) | 412 | self.endpoint_in(EndpointType::Bulk, max_packet_size, 0) |
| 415 | } | 413 | } |
| 416 | 414 | ||
| 417 | /// Allocate a BULK OUT endpoint and write its descriptor. | 415 | /// Allocate a BULK OUT endpoint and write its descriptor. |
| @@ -419,7 +417,7 @@ impl<'a, 'd, D: Driver<'d>> InterfaceAltBuilder<'a, 'd, D> { | |||
| 419 | /// Descriptors are written in the order builder functions are called. Note that some | 417 | /// Descriptors are written in the order builder functions are called. Note that some |
| 420 | /// classes care about the order. | 418 | /// classes care about the order. |
| 421 | pub fn endpoint_bulk_out(&mut self, max_packet_size: u16) -> D::EndpointOut { | 419 | pub fn endpoint_bulk_out(&mut self, max_packet_size: u16) -> D::EndpointOut { |
| 422 | self.endpoint_out(None, EndpointType::Bulk, max_packet_size, 0) | 420 | self.endpoint_out(EndpointType::Bulk, max_packet_size, 0) |
| 423 | } | 421 | } |
| 424 | 422 | ||
| 425 | /// Allocate a INTERRUPT IN endpoint and write its descriptor. | 423 | /// Allocate a INTERRUPT IN endpoint and write its descriptor. |
| @@ -427,11 +425,11 @@ impl<'a, 'd, D: Driver<'d>> InterfaceAltBuilder<'a, 'd, D> { | |||
| 427 | /// Descriptors are written in the order builder functions are called. Note that some | 425 | /// Descriptors are written in the order builder functions are called. Note that some |
| 428 | /// classes care about the order. | 426 | /// classes care about the order. |
| 429 | pub fn endpoint_interrupt_in(&mut self, max_packet_size: u16, interval: u8) -> D::EndpointIn { | 427 | pub fn endpoint_interrupt_in(&mut self, max_packet_size: u16, interval: u8) -> D::EndpointIn { |
| 430 | self.endpoint_in(None, EndpointType::Interrupt, max_packet_size, interval) | 428 | self.endpoint_in(EndpointType::Interrupt, max_packet_size, interval) |
| 431 | } | 429 | } |
| 432 | 430 | ||
| 433 | /// Allocate a INTERRUPT OUT endpoint and write its descriptor. | 431 | /// Allocate a INTERRUPT OUT endpoint and write its descriptor. |
| 434 | pub fn endpoint_interrupt_out(&mut self, max_packet_size: u16, interval: u8) -> D::EndpointOut { | 432 | pub fn endpoint_interrupt_out(&mut self, max_packet_size: u16, interval: u8) -> D::EndpointOut { |
| 435 | self.endpoint_out(None, EndpointType::Interrupt, max_packet_size, interval) | 433 | self.endpoint_out(EndpointType::Interrupt, max_packet_size, interval) |
| 436 | } | 434 | } |
| 437 | } | 435 | } |
diff --git a/embassy-usb/src/driver.rs b/embassy-usb/src/driver.rs index e552dc7b6..a782b377c 100644 --- a/embassy-usb/src/driver.rs +++ b/embassy-usb/src/driver.rs | |||
| @@ -25,7 +25,6 @@ pub trait Driver<'a> { | |||
| 25 | /// * `interval` - Polling interval parameter for interrupt endpoints. | 25 | /// * `interval` - Polling interval parameter for interrupt endpoints. |
| 26 | fn alloc_endpoint_out( | 26 | fn alloc_endpoint_out( |
| 27 | &mut self, | 27 | &mut self, |
| 28 | ep_addr: Option<EndpointAddress>, | ||
| 29 | ep_type: EndpointType, | 28 | ep_type: EndpointType, |
| 30 | max_packet_size: u16, | 29 | max_packet_size: u16, |
| 31 | interval: u8, | 30 | interval: u8, |
| @@ -33,7 +32,6 @@ pub trait Driver<'a> { | |||
| 33 | 32 | ||
| 34 | fn alloc_endpoint_in( | 33 | fn alloc_endpoint_in( |
| 35 | &mut self, | 34 | &mut self, |
| 36 | ep_addr: Option<EndpointAddress>, | ||
| 37 | ep_type: EndpointType, | 35 | ep_type: EndpointType, |
| 38 | max_packet_size: u16, | 36 | max_packet_size: u16, |
| 39 | interval: u8, | 37 | interval: u8, |
