Skip to content

Make usbd_interface_init() weak so that it can be redefined in sketch or external library #341

Closed
@edogaldo

Description

@edogaldo

Hello @fpistm, as I can understand function usbd_interface_init() is a hook to initiate USB function (HID at the moment) if required, correct?

int main( void )
{
initVariant();
#if defined(USBCON)
usbd_interface_init();
#endif

If yes, what about making its definition

void usbd_interface_init(void)
{
#ifdef USBD_USE_HID_COMPOSITE
/* Init Device Library */
USBD_Init(&hUSBD_Device_HID, &HID_Desc, 0);
/* Add Supported Class */
USBD_RegisterClass(&hUSBD_Device_HID, USBD_COMPOSITE_HID_CLASS);
/* Start Device Process */
USBD_Start(&hUSBD_Device_HID);
#endif // USBD_USE_HID_COMPOSITE
}

as weak so that users can redefine it in order to implement USB features in sketches or external libraries?

Thanks in advance and best, E.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions