<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic USB Generic HID Device Example Code - What is the benefit of enabling the double buffer? in MCUXpresso SDK</title>
    <link>https://community.nxp.com/t5/MCUXpresso-SDK/USB-Generic-HID-Device-Example-Code-What-is-the-benefit-of/m-p/807416#M985</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using the LPCXpresso54608 SDK for MCUXpresso.&amp;nbsp; In particular, I'm running the generic HID device with FreeRTOS example code (&lt;A _jive_internal="true" href="https://community.nxp.com/thread/484970"&gt;link to my code/setup&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One of the settings is to enable the double buffer in usb_device_lpcip3511.h:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;#define USB_DEVICE_IP3511_DOUBLE_BUFFER_ENABLE (1u)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The double buffer is enabled by default.&amp;nbsp; It seems to add a layer of complexity that I'm not sure I need, and I'm not so sure it is even working correctly with the example!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could someone enlighten me on the purpose/intended use of the double buffer?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 28 Sep 2018 22:36:43 GMT</pubDate>
    <dc:creator>nbgatgi</dc:creator>
    <dc:date>2018-09-28T22:36:43Z</dc:date>
    <item>
      <title>USB Generic HID Device Example Code - What is the benefit of enabling the double buffer?</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/USB-Generic-HID-Device-Example-Code-What-is-the-benefit-of/m-p/807416#M985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using the LPCXpresso54608 SDK for MCUXpresso.&amp;nbsp; In particular, I'm running the generic HID device with FreeRTOS example code (&lt;A _jive_internal="true" href="https://community.nxp.com/thread/484970"&gt;link to my code/setup&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One of the settings is to enable the double buffer in usb_device_lpcip3511.h:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;#define USB_DEVICE_IP3511_DOUBLE_BUFFER_ENABLE (1u)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The double buffer is enabled by default.&amp;nbsp; It seems to add a layer of complexity that I'm not sure I need, and I'm not so sure it is even working correctly with the example!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could someone enlighten me on the purpose/intended use of the double buffer?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2018 22:36:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/USB-Generic-HID-Device-Example-Code-What-is-the-benefit-of/m-p/807416#M985</guid>
      <dc:creator>nbgatgi</dc:creator>
      <dc:date>2018-09-28T22:36:43Z</dc:date>
    </item>
    <item>
      <title>Re: USB Generic HID Device Example Code - What is the benefit of enabling the double buffer?</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/USB-Generic-HID-Device-Example-Code-What-is-the-benefit-of/m-p/807417#M986</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nick:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Double buffering is used for more efficient transfers.&lt;/P&gt;&lt;P&gt;Data in one buffer are being processed while the next set of data is read into the other one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 07 Oct 2018 07:47:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/USB-Generic-HID-Device-Example-Code-What-is-the-benefit-of/m-p/807417#M986</guid>
      <dc:creator>danielchen</dc:creator>
      <dc:date>2018-10-07T07:47:54Z</dc:date>
    </item>
    <item>
      <title>Re: USB Generic HID Device Example Code - What is the benefit of enabling the double buffer?</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/USB-Generic-HID-Device-Example-Code-What-is-the-benefit-of/m-p/807418#M987</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I should have been more clear in my question.&amp;nbsp; I generally understand the purpose of double-buffering.&amp;nbsp; I'm looking for more of a walk-through of this particular implementation.&amp;nbsp; I can see the buffer index toggle, and see that every packet received goes into the alternate buffer, but within "USB_DeviceHidGenericCallback", the case "kUSB_DeviceHidEventRecvResponse" first calls "USB_DeviceHidSend" without toggling the buffer index, which echoes the data received the the IN-ENDPOINT (to the PC).&amp;nbsp; Right after that, the buffer index is toggled which generally makes sense to me.&amp;nbsp; THEN "USB_DeviceHidRecv" is called using the newly toggled buffer index.&amp;nbsp; WHAT IS THIS DOING?!?!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Oct 2018 18:43:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/USB-Generic-HID-Device-Example-Code-What-is-the-benefit-of/m-p/807418#M987</guid>
      <dc:creator>nbgatgi</dc:creator>
      <dc:date>2018-10-26T18:43:50Z</dc:date>
    </item>
  </channel>
</rss>

