<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Is there a way creating user defined tasks on nRF9160</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/58134/is-there-a-way-creating-user-defined-tasks-on-nrf9160</link><description>Hi, 
 Creating an new app will only call the main() in the form of task, i have requirement to create couple of task in my main() so is it possible to create user defined tasks? 
 
 regards 
 KK</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 02 Mar 2020 13:18:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/58134/is-there-a-way-creating-user-defined-tasks-on-nrf9160" /><item><title>RE: Is there a way creating user defined tasks on nRF9160</title><link>https://devzone.nordicsemi.com/thread/237452?ContentTypeID=1</link><pubDate>Mon, 02 Mar 2020 13:18:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3e865d37-fd76-4311-9d47-e169960f60db</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;quot;main&amp;quot; is a thread, and you can omit it by not having it defined in your project, as shown in the basic thread sample.&lt;/p&gt;
&lt;p&gt;Or you can keep it, and the system will automatically define it as a thread. Its up to you.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The parameters and priorities are&amp;nbsp;set when defining a thread, as shown in the sample and the documentation that I previously linked to.&lt;/p&gt;
&lt;p&gt;Could you please clarify what the issue is?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there a way creating user defined tasks on nRF9160</title><link>https://devzone.nordicsemi.com/thread/237433?ContentTypeID=1</link><pubDate>Mon, 02 Mar 2020 12:33:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e4a8312b-c288-4a2a-9014-950826299832</guid><dc:creator>Lorenzo Amicucci</dc:creator><description>&lt;p&gt;Hi H&amp;aring;kan,&amp;nbsp;&lt;br /&gt;KK is asking:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;quot;I have gone through your reply in DevZone I am yet to build an application which give me confidence in creating tasks.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;ul&gt;
&lt;li&gt;If I understand correctly the application main() is also spawned as task, &amp;nbsp;if that&amp;rsquo;s the case for my requirement I need to create few more tasks in parallel with desired priorities. &amp;quot;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;Can you please comment?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Is there a way creating user defined tasks on nRF9160</title><link>https://devzone.nordicsemi.com/thread/235871?ContentTypeID=1</link><pubDate>Mon, 24 Feb 2020 08:10:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4519017e-2f71-4a28-831e-a301c0fd75a4</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi KK,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]Creating an new app will only call the main() in the form of task, i have requirement to create couple of task in my main() so is it possible to create user defined tasks?[/quote]
&lt;p&gt;&amp;nbsp;In zephyr, you can declare threads as described here:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.zephyrproject.org/latest/reference/kernel/threads/index.html"&gt;https://docs.zephyrproject.org/latest/reference/kernel/threads/index.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s an example:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/NordicPlayground/fw-nrfconnect-zephyr/blob/master/samples/basic/threads/src/main.c"&gt;https://github.com/NordicPlayground/fw-nrfconnect-zephyr/blob/master/samples/basic/threads/src/main.c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>