<?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: freertos</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/freertos/m-p/1498525#M49732</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I think in the task loop, you have to have the code to block the task for example:&lt;/P&gt;
&lt;PRE style="font-size: 16px; font-weight: bold; line-height: normal; color: #202020; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"&gt;&lt;FONT face="courier"&gt;void vTaskFunction( void * pvParameters )
 {
 &lt;FONT color="green"&gt;/* Block for 500ms. */&lt;/FONT&gt;
 const TickType_t xDelay = 500 / portTICK_PERIOD_MS;

     for( ;; )
     {
         &lt;FONT color="green"&gt;/* Simply toggle the LED every 500ms, blocking between each toggle. */&lt;/FONT&gt;
         vToggleLED();
         vTaskDelay( xDelay );
     }
}&lt;BR /&gt;The line  vTaskDelay( xDelay ); will block the task.&lt;BR /&gt;I think it is not okay using the code;&lt;BR /&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/PRE&gt;
&lt;PRE style="font-size: 16px; font-weight: bold; line-height: normal; color: #202020; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"&gt;&lt;FONT face="courier"&gt;void vTaskFunction( void * pvParameters )
 {
 &lt;FONT color="green"&gt;/* Block for 500ms. */&lt;/FONT&gt;
 const TickType_t xDelay = 500 / portTICK_PERIOD_MS;

     for( ;; )
     {
         &lt;FONT color="green"&gt;/* Simply toggle the LED every 500ms, blocking between each toggle. */&lt;/FONT&gt;
         vToggleLED();
        // vTaskDelay( xDelay );
     }
}&lt;BR /&gt;&lt;BR /&gt;Hope it can help you&lt;BR /&gt;BR&lt;BR /&gt;XiangJun Rong&lt;BR /&gt;&lt;/FONT&gt;&lt;/PRE&gt;
&lt;PRE style="font-size: 16px; font-weight: bold; line-height: normal; color: #202020; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"&gt;&amp;nbsp;&lt;/PRE&gt;</description>
    <pubDate>Mon, 01 Aug 2022 05:51:08 GMT</pubDate>
    <dc:creator>xiangjun_rong</dc:creator>
    <dc:date>2022-08-01T05:51:08Z</dc:date>
    <item>
      <title>freertos</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/freertos/m-p/1497648#M49723</link>
      <description>&lt;P&gt;在FreertosConfig.h的文件中有一个宏 ：#define configUSE_TIME_SLICING 1。它的含义是：&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;为1使能时间片调度。&lt;/SPAN&gt;&lt;SPAN&gt;（时间片调度是指每个进程被分配一个时间段,称作它的时间片,即该进程允许运行的时间。如果在时间片结束时进程还在运行,则CPU将被剥夺并分配给另一个进程。如果进程在时间片结束前阻塞或结束,则CPU当即进行切换。）&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;在配置文件中默认值为0，即不支持时间片轮转。我把这参数变为1，创建了两个相同优先级的任务，理想情况是这两个任务会交替执行。&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;但实验现象是：程序只运行其中一个任务，并且会在打印几次后死在哪里？&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;请问哪里有问题，还是需要更改其他额外的东西？&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="wangyibin_0-1659061438282.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/188359i4DDF7885907330C0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="wangyibin_0-1659061438282.png" alt="wangyibin_0-1659061438282.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="wangyibin_1-1659061515436.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/188360iB3E9178CD8F1C6C9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="wangyibin_1-1659061515436.png" alt="wangyibin_1-1659061515436.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="wangyibin_2-1659061530110.jpeg" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/188361iAA72AF1FB95074CE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="wangyibin_2-1659061530110.jpeg" alt="wangyibin_2-1659061530110.jpeg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 02:26:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/freertos/m-p/1497648#M49723</guid>
      <dc:creator>wangyibin</dc:creator>
      <dc:date>2022-07-29T02:26:41Z</dc:date>
    </item>
    <item>
      <title>Re: freertos</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/freertos/m-p/1498525#M49732</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I think in the task loop, you have to have the code to block the task for example:&lt;/P&gt;
&lt;PRE style="font-size: 16px; font-weight: bold; line-height: normal; color: #202020; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"&gt;&lt;FONT face="courier"&gt;void vTaskFunction( void * pvParameters )
 {
 &lt;FONT color="green"&gt;/* Block for 500ms. */&lt;/FONT&gt;
 const TickType_t xDelay = 500 / portTICK_PERIOD_MS;

     for( ;; )
     {
         &lt;FONT color="green"&gt;/* Simply toggle the LED every 500ms, blocking between each toggle. */&lt;/FONT&gt;
         vToggleLED();
         vTaskDelay( xDelay );
     }
}&lt;BR /&gt;The line  vTaskDelay( xDelay ); will block the task.&lt;BR /&gt;I think it is not okay using the code;&lt;BR /&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/PRE&gt;
&lt;PRE style="font-size: 16px; font-weight: bold; line-height: normal; color: #202020; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"&gt;&lt;FONT face="courier"&gt;void vTaskFunction( void * pvParameters )
 {
 &lt;FONT color="green"&gt;/* Block for 500ms. */&lt;/FONT&gt;
 const TickType_t xDelay = 500 / portTICK_PERIOD_MS;

     for( ;; )
     {
         &lt;FONT color="green"&gt;/* Simply toggle the LED every 500ms, blocking between each toggle. */&lt;/FONT&gt;
         vToggleLED();
        // vTaskDelay( xDelay );
     }
}&lt;BR /&gt;&lt;BR /&gt;Hope it can help you&lt;BR /&gt;BR&lt;BR /&gt;XiangJun Rong&lt;BR /&gt;&lt;/FONT&gt;&lt;/PRE&gt;
&lt;PRE style="font-size: 16px; font-weight: bold; line-height: normal; color: #202020; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"&gt;&amp;nbsp;&lt;/PRE&gt;</description>
      <pubDate>Mon, 01 Aug 2022 05:51:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/freertos/m-p/1498525#M49732</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2022-08-01T05:51:08Z</dc:date>
    </item>
  </channel>
</rss>

