Example #1
0
/**
 * Initialises the USB layer.
 */
void USB::init()
{
	max3421e_init();
	max3421e_powerOn();

	// Initialise the USB state machine.
	usb_task_state = USB_DETACHED_SUBSTATE_INITIALIZE;

	// Initialise the device table.
	for( uint8_t i = 0; i < (USB_NUMDEVICES + 1); i++ ) {
		deviceTable[i].active = false;
	}

	// Address 0 is used to configure devices and assign them an address when they are first plugged in
	deviceTable[0].address = 0;
	USB::initEndPoint( &(deviceTable[0].control), 0 );

}
Example #2
0
/**
 * Initialises the USB layer.
 */
void usb_init()
{
 	max3421e_init();
	max3421e_powerOn();

	uint8_t i;

	// Initialise the USB state machine.
	usb_task_state = USB_DETACHED_SUBSTATE_INITIALIZE;

	// Initialise the device table.
	for (i = 0; i < (USB_NUMDEVICES + 1); i++)
		deviceTable[i].active = false;

	// Address 0 is used to configure devices and assign them an address when they are first plugged in
	deviceTable[0].address = 0;
	usb_initEndPoint(&(deviceTable[0].control), 0);

//	xSerialPrintf_P(PSTR("\r\nusb_init done! @ %u"), xTaskGetTickCount()); // FIXME remove this debugging
}