Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++ compatibility #8

Open
pustekuchen91 opened this issue Aug 18, 2020 · 1 comment
Open

C++ compatibility #8

pustekuchen91 opened this issue Aug 18, 2020 · 1 comment

Comments

@pustekuchen91
Copy link

\usb\driver\usbfs\src\templates\usb_LastTransactionDetails_Default.h is not c++ compatible
Missing casts

PLIB_TEMPLATE void USB_LastTransactionDetailsGet_Default( USB_MODULE_ID index , USB_BUFFER_DIRECTION * direction , USB_PING_PONG_STATE * pingpong , uint8_t * endpoint )
{
    volatile usb_registers_t   * usb = ((usb_registers_t *)(index));
    *direction = usb->UxSTAT.DIR;
    *pingpong = usb->UxSTAT.PPBI;
    *endpoint = usb->UxSTAT.ENDPT;
}

Need to cast to specific types

PLIB_TEMPLATE void USB_LastTransactionDetailsGet_Default( USB_MODULE_ID index , USB_BUFFER_DIRECTION * direction , USB_PING_PONG_STATE * pingpong , uint8_t * endpoint )
{
    volatile usb_registers_t   * usb = ((usb_registers_t *)(index));
    *direction = (USB_BUFFER_DIRECTION)(usb->UxSTAT.DIR);
    *pingpong = (USB_PING_PONG_STATE)(usb->UxSTAT.PPBI);
    *endpoint = (uint8_t)(usb->UxSTAT.ENDPT);
}

there a maybe some more files without c++ compatiblity.

@shijasm
Copy link
Collaborator

shijasm commented Aug 18, 2020

Thanks for reporting. This issue will be resolved in the next USB package release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants