<?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 lwtimer in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/lwtimer/m-p/200362#M4423</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 need some explanation on how &lt;STRONG&gt;lwtimer&lt;/STRONG&gt; works. I don't find examples in MQX directories about this, MQXRM and MQXUG are pretty poor too.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Emmanuel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Apr 2011 20:24:54 GMT</pubDate>
    <dc:creator>Nouchi</dc:creator>
    <dc:date>2011-04-20T20:24:54Z</dc:date>
    <item>
      <title>lwtimer</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/lwtimer/m-p/200362#M4423</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 need some explanation on how &lt;STRONG&gt;lwtimer&lt;/STRONG&gt; works. I don't find examples in MQX directories about this, MQXRM and MQXUG are pretty poor too.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Emmanuel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Apr 2011 20:24:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/lwtimer/m-p/200362#M4423</guid>
      <dc:creator>Nouchi</dc:creator>
      <dc:date>2011-04-20T20:24:54Z</dc:date>
    </item>
    <item>
      <title>Re: lwtimer</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/lwtimer/m-p/200363#M4424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Emmanuel,&lt;/P&gt;&lt;P&gt;Example below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#include &amp;lt;mqx.h&amp;gt;&lt;BR /&gt;#include &amp;lt;bsp.h&amp;gt;&lt;BR /&gt;#include &amp;lt;fio.h&amp;gt;&lt;BR /&gt;#include &amp;lt;lwtimer.h&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;#if ! BSPCFG_ENABLE_IO_SUBSYSTEM&lt;BR /&gt;#error This application requires BSPCFG_ENABLE_IO_SUBSYSTEM defined non-zero in user_config.h. Please recompile BSP with this option.&lt;BR /&gt;#endif&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;#ifndef BSP_DEFAULT_IO_CHANNEL_DEFINED&lt;BR /&gt;#error This application requires BSP_DEFAULT_IO_CHANNEL to be not NULL. Please set corresponding BSPCFG_ENABLE_TTYx to non-zero in user_config.h and recompile BSP with this option.&lt;BR /&gt;#endif&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/*&amp;nbsp; This example calls _timer_create_component before it activates the&lt;BR /&gt;**&amp;nbsp; timers so that the application can specify the timer task stack size.&lt;BR /&gt;**&amp;nbsp; The stack size may need to be larger than the TIMER_DEFAULT_STACK_SIZE&lt;BR /&gt;**&amp;nbsp; that is defined in timer.h, since the application's handler function uses&lt;BR /&gt;**&amp;nbsp; this stack. In this example, the handlers are LED_on and LED_off,&lt;BR /&gt;**&amp;nbsp; which have large stack requirements. You may need to increase the stack size&lt;BR /&gt;**&amp;nbsp; for your target hardware.&lt;BR /&gt;*/&lt;BR /&gt;#define LWTIMER_TASK_PRIORITY&amp;nbsp; 2&lt;BR /&gt;#define LWTIMER_STACK_SIZE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2000&lt;/P&gt;&lt;P&gt;#define MAIN_TASK&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10&lt;/P&gt;&lt;P&gt;extern void main_task(uint_32);&lt;BR /&gt;extern void LED_on(void);&lt;BR /&gt;extern void LED_off(void);&lt;BR /&gt;volatile _mqx_uint LED_on_counter=0;&lt;BR /&gt;volatile _mqx_uint LED_off_counter=0;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;const TASK_TEMPLATE_STRUCT&amp;nbsp; MQX_template_list[] =&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; /* Task Index, Function,&amp;nbsp;&amp;nbsp; Stack, Priority,&amp;nbsp; Name,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Attributes,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Param, Time Slice */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; { MAIN_TASK,&amp;nbsp; main_task,&amp;nbsp; 2000,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Main",&amp;nbsp;&amp;nbsp; MQX_AUTO_START_TASK, 0,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 },&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; { 0 }&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;/*FUNCTION*------------------------------------------------------&lt;BR /&gt;*&lt;BR /&gt;* Function Name&amp;nbsp; : LED_on&lt;BR /&gt;* Returned Value : none&lt;BR /&gt;* Comments&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; :&lt;BR /&gt;*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; This timer function prints out "ON"&lt;BR /&gt;*END*-----------------------------------------------------------*/&lt;BR /&gt;static void LED_on&lt;BR /&gt;&amp;nbsp;&amp;nbsp; (&lt;BR /&gt;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; LED_on_counter++;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/*FUNCTION*------------------------------------------------------&lt;BR /&gt;*&lt;BR /&gt;* Function Name&amp;nbsp; : LED_off&lt;BR /&gt;* Returned Value : none&lt;BR /&gt;* Comments&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; :&lt;BR /&gt;*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; This timer function prints out "OFF"&lt;BR /&gt;*END*-----------------------------------------------------------*/&lt;BR /&gt;static void LED_off&lt;BR /&gt;&amp;nbsp;&amp;nbsp; (&lt;BR /&gt;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; LED_off_counter++;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/*TASK*----------------------------------------------------------&lt;BR /&gt;*&lt;BR /&gt;* Task Name : main_task&lt;BR /&gt;* Comments&amp;nbsp; :&lt;BR /&gt;*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; This task creates two timers, each of a period of 2 seconds,&lt;BR /&gt;*&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; the second timer offset by 1 second from the first.&lt;BR /&gt;*END*-----------------------------------------------------------*/&lt;/P&gt;&lt;P&gt;void main_task&lt;BR /&gt;&amp;nbsp;&amp;nbsp; (&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uint_32 initial_data&lt;BR /&gt;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; LWTIMER_PERIOD_STRUCT ps;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; LWTIMER_STRUCT lst_on, lst_off;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; _mqx_uint time=20;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; _mqx_uint period=6;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; _mqx_uint wait_ticks=0;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; _mqx_uint delay_on=3;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; _mqx_uint delay_off=3;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; printf("\n\nTwo lwtimers are created, each of a period of %d ticks,\nthe second lwtimer offset by %d ticks from the first.\n", period, delay_off);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; printf("Task runs for %d seconds,\nthen lwtimers are closed and task finishes.\n\n", time);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; /*&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ** Create the lwtimer component with more stack than the default&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ** in order to handle printf() requirements:&lt;BR /&gt;&amp;nbsp;&amp;nbsp; */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; _lwtimer_create_periodic_queue(&amp;amp;ps, period, wait_ticks);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; _lwtimer_add_timer_to_queue(&amp;amp;ps, &amp;amp;lst_on, delay_on, LED_on, 0);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; _lwtimer_add_timer_to_queue(&amp;amp;ps, &amp;amp;lst_off, delay_off, LED_off, 0);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; _time_delay(time * 1000); // wait 6 seconds&lt;BR /&gt;&amp;nbsp;&amp;nbsp; printf("\nThe task is finished!");&lt;BR /&gt;&amp;nbsp;&amp;nbsp; printf("\nLED_on_counter = %d&amp;nbsp;LED_off_counter = %d", LED_on_counter, LED_off_counter);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; _lwtimer_cancel_period(&amp;amp;ps);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; _mqx_exit(0);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;/* EOF */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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>Wed, 20 Apr 2011 21:26:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/lwtimer/m-p/200363#M4424</guid>
      <dc:creator>DavidS</dc:creator>
      <dc:date>2011-04-20T21:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: lwtimer</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/lwtimer/m-p/200364#M4425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks David, good example........&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Apr 2011 22:03:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/lwtimer/m-p/200364#M4425</guid>
      <dc:creator>Nouchi</dc:creator>
      <dc:date>2011-04-20T22:03:16Z</dc:date>
    </item>
    <item>
      <title>Re: lwtimer</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/lwtimer/m-p/200365#M4426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm confused by your example.&amp;nbsp; First, I couldn't get it to compile unless I cast the LED functions as &lt;SPAN style="color: #005032; font-size: 10pt;"&gt;LWTIMER_ISR_FPTR&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;) LED_on &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;and &lt;/SPAN&gt;&lt;SPAN style="color: #005032; font-size: 10pt;"&gt;LWTIMER_ISR_FPTR&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;) LED_off.&amp;nbsp; I assume this is because of additional error checking in the compiler 3 years later.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Next, I still can't figure out the difference between the argument "period" in the create function and the arguments delay_on and delay_off in the add timer functions.&amp;nbsp; delay_on and delay_off have to be smaller than period, but how does this work?&amp;nbsp; Just what is being created when you create a queue?&amp;nbsp; What actually is happening when you add a timer?&amp;nbsp; Are these timers continuously running?&amp;nbsp; I would not think so, but then why would you be incrementing counters in the callbacks?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;What I need to do is create a one-shot timer with a programmable period in msec.&amp;nbsp; The range might be 50 to 15000 msec.&amp;nbsp; What would I use for your period and delay_on or delay_off arguments?&amp;nbsp; (The tick is 1 msec I believe.)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Dave&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jul 2014 22:50:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/lwtimer/m-p/200365#M4426</guid>
      <dc:creator>d_</dc:creator>
      <dc:date>2014-07-29T22:50:16Z</dc:date>
    </item>
    <item>
      <title>Re: lwtimer</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/lwtimer/m-p/200366#M4427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Experimenting, I set the period argument in the create function to 100 and the ticks argument in the add function to 3.&amp;nbsp; I see that I get a periodic interrupt every 500 msec.&amp;nbsp; I thought the timer was based on 1 msec, but now see that it is based on a 5 msec period.&amp;nbsp; So the period of 100 gives a continuous periodic callback every 500 msec.&amp;nbsp; OK.&amp;nbsp; That makes sense.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm still confused by what the ticks = 3 does.&amp;nbsp; I'll keep investigating.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dave&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jul 2014 23:44:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/lwtimer/m-p/200366#M4427</guid>
      <dc:creator>d_</dc:creator>
      <dc:date>2014-07-29T23:44:10Z</dc:date>
    </item>
    <item>
      <title>Re: lwtimer</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/lwtimer/m-p/200367#M4428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Setting ticks = 50 with period = 100 doesn't seem to have any affect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm guessing that the ticks is a delay from the timer trigger to the callback.&amp;nbsp; So for a one-shot timer I would set ticks to zero.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dave&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jul 2014 00:16:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/lwtimer/m-p/200367#M4428</guid>
      <dc:creator>d_</dc:creator>
      <dc:date>2014-07-30T00:16:58Z</dc:date>
    </item>
    <item>
      <title>Re: Re: lwtimer</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/lwtimer/m-p/200368#M4429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;Hi Dave,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Calibri;"&gt;&lt;SPAN style="color: #000000; font-size: 12pt;"&gt;Sorry for delay.&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 12pt;"&gt;I have returned from PTO and fought off the avalanche of emails now.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Calibri;"&gt;&lt;SPAN style="color: #000000; font-size: 12pt;"&gt;I'm not clear on exactly what you want your application to do.&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 12pt;"&gt;Let me state what I interpret and please correct me.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Calibri;"&gt;&lt;SPAN style="color: #000000; font-size: 12pt;"&gt;You want to control a GPIO pin/signal.&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 12pt;"&gt;Correct?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Calibri;"&gt;&lt;SPAN style="color: #000000; font-size: 12pt;"&gt;If yes, then you want to be able to control having it toggle at a rate of 50-15,000msec.&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 12pt;"&gt;Correct?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;If yes, then my question is how long to you want that toggle rate to last (i.e. when should the toggling be disabled)?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;A different implementation that might be better for your application is to use following:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #642880; font-size: 10pt; background: silver; font-family: Consolas;"&gt;&lt;STRONG&gt;_timer_start_periodic_every&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-family: Consolas; font-size: 10pt;"&gt; (LED_toggle,NULL,TIMER_KERNEL_TIME_MODE,50);&amp;nbsp;&amp;nbsp; //DES timer task created and LED_toggle function called every 50msec&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #642880; font-size: 10pt; background: silver; font-family: Consolas;"&gt;&lt;STRONG&gt;_timer_start_oneshot_after&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: Consolas; font-size: 10pt;"&gt;(LED_toggle,NULL,TIMER_KERNEL_TIME_MODE,5);&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-family: Consolas; font-size: 10pt;"&gt;//DES LED_toggle executed once each while(TRUE) loop ...need some delay 5 or greater to work.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Calibri;"&gt;&lt;SPAN style="color: #000000; font-size: 12pt;"&gt;I’m attaching my MQX4.1 “C” file that I have used to play with this and it is part of the web_hvac example.&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 12pt;"&gt;In the code you can search for “//DES” to see where I have made modifications and added the LED_toggle callback function.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Calibri; font-size: 12pt;"&gt;David&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Aug 2014 14:07:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/lwtimer/m-p/200368#M4429</guid>
      <dc:creator>DavidS</dc:creator>
      <dc:date>2014-08-01T14:07:34Z</dc:date>
    </item>
    <item>
      <title>Re: Re: lwtimer</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/lwtimer/m-p/200369#M4430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I figured out the lwtimer.&amp;nbsp; Documentation could be better.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the tip on the periodic and one-shot timers.&amp;nbsp; I'm new to MQX and was steered away from using these for reasons I don't understand.&amp;nbsp; I tried the one-shot and it works fine.&amp;nbsp; I don't believe it can have any negative affects on the system (mostly a concern as to how it would affect PEG usage).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dave&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Aug 2014 18:45:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/lwtimer/m-p/200369#M4430</guid>
      <dc:creator>d_</dc:creator>
      <dc:date>2014-08-01T18:45:09Z</dc:date>
    </item>
    <item>
      <title>Re: Re: lwtimer</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/lwtimer/m-p/200370#M4431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dave,&lt;/P&gt;&lt;P&gt;The oneshot basically is creating a very high priority timer task that will pre-empt the RTOS like an "interrupt" does and then return back the code base.&amp;nbsp; So the rule of thumb is to treat any code within the defined callback as interrupt code (i.e. do not call anything that could block).&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>Fri, 01 Aug 2014 19:11:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/lwtimer/m-p/200370#M4431</guid>
      <dc:creator>DavidS</dc:creator>
      <dc:date>2014-08-01T19:11:13Z</dc:date>
    </item>
    <item>
      <title>Re: Re: lwtimer</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/lwtimer/m-p/200371#M4432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, thanks David.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dave&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Aug 2014 19:13:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/lwtimer/m-p/200371#M4432</guid>
      <dc:creator>d_</dc:creator>
      <dc:date>2014-08-01T19:13:29Z</dc:date>
    </item>
    <item>
      <title>Re: lwtimer</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/lwtimer/m-p/200372#M4433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it practical to do a constant loop with this function ? i.e. doing a constant LED_off and LED_on using this lwtimer function?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently, I am using lwevent_wait_ticks timeout for a periodic function. I am looking for a function which calls a specific function say every 10 msec.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry if my question is too specific.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Oct 2014 21:59:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/lwtimer/m-p/200372#M4433</guid>
      <dc:creator>kaustubhkagalka</dc:creator>
      <dc:date>2014-10-16T21:59:04Z</dc:date>
    </item>
    <item>
      <title>Re: lwtimer</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/lwtimer/m-p/200373#M4434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kaustubh,&lt;/P&gt;&lt;P&gt;The following timer routine would work:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas; color: #642880; background: silver;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;_timer_start_periodic_every&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3f7f5f; font-family: Consolas; font-size: 10pt; line-height: 1.5em;"&gt;(specific_function,NULL,TIMER_KERNEL_TIME_MODE,10);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3f7f5f; font-family: Consolas; font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3f7f5f; font-family: Consolas; font-size: 10pt; line-height: 1.5em;"&gt;This would setup a timer task that will execute/call the specific_function() every 10msec.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3f7f5f; font-family: Consolas; font-size: 10pt; line-height: 1.5em;"&gt;You do have to be careful that the function it is calling is short and non-blocking. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3f7f5f; font-family: Consolas; font-size: 10pt; line-height: 1.5em;"&gt;The timer task operates at a very high priority level (2 I think).&amp;nbsp; It basically is preempting the RTOS.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3f7f5f; font-family: Consolas; font-size: 10pt; line-height: 1.5em;"&gt;If the function you want to call is "big" and/or calls blocking API, then best to keep it setup that way you have implemented.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3f7f5f; font-family: Consolas; font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3f7f5f; font-family: Consolas; font-size: 10pt; line-height: 1.5em;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3f7f5f; font-family: Consolas; font-size: 10pt; line-height: 1.5em;"&gt;David &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Oct 2014 18:26:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/lwtimer/m-p/200373#M4434</guid>
      <dc:creator>DavidS</dc:creator>
      <dc:date>2014-10-23T18:26:16Z</dc:date>
    </item>
    <item>
      <title>Re: lwtimer</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/lwtimer/m-p/200374#M4435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using this particular task to print a debug-buffer array via UART, so it is definitely not short or high priority, so I think I will stick with my current implementation. But I will definitely try this somewhere else.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kaustubh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Oct 2014 20:22:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/lwtimer/m-p/200374#M4435</guid>
      <dc:creator>kaustubhkagalka</dc:creator>
      <dc:date>2014-10-23T20:22:14Z</dc:date>
    </item>
    <item>
      <title>Re: lwtimer</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/lwtimer/m-p/200375#M4436</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;Hi David!&lt;BR /&gt;I don't know if this topic is right , but I can not find much information about the lwtimer communities , etc.&lt;BR /&gt;I'm using a MK24FN1M0VLQ12 Kinetis , and the KDS KSDK 1.3 development platform.&lt;BR /&gt;&lt;BR /&gt;Do the procedure , you quoted above ( had done in Code Warrior and worked perfectly ), but the KDS does not work , the system hangs .&lt;BR /&gt;Do you have any tips or information to help me ?&lt;BR /&gt;&lt;BR /&gt;Thank you very much in advance!&lt;BR /&gt;Hug!&lt;BR /&gt;&lt;BR /&gt;Att .&lt;BR /&gt;Lucas Dias&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Apr 2016 13:23:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/lwtimer/m-p/200375#M4436</guid>
      <dc:creator>lucasdias</dc:creator>
      <dc:date>2016-04-07T13:23:14Z</dc:date>
    </item>
    <item>
      <title>Re: lwtimer</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/lwtimer/m-p/200376#M4437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Lucas,&lt;/P&gt;&lt;P&gt;I have not tried this with KSDK_1.3.&lt;/P&gt;&lt;P&gt;Documentation: C:\Freescale\KSDK_1.3.0\doc\rtos\mqx\MQX RTOS Reference Manual.pdf &lt;/P&gt;&lt;P&gt;You can tryC:\Freescale\KSDK_1.3.0\rtos\mqx\mqx\examples\timer\build\kds\timer_twrk24f120m .&lt;/P&gt;&lt;P&gt;Assuming this works fine I would then modify it for the lwtimer capability.&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>Fri, 08 Apr 2016 14:10:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/lwtimer/m-p/200376#M4437</guid>
      <dc:creator>DavidS</dc:creator>
      <dc:date>2016-04-08T14:10:01Z</dc:date>
    </item>
    <item>
      <title>Re: lwtimer</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/lwtimer/m-p/200377#M4438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;Ok David !&lt;BR /&gt;Thanks for the feedback! I will check these documents.&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Lucas Dias&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Apr 2016 14:43:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/lwtimer/m-p/200377#M4438</guid>
      <dc:creator>lucasdias</dc:creator>
      <dc:date>2016-04-08T14:43:44Z</dc:date>
    </item>
  </channel>
</rss>

