-
-
Save rajivr/bdbcf473ab288e9505cfe4e5fc19be23 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "tusb.h" | |
/* | |
* Rust function | |
*/ | |
extern void dcd_edpt_open_rust(uint8_t ep_addr, uint16_t max_packet_size, uint8_t xfer_type); | |
/* | |
* Workaround the lack of bitfields support in Rust | |
*/ | |
bool dcd_edpt_open(uint8_t rhport, tusb_desc_endpoint_t const* p_endpoint_desc) | |
{ | |
(void) rhport; | |
uint8_t const ep_addr = p_endpoint_desc->bEndpointAddress; | |
uint16_t const max_packet_size = p_endpoint_desc->wMaxPacketSize.size; | |
uint8_t const xfer_type = p_endpoint_desc->bmAttributes.xfer; | |
dcd_edpt_open_rust(ep_addr, max_packet_size, xfer_type); | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment