<?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>LPCXpresso IDE中的主题 Bug Report: LPC_Open v2.08c, rtc_15xx.h Chip_RTC_ClearStatus does nothing</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/Bug-Report-LPC-Open-v2-08c-rtc-15xx-h-Chip-RTC-ClearStatus-does/m-p/538537#M6074</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by frh on Fri Jun 12 21:29:20 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I had trouble with the code for the rtc example project. In the course of digging through the code and the UM I noticed that the code for the functions [u]Chip_RTC_GetStatus[/u] and [u]Chip_RTC_ClearStatus[/u] are identical and only return the value of the CTRL register. The example code should still work in spite of this because it clears bit's that are already 0 and are set later to 1 before the RTC is enabled.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Shouldn't ClearStatus do something like the following&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; pRTC-&amp;gt;CTRL &amp;amp;= ~stsMask;
&amp;nbsp;&amp;nbsp;&amp;nbsp; pRTC-&amp;gt;CTRL |= stsMask &amp;amp; RTC_CTRL_OFD;&amp;nbsp;&amp;nbsp; // must write a 1 to clear this bit
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;prior to the return?&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Jun 2016 00:26:50 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-16T00:26:50Z</dc:date>
    <item>
      <title>Bug Report: LPC_Open v2.08c, rtc_15xx.h Chip_RTC_ClearStatus does nothing</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Bug-Report-LPC-Open-v2-08c-rtc-15xx-h-Chip-RTC-ClearStatus-does/m-p/538537#M6074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by frh on Fri Jun 12 21:29:20 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I had trouble with the code for the rtc example project. In the course of digging through the code and the UM I noticed that the code for the functions [u]Chip_RTC_GetStatus[/u] and [u]Chip_RTC_ClearStatus[/u] are identical and only return the value of the CTRL register. The example code should still work in spite of this because it clears bit's that are already 0 and are set later to 1 before the RTC is enabled.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Shouldn't ClearStatus do something like the following&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; pRTC-&amp;gt;CTRL &amp;amp;= ~stsMask;
&amp;nbsp;&amp;nbsp;&amp;nbsp; pRTC-&amp;gt;CTRL |= stsMask &amp;amp; RTC_CTRL_OFD;&amp;nbsp;&amp;nbsp; // must write a 1 to clear this bit
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;prior to the return?&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 00:26:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Bug-Report-LPC-Open-v2-08c-rtc-15xx-h-Chip-RTC-ClearStatus-does/m-p/538537#M6074</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T00:26:50Z</dc:date>
    </item>
    <item>
      <title>Re: Bug Report: LPC_Open v2.08c, rtc_15xx.h Chip_RTC_ClearStatus does nothing</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Bug-Report-LPC-Open-v2-08c-rtc-15xx-h-Chip-RTC-ClearStatus-does/m-p/538538#M6075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by 1234567890 on Sun Jun 14 03:09:47 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: frh&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; pRTC-&amp;gt;CTRL &amp;amp;= ~stsMask;
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What will happen here to the flags that are set in the register but not in stsMask?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 00:26:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Bug-Report-LPC-Open-v2-08c-rtc-15xx-h-Chip-RTC-ClearStatus-does/m-p/538538#M6075</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T00:26:51Z</dc:date>
    </item>
    <item>
      <title>Re: Bug Report: LPC_Open v2.08c, rtc_15xx.h Chip_RTC_ClearStatus does nothing</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Bug-Report-LPC-Open-v2-08c-rtc-15xx-h-Chip-RTC-ClearStatus-does/m-p/538539#M6076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by frh on Mon Jun 15 21:49:35 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the hint! Obviously I hadn't read the data sheet closely enough. I don't have a way to test this at the moment, but I think this should do it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;STATIC INLINE uint32_t Chip_RTC_ClearStatus(LPC_RTC_T *pRTC, uint32_t stsMask)
{
&amp;nbsp;&amp;nbsp; pRTC-&amp;gt;CTRL &amp;amp;= (stsMask ^ 0xf1);&amp;nbsp; 
&amp;nbsp;&amp;nbsp; return pRTC-&amp;gt;CTRL;
}&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 00:26:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Bug-Report-LPC-Open-v2-08c-rtc-15xx-h-Chip-RTC-ClearStatus-does/m-p/538539#M6076</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T00:26:52Z</dc:date>
    </item>
    <item>
      <title>Re: Bug Report: LPC_Open v2.08c, rtc_15xx.h Chip_RTC_ClearStatus does nothing</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Bug-Report-LPC-Open-v2-08c-rtc-15xx-h-Chip-RTC-ClearStatus-does/m-p/538540#M6077</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by starblue on Tue Jun 16 04:51:17 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;You need to write a 1 for each status bit to clear, but protect bits 4 to 7 from changes. SWRESET (bit 0) is assumed to be 0. It is not specified what to do with the reserved bits, let's assume it is OK to write zeros.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So taking into account the comment it should probably be like this (untested, please test yourself):&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;/**
 * @briefClears latched RTC statuses
 * @parampRTC: The base address of RTC block
 * @paramstsMask: OR'ed status bits to clear
 * @returnNothing
 * @noteUse and OR'ed stsMask value of RTC_CTRL_OFD, RTC_CTRL_ALARM1HZ,
 *and RTC_CTRL_WAKE1KHZ to clear specific RTC states.
 */
STATIC INLINE void Chip_RTC_ClearStatus(LPC_RTC_T *pRTC, uint32_t stsMask)
{
&amp;nbsp;&amp;nbsp; pRTC-&amp;gt;CTRL = stsMask | (pRTC-&amp;gt;CTRL &amp;amp; 0xf0);
}&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 00:26:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Bug-Report-LPC-Open-v2-08c-rtc-15xx-h-Chip-RTC-ClearStatus-does/m-p/538540#M6077</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T00:26:52Z</dc:date>
    </item>
  </channel>
</rss>

