Skip to content
Snippets Groups Projects
Select Git revision
  • fa07deda9f129c1992726d2a51c6eaac168247f0
  • master default protected
2 results

usbd_hid_interface.h

Blame
  • user avatar
    Damien George authored
    The previous version did not work on MCUs that only had USB device mode
    (compared to OTG) because of the handling of NAK.  And this previous
    handling of NAK had a race condition where a new packet could come in
    before USBD_HID_SetNAK was called (since USBD_HID_ReceivePacket clears NAK
    as part of its operation).  Furthermore, the double buffering of incoming
    reports was not working, only one buffer could be used at a time.
    
    This commit rewrites the HID interface code to have a single incoming
    buffer, and only calls USBD_HID_ReceivePacket after the user has read the
    incoming report (similar to how the VCP does its flow control).  As such,
    USBD_HID_SetNAK and USBD_HID_ClearNAK are no longer needed.
    
    API functionality from the user's point of view should be unchanged with
    this commit.
    fa07deda
    History
    usbd_hid_interface.h 743 B