<?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>LPC MicrocontrollersのトピックRe: Bug: Chip_SCT_ClearEventFlag() clears ANY pending event</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Bug-Chip-SCT-ClearEventFlag-clears-ANY-pending-event/m-p/602023#M23397</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A _jive_internal="true" data-containerid="-1" data-containertype="-1" data-content-finding="Community" data-objectid="292929" data-objecttype="3" href="https://community.nxp.com/people/rolfeigenheer"&gt;Rolf Eigenheer,&lt;/A&gt;&lt;/P&gt;&lt;P&gt;In the library, the event group includes a variety of options (Seeing below), so it doesn't clear all flags when choose some options.&lt;/P&gt;&lt;P&gt;And &lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Chip_SCT_ClearEventFlag&lt;/SPAN&gt; is the portion of interrupt handle routine, it only is used to clear the corresponding event flag.&lt;/P&gt;&lt;P&gt;/**&lt;BR /&gt;&amp;nbsp;* SCT Event values enum&lt;BR /&gt;&amp;nbsp;*/&lt;BR /&gt;typedef enum CHIP_SCT_EVENT {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;SCT_EVT_0&amp;nbsp; = (1 &amp;lt;&amp;lt; 0),&amp;nbsp;&amp;nbsp; &amp;nbsp;/*!&amp;lt; Event 0 */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;SCT_EVT_1&amp;nbsp; = (1 &amp;lt;&amp;lt; 1),&amp;nbsp;&amp;nbsp; &amp;nbsp;/*!&amp;lt; Event 1 */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;SCT_EVT_2&amp;nbsp; = (1 &amp;lt;&amp;lt; 2),&amp;nbsp;&amp;nbsp; &amp;nbsp;/*!&amp;lt; Event 2 */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;SCT_EVT_3&amp;nbsp; = (1 &amp;lt;&amp;lt; 3),&amp;nbsp;&amp;nbsp; &amp;nbsp;/*!&amp;lt; Event 3 */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;SCT_EVT_4&amp;nbsp; = (1 &amp;lt;&amp;lt; 4)&amp;nbsp;&amp;nbsp; &amp;nbsp;/*!&amp;lt; Event 4 */&lt;BR /&gt;} CHIP_SCT_EVENT_T;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this clear.&lt;BR /&gt;Have a great day,&lt;BR /&gt;Ping&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Jan 2017 03:10:45 GMT</pubDate>
    <dc:creator>jeremyzhou</dc:creator>
    <dc:date>2017-01-12T03:10:45Z</dc:date>
    <item>
      <title>Bug: Chip_SCT_ClearEventFlag() clears ANY pending event</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Bug-Chip-SCT-ClearEventFlag-clears-ANY-pending-event/m-p/602020#M23394</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found that&amp;nbsp;Chip_SCT_ClearEventFlag in sct15xx.h clears all pending events.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STATIC INLINE void Chip_SCT_ClearEventFlag(LPC_SCT_T *pSCT, CHIP_SCT_EVENT_T evt)&lt;BR /&gt;{&lt;BR /&gt; pSCT-&amp;gt;EVFLAG |= evt;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;UM10736:&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;SCT event flag register&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;This register records events. Writing ones to this register clears the corresponding flags &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;and negates the SCT interrupt request if all enabled Flag bits are zero.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OR-ing will clear the evt as well as all events which&amp;nbsp;read as '1'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jan 2017 09:39:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Bug-Chip-SCT-ClearEventFlag-clears-ANY-pending-event/m-p/602020#M23394</guid>
      <dc:creator>rolfeigenheer</dc:creator>
      <dc:date>2017-01-10T09:39:21Z</dc:date>
    </item>
    <item>
      <title>Re: Bug: Chip_SCT_ClearEventFlag() clears ANY pending event</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Bug-Chip-SCT-ClearEventFlag-clears-ANY-pending-event/m-p/602021#M23395</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A _jive_internal="true" data-content-finding="Community" data-userid="292929" data-username="rolfeigenheer" href="https://community.nxp.com/people/rolfeigenheer"&gt;Rolf Eigenheer,&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The “|=” operator includes the write operation, and it can clear the corresponding flags after execute the operator.&lt;/P&gt;&lt;P&gt;Hope this clear.&lt;BR /&gt;Have a great day,&lt;BR /&gt;Ping&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jan 2017 03:01:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Bug-Chip-SCT-ClearEventFlag-clears-ANY-pending-event/m-p/602021#M23395</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2017-01-11T03:01:22Z</dc:date>
    </item>
    <item>
      <title>Re: Bug: Chip_SCT_ClearEventFlag() clears ANY pending event</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Bug-Chip-SCT-ClearEventFlag-clears-ANY-pending-event/m-p/602022#M23396</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Chip_SCT_ClearEventFlag(LPC_SCT_T *pSCT, CHIP_SCT_EVENT_T evt) &amp;nbsp;as implemented in the lib, reads the flags actually set and clears them all. The parameter evt has no use!&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;An interrupt handler should read the pending events, handle them and clear the handled ones.&amp;nbsp;&lt;SPAN&gt;Chip_SCT_ClearEventFlag clears also the events which came up&amp;nbsp;later. In my opinion, this is a clear bug.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jan 2017 08:03:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Bug-Chip-SCT-ClearEventFlag-clears-ANY-pending-event/m-p/602022#M23396</guid>
      <dc:creator>rolfeigenheer</dc:creator>
      <dc:date>2017-01-11T08:03:54Z</dc:date>
    </item>
    <item>
      <title>Re: Bug: Chip_SCT_ClearEventFlag() clears ANY pending event</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Bug-Chip-SCT-ClearEventFlag-clears-ANY-pending-event/m-p/602023#M23397</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A _jive_internal="true" data-containerid="-1" data-containertype="-1" data-content-finding="Community" data-objectid="292929" data-objecttype="3" href="https://community.nxp.com/people/rolfeigenheer"&gt;Rolf Eigenheer,&lt;/A&gt;&lt;/P&gt;&lt;P&gt;In the library, the event group includes a variety of options (Seeing below), so it doesn't clear all flags when choose some options.&lt;/P&gt;&lt;P&gt;And &lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Chip_SCT_ClearEventFlag&lt;/SPAN&gt; is the portion of interrupt handle routine, it only is used to clear the corresponding event flag.&lt;/P&gt;&lt;P&gt;/**&lt;BR /&gt;&amp;nbsp;* SCT Event values enum&lt;BR /&gt;&amp;nbsp;*/&lt;BR /&gt;typedef enum CHIP_SCT_EVENT {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;SCT_EVT_0&amp;nbsp; = (1 &amp;lt;&amp;lt; 0),&amp;nbsp;&amp;nbsp; &amp;nbsp;/*!&amp;lt; Event 0 */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;SCT_EVT_1&amp;nbsp; = (1 &amp;lt;&amp;lt; 1),&amp;nbsp;&amp;nbsp; &amp;nbsp;/*!&amp;lt; Event 1 */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;SCT_EVT_2&amp;nbsp; = (1 &amp;lt;&amp;lt; 2),&amp;nbsp;&amp;nbsp; &amp;nbsp;/*!&amp;lt; Event 2 */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;SCT_EVT_3&amp;nbsp; = (1 &amp;lt;&amp;lt; 3),&amp;nbsp;&amp;nbsp; &amp;nbsp;/*!&amp;lt; Event 3 */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;SCT_EVT_4&amp;nbsp; = (1 &amp;lt;&amp;lt; 4)&amp;nbsp;&amp;nbsp; &amp;nbsp;/*!&amp;lt; Event 4 */&lt;BR /&gt;} CHIP_SCT_EVENT_T;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this clear.&lt;BR /&gt;Have a great day,&lt;BR /&gt;Ping&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jan 2017 03:10:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Bug-Chip-SCT-ClearEventFlag-clears-ANY-pending-event/m-p/602023#M23397</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2017-01-12T03:10:45Z</dc:date>
    </item>
    <item>
      <title>Re: Bug: Chip_SCT_ClearEventFlag() clears ANY pending event</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Bug-Chip-SCT-ClearEventFlag-clears-ANY-pending-event/m-p/602024#M23398</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jeremy&lt;/P&gt;&lt;P&gt;Thanks for your response. But it is still not clear to me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;pSCT-&amp;gt;EVFLAG |= evt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;SPAN&gt;this is the same as &amp;nbsp; pSCT-&amp;gt;EVFLAG = &lt;SPAN style="background-color: #ffffff;"&gt;pSCT-&amp;gt;EVFLAG |&amp;nbsp;&lt;/SPAN&gt;evt&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The value evt has no use. If the event flag is not set, then it cannot be cleared.&lt;/P&gt;&lt;P&gt;If it is set, then it is cleared anyway by &lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;pSCT-&amp;gt;EVFLAG = &lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff;"&gt;pSCT-&amp;gt;EVFLAG&lt;/SPAN&gt;. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If&amp;nbsp;it should clear just the event 'evt', then the 'or' must be removed.&lt;/P&gt;&lt;P&gt;If it should clear all pending events, then no parameter evt is needed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Jan 2017 09:24:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Bug-Chip-SCT-ClearEventFlag-clears-ANY-pending-event/m-p/602024#M23398</guid>
      <dc:creator>rolfeigenheer</dc:creator>
      <dc:date>2017-01-13T09:24:41Z</dc:date>
    </item>
  </channel>
</rss>

