<?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>MQX Software Solutionsのトピック_timer_start_oneshot_at_ticks usage</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/timer-start-oneshot-at-ticks-usage/m-p/195820#M4041</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm having a problem using the _timer_start_oneshot_at_ticks function. For my application I need to set a timer to count a certain amount of time and call a function only once. For this I'm calling _timer_start_oneshot_at_ticks and everything seems to work ok at the beginning.&lt;/P&gt;&lt;P&gt;The problem is that I need to repeat this operation for an unlimited number of times but it seems that every time I call _timer_start_oneshot_at_ticks, the return value of the function increases like if a new timer is created every time the function is called, and after a certain amount of time the _timer_start_oneshot_at_ticks starts returning TIMER_NULL_ID.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any idea of how to turnaround this problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 01 Apr 2011 20:38:51 GMT</pubDate>
    <dc:creator>Paleantrop</dc:creator>
    <dc:date>2011-04-01T20:38:51Z</dc:date>
    <item>
      <title>_timer_start_oneshot_at_ticks usage</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/timer-start-oneshot-at-ticks-usage/m-p/195820#M4041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm having a problem using the _timer_start_oneshot_at_ticks function. For my application I need to set a timer to count a certain amount of time and call a function only once. For this I'm calling _timer_start_oneshot_at_ticks and everything seems to work ok at the beginning.&lt;/P&gt;&lt;P&gt;The problem is that I need to repeat this operation for an unlimited number of times but it seems that every time I call _timer_start_oneshot_at_ticks, the return value of the function increases like if a new timer is created every time the function is called, and after a certain amount of time the _timer_start_oneshot_at_ticks starts returning TIMER_NULL_ID.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any idea of how to turnaround this problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Apr 2011 20:38:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/timer-start-oneshot-at-ticks-usage/m-p/195820#M4041</guid>
      <dc:creator>Paleantrop</dc:creator>
      <dc:date>2011-04-01T20:38:51Z</dc:date>
    </item>
    <item>
      <title>Re: _timer_start_oneshot_at_ticks usage</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/timer-start-oneshot-at-ticks-usage/m-p/195821#M4042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="Helvetica-Bold" size="4"&gt;&lt;FONT face="Helvetica-Bold" size="4"&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;timer_cancel ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Apr 2011 03:17:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/timer-start-oneshot-at-ticks-usage/m-p/195821#M4042</guid>
      <dc:creator>boogy</dc:creator>
      <dc:date>2011-04-02T03:17:28Z</dc:date>
    </item>
    <item>
      <title>Re: _timer_start_oneshot_at_ticks usage</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/timer-start-oneshot-at-ticks-usage/m-p/195822#M4043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for reply. I've tried with _timer_cancel but no succes. Any other idea?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 Apr 2011 19:58:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/timer-start-oneshot-at-ticks-usage/m-p/195822#M4043</guid>
      <dc:creator>Paleantrop</dc:creator>
      <dc:date>2011-04-03T19:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: _timer_start_oneshot_at_ticks usage</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/timer-start-oneshot-at-ticks-usage/m-p/195823#M4044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have investigated more deeply the &lt;STRONG&gt;&lt;EM&gt;_timer_cancel&lt;/EM&gt;&lt;/STRONG&gt; function and I have the following problem : I step into the function (id is 1 as I was expecting..&amp;nbsp; - see attached screenshot 1) , then the &lt;EM&gt;timer_component_ptr&lt;/EM&gt; is created and I am not sure that the "SIZE" from ELAPSED_TIMER_ENTRIES should be "0" (see screenshot2). In the end the function is returning MQX_INVALID_PARAMETER (see screenshot 3). I tried to find a solution debugging this issue, but no success, even that I passed the correct parameter to the function.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyone of you can help, please ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Apr 2011 22:41:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/timer-start-oneshot-at-ticks-usage/m-p/195823#M4044</guid>
      <dc:creator>Paleantrop</dc:creator>
      <dc:date>2011-04-04T22:41:48Z</dc:date>
    </item>
    <item>
      <title>Re: _timer_start_oneshot_at_ticks usage</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/timer-start-oneshot-at-ticks-usage/m-p/195824#M4045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is this enabled in your BSP?&lt;/P&gt;&lt;P&gt;#define MQX_USE_TIMER 1&lt;/P&gt;&lt;P&gt;Your handle should be a memory location not 1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Apr 2011 22:15:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/timer-start-oneshot-at-ticks-usage/m-p/195824#M4045</guid>
      <dc:creator>boogy</dc:creator>
      <dc:date>2011-04-05T22:15:27Z</dc:date>
    </item>
    <item>
      <title>Re: _timer_start_oneshot_at_ticks usage</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/timer-start-oneshot-at-ticks-usage/m-p/195825#M4046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, MQX_USE_TIMER is set to 1 in BSP...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Apr 2011 22:26:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/timer-start-oneshot-at-ticks-usage/m-p/195825#M4046</guid>
      <dc:creator>Paleantrop</dc:creator>
      <dc:date>2011-04-05T22:26:47Z</dc:date>
    </item>
    <item>
      <title>Re: _timer_start_oneshot_at_ticks usage</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/timer-start-oneshot-at-ticks-usage/m-p/195826#M4047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Paleantrop,&lt;/P&gt;&lt;P&gt;Have you created the timer module before calling the timer function?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; error = _timer_create_component(TIMER_DEFAULT_TASK_PRIORITY,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TIMER_DEFAULT_STACK_SIZE);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you create reduced code snippet and post?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Apr 2011 23:29:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/timer-start-oneshot-at-ticks-usage/m-p/195826#M4047</guid>
      <dc:creator>DavidS</dc:creator>
      <dc:date>2011-04-05T23:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: _timer_start_oneshot_at_ticks usage</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/timer-start-oneshot-at-ticks-usage/m-p/195827#M4048</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;if (_timer_create_component(TIMER_DEFAULT_TASK_PRIORITY, TIMER_DEFAULT_STACK_SIZE)!= MQX_OK)  {     _mqx_exit(1);   }   while(TRUE)  {     req = _mem_alloc((_mem_size)sizeof(uchar));      nBytes =3;         req = data;       uart2_timer = (80000 * nBytes  / 1152) / 250;   uart2_timer += 2;   uart2_timer = uart2_timer * 250;    _time_init_ticks(&amp;amp;ticks, 0);   _time_init_ticks(&amp;amp;dticks, 0);    SetEnable();  for(i=0;i&amp;lt;nBytes;i++)      write(uart2_ptr,(char_ptr)req + i,1);      _time_get_elapsed_ticks(&amp;amp;ticks);    _time_add_usec_to_ticks(&amp;amp;ticks,uart2_timer);    _time_add_usec_to_ticks(&amp;amp;dticks,uart2_timer);     com_timer = _timer_start_oneshot_at_ticks(check_uart_timer, 0, TIMER_ELAPSED_TIME_MODE, &amp;amp;dticks);

_time_delay(50);
&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your answer.&lt;/P&gt;&lt;P&gt;As you can see I have initialized the &lt;EM&gt;_timer_component&lt;/EM&gt; and the &lt;EM&gt;_timer_cancel&lt;/EM&gt; function is called inside &lt;EM&gt;check_uart_timer&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;Do you have any other idea?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:51:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/timer-start-oneshot-at-ticks-usage/m-p/195827#M4048</guid>
      <dc:creator>Paleantrop</dc:creator>
      <dc:date>2020-10-29T09:51:01Z</dc:date>
    </item>
    <item>
      <title>Re: _timer_start_oneshot_at_ticks usage</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/timer-start-oneshot-at-ticks-usage/m-p/195828#M4049</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think the timer is not canceled within the callback because it's not in the context of task that created it.&lt;/P&gt;&lt;P&gt;So I suggest to cancel the timer before you're going to use it again in your task.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;PetrM&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 May 2011 20:39:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/timer-start-oneshot-at-ticks-usage/m-p/195828#M4049</guid>
      <dc:creator>PetrM</dc:creator>
      <dc:date>2011-05-20T20:39:15Z</dc:date>
    </item>
  </channel>
</rss>

