Here are two functions in usb.c. They each return without configuring an EP if it is less than 2, which means EP0 and EP1. I understand that EP0 is configured elsewhere but why not allowing EP1 to be configured? I would like to emulate a printer that has two EPs, EP1 for OUT and EP2 for IN.
Later these transmit and receive functions also don't touch EP1:
In the various USB device options, only USB_EVERYTHING has a line at the end that mentions EP1:
None of the other options uses EP1. Is this just to reserve it for USB_EVERYTHING option or is there any limitation to EP1?
Thank you!
Code:
void usb_config_rx(uint32_t ep, uint32_t packet_size, int do_zlp, void (*cb)(transfer_t *))
{
uint32_t config = (packet_size << 16) | (do_zlp ? 0 : (1 << 29));
if (ep < 2 || ep > NUM_ENDPOINTS) return;
usb_endpoint_config(endpoint_queue_head + ep * 2, config, cb);
if (cb) endpointN_notify_mask |= (1 << ep);
}
void usb_config_tx(uint32_t ep, uint32_t packet_size, int do_zlp, void (*cb)(transfer_t *))
{
uint32_t config = (packet_size << 16) | (do_zlp ? 0 : (1 << 29));
if (ep < 2 || ep > NUM_ENDPOINTS) return;
usb_endpoint_config(endpoint_queue_head + ep * 2 + 1, config, cb);
if (cb) endpointN_notify_mask |= (1 << (ep + 16));
}
Later these transmit and receive functions also don't touch EP1:
Code:
void usb_transmit(int endpoint_number, transfer_t *transfer)
{
if (endpoint_number < 2 || endpoint_number > NUM_ENDPOINTS) return;
endpoint_t *endpoint = endpoint_queue_head + endpoint_number * 2 + 1;
uint32_t mask = 1 << (endpoint_number + 16);
schedule_transfer(endpoint, mask, transfer);
}
void usb_receive(int endpoint_number, transfer_t *transfer)
{
if (endpoint_number < 2 || endpoint_number > NUM_ENDPOINTS) return;
endpoint_t *endpoint = endpoint_queue_head + endpoint_number * 2;
uint32_t mask = 1 << endpoint_number;
schedule_transfer(endpoint, mask, transfer);
}
In the various USB device options, only USB_EVERYTHING has a line at the end that mentions EP1:
Code:
#define ENDPOINT1_CONFIG ENDPOINT_TRANSMIT_ONLY
None of the other options uses EP1. Is this just to reserve it for USB_EVERYTHING option or is there any limitation to EP1?
Thank you!