<?xml version="1.0" encoding="utf-8"?>
<!-- generator="FeedCreator 1.7.2-ppt DokuWiki" -->
<?xml-stylesheet href="http://www.pic24.ru/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="http://www.pic24.ru/feed.php">
        <title>PIC24 en:osa:ref:services</title>
        <description></description>
        <link>http://www.pic24.ru/</link>
        <image rdf:resource="http://www.pic24.ru/lib/images/favicon.ico" />
       <dc:date>2023-02-11T03:47:35+03:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="http://www.pic24.ru/doku.php/en/osa/ref/services/alphabetical?rev=1276346093"/>
                <rdf:li rdf:resource="http://www.pic24.ru/doku.php/en/osa/ref/services/binary_semaphores?rev=1260572477"/>
                <rdf:li rdf:resource="http://www.pic24.ru/doku.php/en/osa/ref/services/brieflist?rev=1268225726"/>
                <rdf:li rdf:resource="http://www.pic24.ru/doku.php/en/osa/ref/services/counting_semaphores?rev=1260572439"/>
                <rdf:li rdf:resource="http://www.pic24.ru/doku.php/en/osa/ref/services/critical_sections?rev=1260572375"/>
                <rdf:li rdf:resource="http://www.pic24.ru/doku.php/en/osa/ref/services/flags?rev=1267250632"/>
                <rdf:li rdf:resource="http://www.pic24.ru/doku.php/en/osa/ref/services/intro?rev=1286445521"/>
                <rdf:li rdf:resource="http://www.pic24.ru/doku.php/en/osa/ref/services/mesage_queues?rev=1260572745"/>
                <rdf:li rdf:resource="http://www.pic24.ru/doku.php/en/osa/ref/services/messages?rev=1265042163"/>
                <rdf:li rdf:resource="http://www.pic24.ru/doku.php/en/osa/ref/services/system_services?rev=1260572268"/>
                <rdf:li rdf:resource="http://www.pic24.ru/doku.php/en/osa/ref/services/tasks?rev=1268225820"/>
                <rdf:li rdf:resource="http://www.pic24.ru/doku.php/en/osa/ref/services/timers?rev=1260572831"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="http://www.pic24.ru/lib/images/favicon.ico">
        <title>PIC24</title>
        <link>http://www.pic24.ru/</link>
        <url>http://www.pic24.ru/lib/images/favicon.ico</url>
    </image>
    <item rdf:about="http://www.pic24.ru/doku.php/en/osa/ref/services/alphabetical?rev=1276346093">
        <dc:format>text/html</dc:format>
        <dc:date>2010-06-12T16:34:53+03:00</dc:date>
        <title>OSA services in alphabetical order</title>
        <link>http://www.pic24.ru/doku.php/en/osa/ref/services/alphabetical?rev=1276346093</link>
        <description>


&lt;h1&gt;&lt;a name=&quot;osa_services_in_alphabetical_order&quot; id=&quot;osa_services_in_alphabetical_order&quot;&gt;OSA services in alphabetical order&lt;/a&gt;&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;OSA services in alphabetical order&quot; [1-50] --&gt;
&lt;h3&gt;&lt;a name=&quot;data_types&quot; id=&quot;data_types&quot;&gt;Data types&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/description/data_types#ost_uint8&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:description:data_types&quot;&gt;OST_UINT8&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/description/data_types#ost_uint16&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:description:data_types&quot;&gt;OST_UINT16&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/description/data_types#ost_uint32&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:description:data_types&quot;&gt;OST_UINT32&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/description/data_types#ost_word&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:description:data_types&quot;&gt;OST_WORD&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/description/data_types#ost_csem&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:description:data_types&quot;&gt;OST_CSEM&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/description/data_types#ost_dtimer&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:description:data_types&quot;&gt;OST_DTIMER&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/description/data_types#ost_flag&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:description:data_types&quot;&gt;OST_FLAG&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/description/data_types#ost_flag&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:description:data_types&quot;&gt;OST_FLAG8&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/description/data_types#ost_flag&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:description:data_types&quot;&gt;OST_FLAG16&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/description/data_types#ost_flag&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:description:data_types&quot;&gt;OST_FLAG32&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/description/data_types#ost_msg&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:description:data_types&quot;&gt;OST_MSG&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/description/data_types#ost_msg_cb&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:description:data_types&quot;&gt;OST_MSG_CB&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/description/data_types#ost_qtimer&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:description:data_types&quot;&gt;OST_QTIMER&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/description/data_types#ost_queue&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:description:data_types&quot;&gt;OST_QUEUE&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/description/data_types#ost_smsg&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:description:data_types&quot;&gt;OST_SMSG&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/description/data_types#ost_squeue&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:description:data_types&quot;&gt;OST_SQUEUE&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/description/data_types#ost_task_pointer&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:description:data_types&quot;&gt;OST_TASK_POINTER&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Data types&quot; [51-1209] --&gt;
&lt;h3&gt;&lt;a name=&quot;b&quot; id=&quot;b&quot;&gt;- B -&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_bsem_check&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_bsem_check&quot;&gt;OS_Bsem_Check&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_bsem_check&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_bsem_check&quot;&gt;OS_Bsem_Check_I&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_bsem_reset&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_bsem_reset&quot;&gt;OS_Bsem_Reset&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_bsem_reset&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_bsem_reset&quot;&gt;OS_Bsem_Reset_I&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_bsem_set&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_bsem_set&quot;&gt;OS_Bsem_Set&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_bsem_set&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_bsem_set&quot;&gt;OS_Bsem_Set_I&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_bsem_signal&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_bsem_signal&quot;&gt;OS_Bsem_Signal&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_bsem_signal&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_bsem_signal&quot;&gt;OS_Bsem_Signal_I&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_bsem_switch&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_bsem_switch&quot;&gt;OS_Bsem_Switch&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_bsem_switch&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_bsem_switch&quot;&gt;OS_Bsem_Switch_I&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_bsem_wait&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_bsem_wait&quot;&gt;OS_Bsem_Wait&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_bsem_wait_to&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_bsem_wait_to&quot;&gt;OS_Bsem_Wait_TO&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;- B -&quot; [1210-2004] --&gt;
&lt;h3&gt;&lt;a name=&quot;c&quot; id=&quot;c&quot;&gt;- C -&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_cond_wait&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_cond_wait&quot;&gt;OS_Cond_Wait&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_cond_wait_to&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_cond_wait_to&quot;&gt;OS_Cond_Wait_TO&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_csem_accept&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_csem_accept&quot;&gt;OS_Csem_Accept&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_csem_accept&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_csem_accept&quot;&gt;OS_Csem_Accept_I&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_csem_check&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_csem_check&quot;&gt;OS_Csem_Check&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_csem_check&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_csem_check&quot;&gt;OS_Csem_Check_I&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_csem_create&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_csem_create&quot;&gt;OS_Csem_Create&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_csem_reset&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_csem_reset&quot;&gt;OS_Csem_Reset&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_csem_reset&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_csem_reset&quot;&gt;OS_Csem_Reset_I&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_csem_set&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_csem_set&quot;&gt;OS_Csem_Set&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_csem_set&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_csem_set&quot;&gt;OS_Csem_Set_I&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_csem_setvalue&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_csem_setvalue&quot;&gt;OS_Csem_SetValue&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_csem_setvalue&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_csem_setvalue&quot;&gt;OS_Csem_SetValue_I&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_csem_signal&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_csem_signal&quot;&gt;OS_Csem_Signal&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_csem_signal_now&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_csem_signal_now&quot;&gt;OS_Csem_Signal_I&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_csem_signal_now&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_csem_signal_now&quot;&gt;OS_Csem_Signal_Now&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_csem_wait&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_csem_wait&quot;&gt;OS_Csem_Wait&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_csem_wait_to&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_csem_wait_to&quot;&gt;OS_Csem_Wait_TO&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;- C -&quot; [2005-3209] --&gt;
&lt;h3&gt;&lt;a name=&quot;d&quot; id=&quot;d&quot;&gt;- D -&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_di&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_di&quot;&gt;OS_DI&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_delay&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_delay&quot;&gt;OS_Delay&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_add&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_add&quot;&gt;OS_Dtimer_Add&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_break&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_break&quot;&gt;OS_Dtimer_Break&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_check&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_check&quot;&gt;OS_Dtimer_Check&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_continue&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_continue&quot;&gt;OS_Dtimer_Continue&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_create&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_create&quot;&gt;OS_Dtimer_Create&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_delay&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_delay&quot;&gt;OS_Dtimer_Delay&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_delete&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_delete&quot;&gt;OS_Dtimer_Delete&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_get&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_get&quot;&gt;OS_Dtimer_Get&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_isactive&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_isactive&quot;&gt;OS_Dtimer_IsActive&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_isrun&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_isrun&quot;&gt;OS_Dtimer_IsRun&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_isstopped&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_isstopped&quot;&gt;OS_Dtimer_IsStopped&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_pause&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_pause&quot;&gt;OS_Dtimer_Pause&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_run&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_run&quot;&gt;OS_Dtimer_Run&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_update&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_update&quot;&gt;OS_Dtimer_Update&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_wait&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_wait&quot;&gt;OS_Dtimer_Wait&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;- D -&quot; [3210-4353] --&gt;
&lt;h3&gt;&lt;a name=&quot;e&quot; id=&quot;e&quot;&gt;- E -&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_ei&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_ei&quot;&gt;OS_EI&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_entercriticalsection&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_entercriticalsection&quot;&gt;OS_EnterCriticalSection&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_enterint&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_enterint&quot;&gt;OS_EnterInt&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;- E -&quot; [4354-4569] --&gt;
&lt;h3&gt;&lt;a name=&quot;f&quot; id=&quot;f&quot;&gt;- F -&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_check_alloff&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_flag_check_alloff&quot;&gt;OS_Flag_Check_AllOff&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_check_alloff&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_flag_check_alloff&quot;&gt;OS_Flag_Check_AllOff_I&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_check_allon&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_flag_check_allon&quot;&gt;OS_Flag_Check_AllOn&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_check_allon&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_flag_check_allon&quot;&gt;OS_Flag_Check_AllOn_I&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_check_off&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_flag_check_off&quot;&gt;OS_Flag_Check_Off&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_check_off&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_flag_check_off&quot;&gt;OS_Flag_Check_Off_I&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_check_on&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_flag_check_on&quot;&gt;OS_Flag_Check_On&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_check_on&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_flag_check_on&quot;&gt;OS_Flag_Check_On_I&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_clear&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_flag_clear&quot;&gt;OS_Flag_Clear&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_clear&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_flag_clear&quot;&gt;OS_Flag_Clear_I&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_create&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_flag_create&quot;&gt;OS_Flag_Create&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_init&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_flag_init&quot;&gt;OS_Flag_Init&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_init&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_flag_init&quot;&gt;OS_Flag_Init_I&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_set&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_flag_set&quot;&gt;OS_Flag_Set&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_set&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_flag_set&quot;&gt;OS_Flag_Set_I&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_wait_alloff&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_flag_wait_alloff&quot;&gt;OS_Flag_Wait_AllOff&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_wait_alloff_to&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_flag_wait_alloff_to&quot;&gt;OS_Flag_Wait_AllOff_TO&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_wait_allon&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_flag_wait_allon&quot;&gt;OS_Flag_Wait_AllOn&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_wait_allon_to&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_flag_wait_allon_to&quot;&gt;OS_Flag_Wait_AllOn_TO&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_wait_off&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_flag_wait_off&quot;&gt;OS_Flag_Wait_Off&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_wait_off_to&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_flag_wait_off_to&quot;&gt;OS_Flag_Wait_Off_TO&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_wait_on&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_flag_wait_on&quot;&gt;OS_Flag_Wait_On&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_wait_on_to&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_flag_wait_on_to&quot;&gt;OS_Flag_Wait_On_TO&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;- F -&quot; [4570-6216] --&gt;
&lt;h3&gt;&lt;a name=&quot;i&quot; id=&quot;i&quot;&gt;- I -&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_init&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_init&quot;&gt;OS_Init&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_iserror&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_iserror&quot;&gt;OS_IsError&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_iseventerror&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_iseventerror&quot;&gt;OS_IsEventError&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_isincriticalsection&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_isincriticalsection&quot;&gt;OS_IsInCriticalSection&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_istimeout&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_istimeout&quot;&gt;OS_IsTimeout&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;- I -&quot; [6217-6560] --&gt;
&lt;h3&gt;&lt;a name=&quot;l&quot; id=&quot;l&quot;&gt;- L -&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_leavecriticalsection&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_leavecriticalsection&quot;&gt;OS_LeaveCriticalSection&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_leaveint&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_leaveint&quot;&gt;OS_LeaveInt&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;- L -&quot; [6561-6729] --&gt;
&lt;h3&gt;&lt;a name=&quot;m&quot; id=&quot;m&quot;&gt;- M -&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_msg_accept&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_msg_accept&quot;&gt;OS_Msg_Accept&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_msg_accept&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_msg_accept&quot;&gt;OS_Msg_Accept_I&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_msg_check&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_msg_check&quot;&gt;OS_Msg_Check&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_msg_check&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_msg_check&quot;&gt;OS_Msg_Check_I&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_msg_create&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_msg_create&quot;&gt;OS_Msg_Create&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_msg_send&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_msg_send&quot;&gt;OS_Msg_Send&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_msg_send_now&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_msg_send_now&quot;&gt;OS_Msg_Send_I&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_msg_send_now&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_msg_send_now&quot;&gt;OS_Msg_Send_Now&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_msg_send_to&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_msg_send_to&quot;&gt;OS_Msg_Send_TO&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_msg_wait&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_msg_wait&quot;&gt;OS_Msg_Wait&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_msg_wait_to&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_msg_wait_to&quot;&gt;OS_Msg_Wait_TO&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;- M -&quot; [6730-7451] --&gt;
&lt;h3&gt;&lt;a name=&quot;o&quot; id=&quot;o&quot;&gt;- O -&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_oldtimer_check&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_oldtimer_check&quot;&gt;OS_Oldtimer_Check&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_oldtimer_run16&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_oldtimer_run16&quot;&gt;OS_Oldtimer_Run16&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_oldtimer_run24&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_oldtimer_run24&quot;&gt;OS_Oldtimer_Run24&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_oldtimer_run32&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_oldtimer_run32&quot;&gt;OS_Oldtimer_Run32&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_oldtimer_run8&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_oldtimer_run8&quot;&gt;OS_Oldtimer_Run8&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_oldtimer_stop&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_oldtimer_stop&quot;&gt;OS_Oldtimer_Stop&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_oldtimer_wait&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_oldtimer_wait&quot;&gt;OS_Oldtimer_Wait&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;- O -&quot; [7452-7969] --&gt;
&lt;h3&gt;&lt;a name=&quot;q&quot; id=&quot;q&quot;&gt;- Q -&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_qtimer_break&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_qtimer_break&quot;&gt;OS_Qtimer_Break&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_qtimer_check&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_qtimer_check&quot;&gt;OS_Qtimer_Check&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_qtimer_create&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_qtimer_create&quot;&gt;OS_Qtimer_Create&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_qtimer_delay&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_qtimer_delay&quot;&gt;OS_Qtimer_Delay&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_qtimer_delete&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_qtimer_delete&quot;&gt;OS_Qtimer_Delete&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_qtimer_get&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_qtimer_get&quot;&gt;OS_Qtimer_Get&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_qtimer_isrun&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_qtimer_isrun&quot;&gt;OS_Qtimer_IsRun&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_qtimer_run&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_qtimer_run&quot;&gt;OS_Qtimer_Run&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_qtimer_wait&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_qtimer_wait&quot;&gt;OS_Qtimer_Wait&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_queue_check&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_queue_check&quot;&gt;OS_Queue_Check&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_queue_check&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_queue_check&quot;&gt;OS_Queue_Check_I&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_queue_create&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_queue_create&quot;&gt;OS_Queue_Create&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_queue_isfull&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_queue_isfull&quot;&gt;OS_Queue_IsFull&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_queue_isfull&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_queue_isfull&quot;&gt;OS_Queue_IsFull_I&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_queue_send&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_queue_send&quot;&gt;OS_Queue_Send&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_queue_send_now&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_queue_send_now&quot;&gt;OS_Queue_Send_I&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_queue_send_now&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_queue_send_now&quot;&gt;OS_Queue_Send_Now&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_queue_send_to&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_queue_send_to&quot;&gt;OS_Queue_Send_TO&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_queue_wait&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_queue_wait&quot;&gt;OS_Queue_Wait&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_queue_wait_to&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_queue_wait_to&quot;&gt;OS_Queue_Wait_TO&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;- Q -&quot; [7970-9332] --&gt;
&lt;h3&gt;&lt;a name=&quot;r&quot; id=&quot;r&quot;&gt;- R -&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_ri&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_ri&quot;&gt;OS_RI&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_run&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_run&quot;&gt;OS_Run&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;- R -&quot; [9333-9455] --&gt;
&lt;h3&gt;&lt;a name=&quot;s&quot; id=&quot;s&quot;&gt;- S -&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_sched&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_sched&quot;&gt;OS_Sched&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_smsg_accept&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_smsg_accept&quot;&gt;OS_Smsg_Accept&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_smsg_accept&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_smsg_accept&quot;&gt;OS_Smsg_Accept_I&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_smsg_check&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_smsg_check&quot;&gt;OS_Smsg_Check&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_smsg_check&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_smsg_check&quot;&gt;OS_Smsg_Check_I&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_smsg_create&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_smsg_create&quot;&gt;OS_Smsg_Create&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_smsg_send&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_smsg_send&quot;&gt;OS_Smsg_Send&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_smsg_send_now&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_smsg_send_now&quot;&gt;OS_Smsg_Send_I&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_smsg_send_now&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_smsg_send_now&quot;&gt;OS_Smsg_Send_Now&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_smsg_send_to&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_smsg_send_to&quot;&gt;OS_Smsg_Send_TO&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_smsg_wait&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_smsg_wait&quot;&gt;OS_Smsg_Wait&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_smsg_wait_to&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_smsg_wait_to&quot;&gt;OS_Smsg_Wait_TO&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_squeue_check&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_squeue_check&quot;&gt;OS_Squeue_Check&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_squeue_check&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_squeue_check&quot;&gt;OS_Squeue_Check_I&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_squeue_create&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_squeue_create&quot;&gt;OS_Squeue_Create&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_squeue_isfull&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_squeue_isfull&quot;&gt;OS_Squeue_IsFull&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_squeue_isfull&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_squeue_isfull&quot;&gt;OS_Squeue_IsFull_I&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_squeue_send&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_squeue_send&quot;&gt;OS_Squeue_Send&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_squeue_send_now&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_squeue_send_now&quot;&gt;OS_Squeue_Send_I&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_squeue_send_now&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_squeue_send_now&quot;&gt;OS_Squeue_Send_Now&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_squeue_send_to&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_squeue_send_to&quot;&gt;OS_Squeue_Send_TO&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_squeue_wait&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_squeue_wait&quot;&gt;OS_Squeue_Wait&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_squeue_wait_to&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_squeue_wait_to&quot;&gt;OS_Squeue_Wait_TO&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_stimer_alloc&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_stimer_alloc&quot;&gt;OS_Stimer_Alloc&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_stimer_break&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_stimer_break&quot;&gt;OS_Stimer_Break&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_stimer_check&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_stimer_check&quot;&gt;OS_Stimer_Check&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_stimer_continue&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_stimer_continue&quot;&gt;OS_Stimer_Continue&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_stimer_delay&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_stimer_delay&quot;&gt;OS_Stimer_Delay&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_stimer_found&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_stimer_found&quot;&gt;OS_Stimer_Found&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_stimer_free&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_stimer_free&quot;&gt;OS_Stimer_Free&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_stimer_get&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_stimer_get&quot;&gt;OS_Stimer_Get&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_stimer_isrun&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_stimer_isrun&quot;&gt;OS_Stimer_IsRun&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_stimer_pause&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_stimer_pause&quot;&gt;OS_Stimer_Pause&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_stimer_run&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_stimer_run&quot;&gt;OS_Stimer_Run&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_stimer_wait&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_stimer_wait&quot;&gt;OS_Stimer_Wait&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;- S -&quot; [9456-11811] --&gt;
&lt;h3&gt;&lt;a name=&quot;t&quot; id=&quot;t&quot;&gt;- T -&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_task_continue&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_task_continue&quot;&gt;OS_Task_Continue&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_task_create&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_task_create&quot;&gt;OS_Task_Create&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_task_define&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_task_define&quot;&gt;OS_Task_Define&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_task_delete&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_task_delete&quot;&gt;OS_Task_Delete&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_task_getcreated&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_task_getcreated&quot;&gt;OS_Task_GetCreated&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_task_getcur&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_task_getcur&quot;&gt;OS_Task_GetCur&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_task_getpriority&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_task_getpriority&quot;&gt;OS_Task_GetPriority&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_task_isenable&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_task_isenable&quot;&gt;OS_Task_IsEnable&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_task_ispaused&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_task_ispaused&quot;&gt;OS_Task_IsPaused&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_task_pause&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_task_pause&quot;&gt;OS_Task_Pause&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_task_replace&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_task_replace&quot;&gt;OS_Task_Replace&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_task_setpriority&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_task_setpriority&quot;&gt;OS_Task_SetPriority&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_task_stop&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_task_stop&quot;&gt;OS_Task_Stop&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_timer&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_timer&quot;&gt;OS_Timer&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_ttimer_break&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_ttimer_break&quot;&gt;OS_Ttimer_Break&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_ttimer_check&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_ttimer_check&quot;&gt;OS_Ttimer_Check&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_ttimer_continue&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_ttimer_continue&quot;&gt;OS_Ttimer_Continue&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_ttimer_delay&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_ttimer_delay&quot;&gt;OS_Ttimer_Delay&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_ttimer_get&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_ttimer_get&quot;&gt;OS_Ttimer_Get&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_ttimer_isrun&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_ttimer_isrun&quot;&gt;OS_Ttimer_IsRun&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_ttimer_pause&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_ttimer_pause&quot;&gt;OS_Ttimer_Pause&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_ttimer_run&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_ttimer_run&quot;&gt;OS_Ttimer_Run&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_ttimer_wait&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_ttimer_wait&quot;&gt;OS_Ttimer_Wait&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;- T -&quot; [11812-13371] --&gt;
&lt;h3&gt;&lt;a name=&quot;w&quot; id=&quot;w&quot;&gt;- W -&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_wait&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_wait&quot;&gt;OS_Wait&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_wait_to&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_wait_to&quot;&gt;OS_Wait_TO&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;- W -&quot; [13372-13497] --&gt;
&lt;h3&gt;&lt;a name=&quot;y&quot; id=&quot;y&quot;&gt;- Y -&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_yield&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_yield&quot;&gt;OS_Yield&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;- Y -&quot; [13498-] --&gt;</description>
    </item>
    <item rdf:about="http://www.pic24.ru/doku.php/en/osa/ref/services/binary_semaphores?rev=1260572477">
        <dc:format>text/html</dc:format>
        <dc:date>2009-12-12T02:01:17+03:00</dc:date>
        <title>OSA : Binary semaphores</title>
        <link>http://www.pic24.ru/doku.php/en/osa/ref/services/binary_semaphores?rev=1260572477</link>
        <description>


&lt;h1&gt;&lt;a name=&quot;osa_binary_semaphores&quot; id=&quot;osa_binary_semaphores&quot;&gt;OSA : Binary semaphores&lt;/a&gt;&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;OSA : Binary semaphores&quot; [1-39] --&gt;
&lt;h2&gt;&lt;a name=&quot;introduction&quot; id=&quot;introduction&quot;&gt;Introduction&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
Binary semaphore is a system variable that can accept values 0 and 1. This is simplest way to exchange data between tasks and to synchronize them. All binary semaphores have size of one bit. Programmer can set number of binary semaphores by defining &lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/appendix/configuration&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:appendix:configuration&quot;&gt;OS_BSEMS&lt;/a&gt; constant in &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/appendix/configuration&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:appendix:configuration&quot;&gt;OSAcfg.h&lt;/a&gt;&lt;/span&gt; and system will allocate necessary number of bytes. Therefore memory under binary semaphores reserved on compile stage and their number can&amp;#039;t be changed in run-time.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Introduction&quot; [40-592] --&gt;
&lt;h2&gt;&lt;a name=&quot;identification&quot; id=&quot;identification&quot;&gt;Identification&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
When working with services controlling binary semaphores it is need to give them semaphore&amp;#039;s ID from 0 to &lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/appendix/configuration&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:appendix:configuration&quot;&gt;OS_BSEMS&lt;/a&gt;-1. It is comfortable to assign IDs using enum:
&lt;/p&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;enum&lt;/span&gt; OSA_BINSEMS_ENUM
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    BS_BUTTON_PRESSED,
    BS_USART_FREE,
    BS_WRITE_COMPLETE,
    . . .
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;;&lt;/pre&gt;
&lt;p&gt;
When using enum we can be sure that each ID is unical.
&lt;/p&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Identification&quot; [593-1005] --&gt;
&lt;h2&gt;&lt;a name=&quot;work_with_binary_semaphores&quot; id=&quot;work_with_binary_semaphores&quot;&gt;Work with binary semaphores&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
After system initialization (&lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_init&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_init&quot;&gt;OS_Init&lt;/a&gt;&lt;/span&gt;) all binary semaphores are reseted. Task wich waits binary semaphore will be put into waiting state until binary semaphore will be set.
&lt;/p&gt;

&lt;p&gt;
Here is example of using binary semaphore to accessing common resource - external eeprom:

&lt;/p&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span class=&quot;co2&quot;&gt;#include &amp;lt;osa.h&amp;gt;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw2&quot;&gt;enum&lt;/span&gt; OSA_BINSEMS_ENUM &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    BS_EEPROM_FREE
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;;
&amp;nbsp;
&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; Task1 &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;;;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        ...
        &lt;span class=&quot;me1&quot;&gt;OS_Bsem_Wait&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;BS_EEPROM_FREE&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;     &lt;span class=&quot;co1&quot;&gt;// Wait when EEPROM becames free of other tasks&lt;/span&gt;
        &lt;span class=&quot;co1&quot;&gt;// After this service binary semaphore reset automatically&lt;/span&gt;
        &lt;span class=&quot;co1&quot;&gt;// thus other task will not get this resource.&lt;/span&gt;
&amp;nbsp;
        &lt;span class=&quot;co1&quot;&gt;// Here we know that EEPROM if free of other tasks.&lt;/span&gt;
        eeprom_read&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        eeprom_read&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        OS_Bsem_Set&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;BS_EEPROM_FREE&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;      &lt;span class=&quot;co1&quot;&gt;// After work with EEPROM we free this resource&lt;/span&gt;
        ...
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; Task2 &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;;;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        ...
        &lt;span class=&quot;me1&quot;&gt;OS_Bsem_Wait&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;BS_EEPROM_FREE&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;     &lt;span class=&quot;co1&quot;&gt;// Wait when EEPROM becames free of other tasks&lt;/span&gt;
        &lt;span class=&quot;co1&quot;&gt;// After this service binary semaphore reset automatically&lt;/span&gt;
        &lt;span class=&quot;co1&quot;&gt;// thus other task will not get this resource.&lt;/span&gt;
&amp;nbsp;
        &lt;span class=&quot;co1&quot;&gt;// Here we know that EEPROM if free of other tasks.&lt;/span&gt;
        eeprom_write&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        OS_Delay&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;                     &lt;span class=&quot;co1&quot;&gt;// Wait for end of write operation.&lt;/span&gt;
                                         &lt;span class=&quot;co1&quot;&gt;// When waiting other tasks are executed. But since&lt;/span&gt;
                                         &lt;span class=&quot;co1&quot;&gt;// binary semaphore is reset none of them can start&lt;/span&gt;
                                         &lt;span class=&quot;co1&quot;&gt;// to work with EEPROM&lt;/span&gt;
        eeprom_write&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;6&lt;/span&gt;, &lt;span class=&quot;nu0&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        OS_Delay&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        OS_Bsem_Set&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;BS_EEPROM_FREE&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;      &lt;span class=&quot;co1&quot;&gt;// After work with EEPROM we free this resource&lt;/span&gt;
        ...
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Work with binary semaphores&quot; [1006-2756] --&gt;
&lt;h2&gt;&lt;a name=&quot;allocation&quot; id=&quot;allocation&quot;&gt;Allocation&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
You can select memory bank to allocate binary semaphores. To do it you need to set constant &lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/appendix/configuration&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:appendix:configuration&quot;&gt;OS_BANK_BSEMS&lt;/a&gt; in &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/appendix/configuration&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:appendix:configuration&quot;&gt;OSAcfg.h.&lt;/a&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Allocation&quot; [2757-2989] --&gt;
&lt;h2&gt;&lt;a name=&quot;services_for_binary_semaphores&quot; id=&quot;services_for_binary_semaphores&quot;&gt;Services for binary semaphores&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0 centeralign&quot;&gt;  Service  &lt;/th&gt;&lt;th class=&quot;col1 centeralign&quot;&gt;  Arguments  &lt;/th&gt;&lt;th class=&quot;col2 centeralign&quot;&gt;  Description  &lt;/th&gt;&lt;th class=&quot;col3 centeralign&quot;&gt;  Properties  &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Menagement&lt;/strong&gt; &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_bsem_set&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_bsem_set&quot;&gt;OS_Bsem_Set&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(bsem)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Signal binary semaphore  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Abinary_semaphores&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_bsem_reset&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_bsem_reset&quot;&gt;OS_Bsem_Reset&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(bsem)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Reset binary semaphore  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Abinary_semaphores&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row4&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_bsem_switch&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_bsem_switch&quot;&gt;OS_Bsem_Switch&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(bsem)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Change binary semaphore&amp;#039;s state  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Abinary_semaphores&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row5&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Checking&lt;/strong&gt;    &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row6&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_bsem_check&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_bsem_check&quot;&gt;OS_Bsem_Check&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(bsem)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Check for binary semaphore is set  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Abinary_semaphores&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row7&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Waiting&lt;/strong&gt;     &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row8&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_bsem_wait&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_bsem_wait&quot;&gt;OS_Bsem_Wait&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(bsem)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Wait for binary semaphore is set  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Abinary_semaphores&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Abinary_semaphores&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row9&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_bsem_wait_to&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_bsem_wait_to&quot;&gt;OS_Bsem_Wait_TO&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(bsem, timeout)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Wait for binary semaphore is set. Exit if timeout expired.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Abinary_semaphores&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Abinary_semaphores&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abinary_semaphores&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Services for binary semaphores&quot; [2990-] --&gt;</description>
    </item>
    <item rdf:about="http://www.pic24.ru/doku.php/en/osa/ref/services/brieflist?rev=1268225726">
        <dc:format>text/html</dc:format>
        <dc:date>2010-03-10T15:55:26+03:00</dc:date>
        <title>ALL OSA SERVICES</title>
        <link>http://www.pic24.ru/doku.php/en/osa/ref/services/brieflist?rev=1268225726</link>
        <description>


&lt;h1&gt;&lt;a name=&quot;all_osa_services&quot; id=&quot;all_osa_services&quot;&gt;ALL OSA SERVICES&lt;/a&gt;&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/services/alphabetical&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:services:alphabetical&quot;&gt;Alphabetical&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
Third column of table consist service&amp;#039;s proprties:
&lt;/p&gt;
&lt;table class = &quot;&quot;&gt;
	&lt;tr&gt;
		&lt;td&gt;
&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;		&lt;/td&gt;
		&lt;td&gt;
Service uses system timer		&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;
&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_not_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_not_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_not_int.png&quot; class=&quot;media&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;		&lt;/td&gt;
		&lt;td&gt;
Do not call from ISR		&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;
&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;		&lt;/td&gt;
		&lt;td&gt;
Call from task only		&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;
&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task_plus.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task_plus.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task_plus.png&quot; class=&quot;media&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;		&lt;/td&gt;
		&lt;td&gt;
Allowed calls only from task and functions called by task (any deep)		&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;
&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;		&lt;/td&gt;
		&lt;td&gt;
Switchs context		&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;
&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_int.png&quot; class=&quot;media&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;		&lt;/td&gt;
		&lt;td&gt;
Call from ISR only		&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;
&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;		&lt;/td&gt;
		&lt;td&gt;
Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)		&lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;ALL OSA SERVICES&quot; [1-654] --&gt;
&lt;h2&gt;&lt;a name=&quot;system_services&quot; id=&quot;system_services&quot;&gt;System services&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0 centeralign&quot;&gt;  Service  &lt;/th&gt;&lt;th class=&quot;col1 centeralign&quot;&gt;  Arguments  &lt;/th&gt;&lt;th class=&quot;col2 centeralign&quot;&gt;  Description  &lt;/th&gt;&lt;th class=&quot;col3 centeralign&quot;&gt;  Properties  &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;System&lt;/strong&gt;    &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_sched&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_sched&quot;&gt;OS_Sched&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; List all tasks, select ready task with highest priority and run it.  &lt;/td&gt;&lt;td class=&quot;col3 rightalign&quot;&gt;   &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_run&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_run&quot;&gt;OS_Run&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Run operating system&amp;#039;s kernel. Calls &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_sched&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_sched&quot;&gt;OS_Sched&lt;/a&gt;&lt;/span&gt;() in infinite loop.  &lt;/td&gt;&lt;td class=&quot;col3 rightalign&quot;&gt;   &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row4&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_init&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_init&quot;&gt;OS_Init&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Init system vars  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_not_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_not_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_not_int.png&quot; class=&quot;media&quot; title=&quot;Not allowed in interrupt&quot; alt=&quot;Not allowed in interrupt&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row5&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_timer&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_timer&quot;&gt;OS_Timer&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Insrease all active timers.  &lt;/td&gt;&lt;td class=&quot;col3 rightalign&quot;&gt;   &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row6&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Waiting&lt;/strong&gt;     &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row7&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_yield&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_yield&quot;&gt;OS_Yield&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Return to scheduler  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row8&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_delay&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_delay&quot;&gt;OS_Delay&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(delaytime)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Delay current task for &lt;em&gt;delaytime&lt;/em&gt; system ticks  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row9&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_wait&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_wait&quot;&gt;OS_Wait&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(condition)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Wait for condition is true  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row10&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_wait_to&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_wait_to&quot;&gt;OS_Wait_TO&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(condition, timeout)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Wait for condition is true. Exit if timeout expired.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row11&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Checking&lt;/strong&gt;    &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row12&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_istimeout&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_istimeout&quot;&gt;OS_IsTimeout&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Return true if timeout occured in previos wait service.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row13&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_iserror&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_iserror&quot;&gt;OS_IsError&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Check for error after task creating  &lt;/td&gt;&lt;td class=&quot;col3 rightalign&quot;&gt;   &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row14&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_iseventerror&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_iseventerror&quot;&gt;OS_IsEventError&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Check for error after work with events  &lt;/td&gt;&lt;td class=&quot;col3 rightalign&quot;&gt;   &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row15&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_isincriticalsection&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_isincriticalsection&quot;&gt;OS_IsInCriticalSection&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Return true if one of task is in critical section  &lt;/td&gt;&lt;td class=&quot;col3 rightalign&quot;&gt;   &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row16&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Interrupts&lt;/strong&gt;     &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row17&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_enterint&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_enterint&quot;&gt;OS_EnterInt&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; For &lt;strong&gt;PICC16&lt;/strong&gt; and &lt;strong&gt;PICC18&lt;/strong&gt;: save FSR in the begin of ISR function  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_int.png&quot; class=&quot;media&quot; title=&quot;Only insize interrupt&quot; alt=&quot;Only insize interrupt&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row18&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_leaveint&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_leaveint&quot;&gt;OS_LeaveInt&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; For &lt;strong&gt;PICC16&lt;/strong&gt; and &lt;strong&gt;PICC18&lt;/strong&gt;: restore saved FSR in the end of ISR function  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_int.png&quot; class=&quot;media&quot; title=&quot;Only insize interrupt&quot; alt=&quot;Only insize interrupt&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row19&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;char &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_di&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_di&quot;&gt;OS_DI&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Disable all interrupts and save previos state of GIEx flags  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_not_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_not_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_not_int.png&quot; class=&quot;media&quot; title=&quot;Not allowed in interrupt&quot; alt=&quot;Not allowed in interrupt&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row20&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_ei&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_ei&quot;&gt;OS_EI&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Enable all interrupts  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_not_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_not_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_not_int.png&quot; class=&quot;media&quot; title=&quot;Not allowed in interrupt&quot; alt=&quot;Not allowed in interrupt&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row21&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_ri&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_ri&quot;&gt;OS_RI&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(char)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Restore previosly saved by &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_di&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_di&quot;&gt;OS_DI&lt;/a&gt;&lt;/span&gt; service GIEx flags  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_not_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_not_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_not_int.png&quot; class=&quot;media&quot; title=&quot;Not allowed in interrupt&quot; alt=&quot;Not allowed in interrupt&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row22&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_entercriticalsection&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_entercriticalsection&quot;&gt;OS_EnterCriticalSection&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Enter critical section  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row23&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_leavecriticalsection&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_leavecriticalsection&quot;&gt;OS_LeaveCriticalSection&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Leave critical section  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;System services&quot; [655-4303] --&gt;
&lt;h2&gt;&lt;a name=&quot;task_control&quot; id=&quot;task_control&quot;&gt;Task control&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0 centeralign&quot;&gt;  Service  &lt;/th&gt;&lt;th class=&quot;col1 centeralign&quot;&gt;  Arguments  &lt;/th&gt;&lt;th class=&quot;col2 centeralign&quot;&gt;  Description  &lt;/th&gt;&lt;th class=&quot;col3 centeralign&quot;&gt;  Properties  &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Creating/Deleting&lt;/strong&gt;    &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_task_define&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_task_define&quot;&gt;OS_Task_Define&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(TaskName)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; &lt;strong&gt;For CCS&lt;/strong&gt;: Tell to compiler that function &lt;em&gt;Taskname&lt;/em&gt; is a task and it will be called indirrectly. This service called from main() only  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;strong&gt;main&lt;/strong&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_task_create&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_task_create&quot;&gt;OS_Task_Create&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(priority, TaskName)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Create task and add it to list of active tasks  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_not_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_not_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_not_int.png&quot; class=&quot;media&quot; title=&quot;Not allowed in interrupt&quot; alt=&quot;Not allowed in interrupt&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row4&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_task_replace&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_task_replace&quot;&gt;OS_Task_Replace&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(priority, TaskName)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Stop and delete current task and create new task  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row5&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_task_delete&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_task_delete&quot;&gt;OS_Task_Delete&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(tp)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Delete task  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row6&quot;&gt;
		&lt;td class=&quot;col0&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Menagement&lt;/strong&gt; &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row7&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;OST_TASK_POINTER&lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_task_getcur&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_task_getcur&quot;&gt;OS_Task_GetCur&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Get pointer to currect task&amp;#039;s descriptor  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row8&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;OST_TASK_POINTER&lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/osa/ref/allservices/os_task_getcreated&quot; class=&quot;wikilink1&quot; title=&quot;osa:ref:allservices:os_task_getcreated&quot;&gt;OS_Task_GetCreated&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Get pointer to just created task&amp;#039;s descriptor  &lt;/td&gt;&lt;td class=&quot;col3 rightalign&quot;&gt;   &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row9&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_task_pause&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_task_pause&quot;&gt;OS_Task_Pause&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(tp)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Pause task  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row10&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_task_continue&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_task_continue&quot;&gt;OS_Task_Continue&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(tp)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Continue paused task  &lt;/td&gt;&lt;td class=&quot;col3 rightalign&quot;&gt;   &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row11&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;char &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_task_getpriority&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_task_getpriority&quot;&gt;OS_Task_GetPriority&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(tp)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Get priority of task  &lt;/td&gt;&lt;td class=&quot;col3 rightalign&quot;&gt;   &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row12&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_task_setpriority&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_task_setpriority&quot;&gt;OS_Task_SetPriority&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(tp, priority)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Change task&amp;#039;s priority  &lt;/td&gt;&lt;td class=&quot;col3 rightalign&quot;&gt;   &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row13&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Checking&lt;/strong&gt;    &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row14&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_task_ispaused&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_task_ispaused&quot;&gt;OS_Task_IsPaused&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(tp)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Check for task s paused  &lt;/td&gt;&lt;td class=&quot;col3 rightalign&quot;&gt;   &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Task control&quot; [4304-6253] --&gt;
&lt;h2&gt;&lt;a name=&quot;binary_semaphores&quot; id=&quot;binary_semaphores&quot;&gt;Binary semaphores&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0 centeralign&quot;&gt;  Service  &lt;/th&gt;&lt;th class=&quot;col1 centeralign&quot;&gt;  Arguments  &lt;/th&gt;&lt;th class=&quot;col2 centeralign&quot;&gt;  Description  &lt;/th&gt;&lt;th class=&quot;col3 centeralign&quot;&gt;  Properties  &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Menagement&lt;/strong&gt; &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_bsem_set&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_bsem_set&quot;&gt;OS_Bsem_Set&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(bsem)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Signal binary semaphore  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_bsem_reset&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_bsem_reset&quot;&gt;OS_Bsem_Reset&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(bsem)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Reset binary semaphore  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row4&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_bsem_switch&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_bsem_switch&quot;&gt;OS_Bsem_Switch&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(bsem)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Change binary semaphore&amp;#039;s state  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row5&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Checking&lt;/strong&gt;    &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row6&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_bsem_check&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_bsem_check&quot;&gt;OS_Bsem_Check&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(bsem)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Check for binary semaphore is set  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row7&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Waiting&lt;/strong&gt;     &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row8&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_bsem_wait&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_bsem_wait&quot;&gt;OS_Bsem_Wait&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(bsem)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Wait for binary semaphore is set  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row9&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_bsem_wait_to&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_bsem_wait_to&quot;&gt;OS_Bsem_Wait_TO&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(bsem, timeout)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Wait for binary semaphore is set. Exit if timeout expired.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Binary semaphores&quot; [6254-7762] --&gt;
&lt;h2&gt;&lt;a name=&quot;counting_semaphores&quot; id=&quot;counting_semaphores&quot;&gt;Counting semaphores&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0 centeralign&quot;&gt;  Service  &lt;/th&gt;&lt;th class=&quot;col1 centeralign&quot;&gt;  Arguments  &lt;/th&gt;&lt;th class=&quot;col2 centeralign&quot;&gt;  Description  &lt;/th&gt;&lt;th class=&quot;col3 centeralign&quot;&gt;  Properties  &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Creating&lt;/strong&gt;    &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_csem_create&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_csem_create&quot;&gt;OS_Csem_Create&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(csem)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Create and zero counting semaphore  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_not_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_not_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_not_int.png&quot; class=&quot;media&quot; title=&quot;Not allowed in interrupt&quot; alt=&quot;Not allowed in interrupt&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Menagement&lt;/strong&gt; &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row4&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_csem_signal&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_csem_signal&quot;&gt;OS_Csem_Signal&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(csem)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; Increase counting semaphore&amp;#039;s value by 1 (wait when overflow) &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row5&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_csem_signal_now&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_csem_signal_now&quot;&gt;OS_Csem_Signal_Now&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(csem)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; Increase counting semaphore&amp;#039;s value by 1 (don&amp;#039;t wait when overflow) &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row6&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_csem_set&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_csem_set&quot;&gt;OS_Csem_Set&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(csem)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Set counting semaphore&amp;#039;s value to 1.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row7&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_csem_setvalue&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_csem_setvalue&quot;&gt;OS_Csem_SetValue&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(csem, value)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Set counting semaphore&amp;#039;s value to given &lt;em&gt;value&lt;/em&gt;.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row8&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_csem_reset&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_csem_reset&quot;&gt;OS_Csem_Reset&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(csem)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Zero counting semaphore  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row9&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Checking&lt;/strong&gt;    &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row10&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_csem_check&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_csem_check&quot;&gt;OS_Csem_Check&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(csem)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Check for counting semaphore is set (not eq. to 0)  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row11&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_csem_accept&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_csem_accept&quot;&gt;OS_Csem_Accept&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(csem)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Accept counting semaphore. Decrease it&amp;#039;s value by 1.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row12&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Waiting&lt;/strong&gt;     &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row13&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_csem_wait&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_csem_wait&quot;&gt;OS_Csem_Wait&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(csem)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Wait for counting semaphore. Then decrease it&amp;#039;s value by 1  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row14&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_csem_wait_to&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_csem_wait_to&quot;&gt;OS_Csem_Wait_TO&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(csem, timeout)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Wait for counting semaphore. Then decrease it&amp;#039;s value by 1. Exit if timeout expired  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Counting semaphores&quot; [7763-10315] --&gt;
&lt;h2&gt;&lt;a name=&quot;pointers_to_messages&quot; id=&quot;pointers_to_messages&quot;&gt;Pointers to messages&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0 centeralign&quot;&gt;  Service  &lt;/th&gt;&lt;th class=&quot;col1 centeralign&quot;&gt;  Arguments  &lt;/th&gt;&lt;th class=&quot;col2 centeralign&quot;&gt;  Description  &lt;/th&gt;&lt;th class=&quot;col3 centeralign&quot;&gt;  Properties  &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Creating&lt;/strong&gt;    &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_msg_create&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_msg_create&quot;&gt;OS_Msg_Create&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(msg_cb)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Create message and zero it.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_not_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_not_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_not_int.png&quot; class=&quot;media&quot; title=&quot;Not allowed in interrupt&quot; alt=&quot;Not allowed in interrupt&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Sending&lt;/strong&gt;     &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row4&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_msg_send&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_msg_send&quot;&gt;OS_Msg_Send&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(msg_cb, message)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Send message. If message is already exists then wait when it became free.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row5&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_msg_send_to&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_msg_send_to&quot;&gt;OS_Msg_Send_TO&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(msg_cb, message, timeout)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Send message. If message is already exists then wait when it became free. Exit if timeout expired.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row6&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_msg_send_now&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_msg_send_now&quot;&gt;OS_Msg_Send_Now&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(msg_cb, message)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Send message. If message is already exists then it will be overwritten.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row7&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Checking&lt;/strong&gt;    &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row8&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_msg_check&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_msg_check&quot;&gt;OS_Msg_Check&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(msg_cb)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Check for message exists  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row9&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_msg_accept&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_msg_accept&quot;&gt;OS_Msg_Accept&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(msg_cb, os_msg_type_var)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Accept existing message. After accepting message is set free.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row10&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Waiting&lt;/strong&gt;     &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row11&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_msg_wait&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_msg_wait&quot;&gt;OS_Msg_Wait&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(msg_cb, os_msg_type_var)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Wait for message. After waiting message is set free  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row12&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_msg_wait_to&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_msg_wait_to&quot;&gt;OS_Msg_Wait_TO&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(msg_cb, os_msg_type_var, timeout)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Wait for message. Exit if timeout expired.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Pointers to messages&quot; [10316-12601] --&gt;
&lt;h2&gt;&lt;a name=&quot;simple_messages&quot; id=&quot;simple_messages&quot;&gt;Simple messages&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0 centeralign&quot;&gt;  Service  &lt;/th&gt;&lt;th class=&quot;col1 centeralign&quot;&gt;  Arguments  &lt;/th&gt;&lt;th class=&quot;col2 centeralign&quot;&gt;  Description  &lt;/th&gt;&lt;th class=&quot;col3 centeralign&quot;&gt;  Properties  &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Creating&lt;/strong&gt;    &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_smsg_create&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_smsg_create&quot;&gt;OS_Smsg_Create&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(smsg)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Create and zero simple message  &lt;/td&gt;&lt;td class=&quot;col3 rightalign&quot;&gt;   &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Sending&lt;/strong&gt;     &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row4&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_smsg_send&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_smsg_send&quot;&gt;OS_Smsg_Send&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(smsg, smessage)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Send simple message. If message already exists then wait when it became free.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row5&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_smsg_send_to&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_smsg_send_to&quot;&gt;OS_Smsg_Send_TO&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(smsg, smessage, timeout)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Send simple message. If message already exists then wait when it became free. Exit if timeout expired.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row6&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_smsg_send_now&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_smsg_send_now&quot;&gt;OS_Smsg_Send_Now&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(smsg, smessage)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Send simple message. If message already exists then it will be overwritten.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row7&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Checking&lt;/strong&gt;    &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row8&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_smsg_check&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_smsg_check&quot;&gt;OS_Smsg_Check&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(smsg)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Check for simple message exists  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row9&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_smsg_accept&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_smsg_accept&quot;&gt;OS_Smsg_Accept&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(smsg, os_smsg_type_var)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Accept existing simple message. After accepting message is cleared.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row10&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Waiting&lt;/strong&gt;     &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row11&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_smsg_wait&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_smsg_wait&quot;&gt;OS_Smsg_Wait&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(smsg, os_smsg_type_var)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Wait for simple message. After accepting simple message is cleared.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row12&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_smsg_wait_to&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_smsg_wait_to&quot;&gt;OS_Smsg_Wait_TO&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(smsg, os_smsg_type_var, timeout)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Wait for simple message. After accepting simple message is cleared. Exit if timeout expired.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Simple messages&quot; [12602-14924] --&gt;
&lt;h2&gt;&lt;a name=&quot;queue_of_pointers_to_message&quot; id=&quot;queue_of_pointers_to_message&quot;&gt;Queue of pointers to message&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0 centeralign&quot;&gt;  Service  &lt;/th&gt;&lt;th class=&quot;col1 centeralign&quot;&gt;  Arguments  &lt;/th&gt;&lt;th class=&quot;col2 centeralign&quot;&gt;  Description  &lt;/th&gt;&lt;th class=&quot;col3 centeralign&quot;&gt;  Properties  &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Creating&lt;/strong&gt;    &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_queue_create&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_queue_create&quot;&gt;OS_Queue_Create&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(queue, buffer, size)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Create and clear queue.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_not_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_not_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_not_int.png&quot; class=&quot;media&quot; title=&quot;Not allowed in interrupt&quot; alt=&quot;Not allowed in interrupt&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Sending&lt;/strong&gt;     &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row4&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_queue_send&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_queue_send&quot;&gt;OS_Queue_Send&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(queue, message)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Send message via queue. If queue full then wait for free place  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row5&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_queue_send_to&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_queue_send_to&quot;&gt;OS_Queue_Send_TO&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(queue, message, timeout)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Send message via queue. If queue full then wait for free place. Exit if timeout expired.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row6&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_queue_send_now&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_queue_send_now&quot;&gt;OS_Queue_Send_Now&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(queue, message)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Send message via queue. If queue is full then most rearly message will be pushed out.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row7&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Checking&lt;/strong&gt;    &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row8&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_queue_check&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_queue_check&quot;&gt;OS_Queue_Check&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(queue)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Check for there is any message in queue.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row9&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_queue_isfull&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_queue_isfull&quot;&gt;OS_Queue_IsFull&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(queue)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Check for queue of messages is full.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row10&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_queue_isempty&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_queue_isempty&quot;&gt;OS_Queue_IsEmpty&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(queue)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Check for queue of messages is empty.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row11&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Waiting&lt;/strong&gt;     &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row12&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_queue_wait&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_queue_wait&quot;&gt;OS_Queue_Wait&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(queue, os_msg_type_var)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Wait message from queue. After accepting message will be deleted from queue.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row13&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_queue_wait_to&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_queue_wait_to&quot;&gt;OS_Queue_Wait_TO&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(queue, os_msg_type_var, timeout)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Wait message from queue. After accepting message will be deleted from queue. Exit if timeout expired.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Queue of pointers to message&quot; [14925-17544] --&gt;
&lt;h2&gt;&lt;a name=&quot;queue_of_simple_messages&quot; id=&quot;queue_of_simple_messages&quot;&gt;Queue of simple messages&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0 centeralign&quot;&gt;  Service  &lt;/th&gt;&lt;th class=&quot;col1 centeralign&quot;&gt;  Arguments  &lt;/th&gt;&lt;th class=&quot;col2 centeralign&quot;&gt;  Description  &lt;/th&gt;&lt;th class=&quot;col3 centeralign&quot;&gt;  Properties  &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Creating&lt;/strong&gt;    &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_squeue_create&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_squeue_create&quot;&gt;OS_Squeue_Create&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(squeue, buffer, size)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Create and clear queue.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_not_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_not_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_not_int.png&quot; class=&quot;media&quot; title=&quot;Not allowed in interrupt&quot; alt=&quot;Not allowed in interrupt&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Sending&lt;/strong&gt;     &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row4&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_squeue_send&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_squeue_send&quot;&gt;OS_Squeue_Send&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(squeue, smessage)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Send simple message via queue. If queue full then wait for free place  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row5&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_squeue_send_to&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_squeue_send_to&quot;&gt;OS_Squeue_Send_TO&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(squeue, smessage, timeout)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Send message via queue. If queue full then wait for free place. Exit if timeout expired.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row6&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_squeue_send_now&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_squeue_send_now&quot;&gt;OS_Squeue_Send_Now&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(squeue, smessage)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Send message via queue. If queue is full then most rearly message will be pushed out.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row7&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Checking&lt;/strong&gt;    &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row8&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_squeue_check&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_squeue_check&quot;&gt;OS_Squeue_Check&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(squeue)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Check for there is any simple message in queue.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row9&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_squeue_isfull&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_squeue_isfull&quot;&gt;OS_Squeue_IsFull&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(squeue)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Check for queue of simple messages is full.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row10&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_squeue_isempty&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_squeue_isempty&quot;&gt;OS_Squeue_IsEmpty&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(squeue)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Check for queue of simple messages is empty.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row11&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Waiting&lt;/strong&gt;     &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row12&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_squeue_wait&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_squeue_wait&quot;&gt;OS_Squeue_Wait&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(squeue, os_smsg_type_var)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Wait message from queue. After accepting message will be deleted from queue.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row13&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_squeue_wait_to&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_squeue_wait_to&quot;&gt;OS_Squeue_Wait_TO&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(squeue, os_smsg_type_var, timeout)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Wait message from queue. After accepting message will be deleted from queue. Exit if timeout expired.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Queue of simple messages&quot; [17545-20220] --&gt;
&lt;h2&gt;&lt;a name=&quot;flags&quot; id=&quot;flags&quot;&gt;Flags&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0 centeralign&quot;&gt;  Service  &lt;/th&gt;&lt;th class=&quot;col1 centeralign&quot;&gt;  Arguments  &lt;/th&gt;&lt;th class=&quot;col2 centeralign&quot;&gt;  Description  &lt;/th&gt;&lt;th class=&quot;col3 centeralign&quot;&gt;  Properties  &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Creating&lt;/strong&gt;    &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_create&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_flag_create&quot;&gt;OS_Flag_Create&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(flags)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; (&lt;strong&gt;flag = 0&lt;/strong&gt;) Create flag and clear all it&amp;#039;s bits (&lt;strong&gt;flag = 0&lt;/strong&gt;)  &lt;/td&gt;&lt;td class=&quot;col3 rightalign&quot;&gt;   &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Menagement&lt;/strong&gt; &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row4&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_init&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_flag_init&quot;&gt;OS_Flag_Init&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(flags, value)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; (&lt;strong&gt;flag = value&lt;/strong&gt;) Set flag to givel value  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row5&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_set_1&quot; class=&quot;wikilink2&quot; title=&quot;en:osa:ref:allservices:os_flag_set_1&quot; rel=&quot;nofollow&quot;&gt;OS_Flag_Set_1&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(flags, mask)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; (&lt;strong&gt;flag = flags&lt;/strong&gt; | &lt;strong&gt;mask&lt;/strong&gt;) Set bits in flag by given mask  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row6&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_set_0&quot; class=&quot;wikilink2&quot; title=&quot;en:osa:ref:allservices:os_flag_set_0&quot; rel=&quot;nofollow&quot;&gt;OS_Flag_Set_0&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(flags, mask)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; (&lt;strong&gt;flag &amp;amp;= ~mask&lt;/strong&gt;) Clear bits in flag by given mask  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row7&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Checking&lt;/strong&gt;    &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row8&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_check_11&quot; class=&quot;wikilink2&quot; title=&quot;en:osa:ref:allservices:os_flag_check_11&quot; rel=&quot;nofollow&quot;&gt;OS_Flag_Check_11&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(flags, mask)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; (&lt;strong&gt; if ((flag &amp;amp; mask)==mask) &lt;/strong&gt;) Check for all bits in flags are set by given mask  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row9&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_check_1x&quot; class=&quot;wikilink2&quot; title=&quot;en:osa:ref:allservices:os_flag_check_1x&quot; rel=&quot;nofollow&quot;&gt;OS_Flag_Check_1x&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(flags, mask)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; (&lt;strong&gt; if ((flag &amp;amp; mask)!=0) &lt;/strong&gt;) Check for any bit in flags is set by given mask  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row10&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_check_00&quot; class=&quot;wikilink2&quot; title=&quot;en:osa:ref:allservices:os_flag_check_00&quot; rel=&quot;nofollow&quot;&gt;OS_Flag_Check_00&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(flags, mask)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; (&lt;strong&gt; if ((flag &amp;amp; mask)==0) &lt;/strong&gt;) Check for all bits in flag are cleared by given mask  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row11&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_check_0x&quot; class=&quot;wikilink2&quot; title=&quot;en:osa:ref:allservices:os_flag_check_0x&quot; rel=&quot;nofollow&quot;&gt;OS_Flag_Check_0x&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(flags, mask)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; (&lt;strong&gt; if ((flag &amp;amp; mask)!=mask) &lt;/strong&gt;) Check for any bit in flag is cleared by given mask  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row12&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Waiting&lt;/strong&gt;     &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row13&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_wait_11&quot; class=&quot;wikilink2&quot; title=&quot;en:osa:ref:allservices:os_flag_wait_11&quot; rel=&quot;nofollow&quot;&gt;OS_Flag_Wait_11&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(flags, mask)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; (&lt;strong&gt; if ((flag &amp;amp; mask)==mask) &lt;/strong&gt;) Wait for all bits in flags are set by given mask  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row14&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_wait_1x&quot; class=&quot;wikilink2&quot; title=&quot;en:osa:ref:allservices:os_flag_wait_1x&quot; rel=&quot;nofollow&quot;&gt;OS_Flag_Wait_1x&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(flags, mask)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; (&lt;strong&gt; wait ((flag &amp;amp; mask)!=0) &lt;/strong&gt;) Wait for any bit in flags is set by given mask  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row15&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_wait_00&quot; class=&quot;wikilink2&quot; title=&quot;en:osa:ref:allservices:os_flag_wait_00&quot; rel=&quot;nofollow&quot;&gt;OS_Flag_Wait_00&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(flags, mask)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; (&lt;strong&gt; wait ((flag &amp;amp; mask)==0) &lt;/strong&gt;) Wait for all bits in flag are cleared by given mask  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row16&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_wait_0x&quot; class=&quot;wikilink2&quot; title=&quot;en:osa:ref:allservices:os_flag_wait_0x&quot; rel=&quot;nofollow&quot;&gt;OS_Flag_Wait_0x&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(flags, mask)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; (&lt;strong&gt; wait ((flag &amp;amp; mask)!=mask) &lt;/strong&gt;) Wait for any bit in flag is cleared by given mask  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row17&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_wait_11_to&quot; class=&quot;wikilink2&quot; title=&quot;en:osa:ref:allservices:os_flag_wait_11_to&quot; rel=&quot;nofollow&quot;&gt;OS_Flag_Wait_11_TO&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(flags, mask, timeout)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; (&lt;strong&gt; wait ((flag &amp;amp; mask)==mask) &lt;/strong&gt;) Wait for all bits in flags are set by given mask. Exit if timeout expired.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row18&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_wait_1x_to&quot; class=&quot;wikilink2&quot; title=&quot;en:osa:ref:allservices:os_flag_wait_1x_to&quot; rel=&quot;nofollow&quot;&gt;OS_Flag_Wait_1x_TO&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(flags, mask, timeout)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; (&lt;strong&gt; wait ((flag &amp;amp; mask)!=0) &lt;/strong&gt;) Wait for any bit in flags is set by given mask. Exit if timeout expired.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row19&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_wait_00_to&quot; class=&quot;wikilink2&quot; title=&quot;en:osa:ref:allservices:os_flag_wait_00_to&quot; rel=&quot;nofollow&quot;&gt;OS_Flag_Wait_00_TO&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(flags, mask, timeout)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; (&lt;strong&gt; wait ((flag &amp;amp; mask)==0) &lt;/strong&gt;) Wait for all bits in flag are cleared by given mask. Exit if timeout expired.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row20&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_wait_0x_to&quot; class=&quot;wikilink2&quot; title=&quot;en:osa:ref:allservices:os_flag_wait_0x_to&quot; rel=&quot;nofollow&quot;&gt;OS_Flag_Wait_0x_TO&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(flags, mask, timeout)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; (&lt;strong&gt; wait ((flag &amp;amp; mask)!=mask) &lt;/strong&gt;) Wait for any bit in flag is cleared by given mask. Exit if timeout expired.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Flags&quot; [20221-24986] --&gt;
&lt;h2&gt;&lt;a name=&quot;timers&quot; id=&quot;timers&quot;&gt;Timers&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Timers&quot; [24987-25006] --&gt;
&lt;h3&gt;&lt;a name=&quot;task_timers&quot; id=&quot;task_timers&quot;&gt;Task timers&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0 centeralign&quot;&gt;  Service  &lt;/th&gt;&lt;th class=&quot;col1 centeralign&quot;&gt;  Arguments  &lt;/th&gt;&lt;th class=&quot;col2 centeralign&quot;&gt;  Description  &lt;/th&gt;&lt;th class=&quot;col3 centeralign&quot;&gt;  Properties  &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Control&lt;/strong&gt; &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_ttimer_run&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_ttimer_run&quot;&gt;OS_Ttimer_Run&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(time)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Start counting current task&amp;#039;s timer  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task_plus.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task_plus.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task_plus.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task and functions called by task&quot; alt=&quot;Allowed only in task and functions called by task&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_ttimer_break&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_ttimer_break&quot;&gt;OS_Ttimer_Break&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;()&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Stop and reset current task&amp;#039;s timer. Timeout flag is set.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task_plus.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task_plus.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task_plus.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task and functions called by task&quot; alt=&quot;Allowed only in task and functions called by task&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row4&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_ttimer_wait&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_ttimer_wait&quot;&gt;OS_Ttimer_Wait&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;()&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Wait for current task&amp;#039;s timer overflowed  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row5&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_ttimer_delay&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_ttimer_delay&quot;&gt;OS_Ttimer_Delay&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(delay)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Delay using current task&amp;#039;s timer (same as &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_delay&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_delay&quot;&gt;OS_Delay&lt;/a&gt;&lt;/span&gt;)  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row6&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Checking&lt;/strong&gt;    &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row7&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/description/data_types#ost_ttimer&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:description:data_types&quot;&gt;_OST_TTIMER&lt;/a&gt; &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_ttimer_get&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_ttimer_get&quot;&gt;OS_Ttimer_Get&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;()&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Get current task&amp;#039;s timer&amp;#039;s remaining time  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task_plus.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task_plus.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task_plus.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task and functions called by task&quot; alt=&quot;Allowed only in task and functions called by task&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row8&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_ttimer_check&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_ttimer_check&quot;&gt;OS_Ttimer_Check&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;()&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Check for current task&amp;#039;s timer overflowed  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task_plus.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task_plus.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task_plus.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task and functions called by task&quot; alt=&quot;Allowed only in task and functions called by task&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row9&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_ttimer_isrun&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_ttimer_isrun&quot;&gt;OS_Ttimer_IsRun&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;()&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Check for current task&amp;#039;s timer is counting  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task_plus.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task_plus.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task_plus.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task and functions called by task&quot; alt=&quot;Allowed only in task and functions called by task&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row10&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Additional&lt;/strong&gt;     &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row11&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_ttimer_pause&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_ttimer_pause&quot;&gt;OS_Ttimer_Pause&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;()&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Pause current task&amp;#039;s timer. Overflow bit will be set.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task_plus.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task_plus.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task_plus.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task and functions called by task&quot; alt=&quot;Allowed only in task and functions called by task&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row12&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_ttimer_continue&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_ttimer_continue&quot;&gt;OS_Ttimer_Continue&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;()&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Continue counting after pause  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task_plus.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task_plus.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task_plus.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task and functions called by task&quot; alt=&quot;Allowed only in task and functions called by task&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Task timers&quot; [25007-27749] --&gt;
&lt;h3&gt;&lt;a name=&quot;static_timers&quot; id=&quot;static_timers&quot;&gt;Static timers&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0 centeralign&quot;&gt;  Service  &lt;/th&gt;&lt;th class=&quot;col1 centeralign&quot;&gt;  Arguments  &lt;/th&gt;&lt;th class=&quot;col2 centeralign&quot;&gt;  Description  &lt;/th&gt;&lt;th class=&quot;col3 centeralign&quot;&gt;  Properties  &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Create/Delete&lt;/strong&gt; &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_stimer_alloc&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_stimer_alloc&quot;&gt;OS_Stimer_Alloc&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(var_stimer_id)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Allocate static timer  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_not_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_not_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_not_int.png&quot; class=&quot;media&quot; title=&quot;Not allowed in interrupt&quot; alt=&quot;Not allowed in interrupt&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_stimer_free&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_stimer_free&quot;&gt;OS_Stimer_Free&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(stimer_id)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Free static timer  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_not_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_not_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_not_int.png&quot; class=&quot;media&quot; title=&quot;Not allowed in interrupt&quot; alt=&quot;Not allowed in interrupt&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row4&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_stimer_found&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_stimer_found&quot;&gt;OS_Stimer_Found&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;()&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Check for free timers enable to allocate  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_not_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_not_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_not_int.png&quot; class=&quot;media&quot; title=&quot;Not allowed in interrupt&quot; alt=&quot;Not allowed in interrupt&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row5&quot;&gt;
		&lt;td class=&quot;col0&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Control&lt;/strong&gt; &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row6&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_stimer_run&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_stimer_run&quot;&gt;OS_Stimer_Run&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(stimer_id, time)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Start counting static timer  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row7&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_stimer_break&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_stimer_break&quot;&gt;OS_Stimer_Break&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(stimer_id)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Stop and reset static timer. Timeout flag is set.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row8&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_stimer_wait&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_stimer_wait&quot;&gt;OS_Stimer_Wait&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(stimer_id)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Wait for static timer overflowed  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row9&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_stimer_delay&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_stimer_delay&quot;&gt;OS_Stimer_Delay&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(stimer_id, delay)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Delay current task using static timer  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row10&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Checking&lt;/strong&gt;    &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row11&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/description/data_types#ost_stimer&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:description:data_types&quot;&gt;_OST_STIMER&lt;/a&gt; &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_stimer_get&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_stimer_get&quot;&gt;OS_Stimer_Get&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(stimer_id)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Get static timer&amp;#039;s remaining time  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row12&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_stimer_check&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_stimer_check&quot;&gt;OS_Stimer_Check&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(stimer_id)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Check for static timer overflowed  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row13&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_stimer_isrun&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_stimer_isrun&quot;&gt;OS_Stimer_IsRun&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(stimer_id)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Check for static timer is counting  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row14&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Additional&lt;/strong&gt;     &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row15&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_stimer_pause&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_stimer_pause&quot;&gt;OS_Stimer_Pause&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(stimer_id)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Pause timer. Overflow bit will be set.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row16&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_stimer_continue&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_stimer_continue&quot;&gt;OS_Stimer_Continue&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(stimer_id)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Continue counting after pause  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Static timers&quot; [27750-30608] --&gt;
&lt;h3&gt;&lt;a name=&quot;queue_of_timers&quot; id=&quot;queue_of_timers&quot;&gt;Queue of timers&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0 centeralign&quot;&gt;  Service  &lt;/th&gt;&lt;th class=&quot;col1 centeralign&quot;&gt;  Arguments  &lt;/th&gt;&lt;th class=&quot;col2 centeralign&quot;&gt;  Description  &lt;/th&gt;&lt;th class=&quot;col3 centeralign&quot;&gt;  Properties  &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Creating/Deleting&lt;/strong&gt;    &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_qtimer_create&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_qtimer_create&quot;&gt;OS_Qtimer_Create&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(qtimer)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Add timer in quque of active timers  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_not_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_not_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_not_int.png&quot; class=&quot;media&quot; title=&quot;Not allowed in interrupt&quot; alt=&quot;Not allowed in interrupt&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_qtimer_delete&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_qtimer_delete&quot;&gt;OS_Qtimer_Delete&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(qtimer)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Delete timer from queue of active timers  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_not_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_not_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_not_int.png&quot; class=&quot;media&quot; title=&quot;Not allowed in interrupt&quot; alt=&quot;Not allowed in interrupt&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row4&quot;&gt;
		&lt;td class=&quot;col0&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Control&lt;/strong&gt; &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row5&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_qtimer_run&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_qtimer_run&quot;&gt;OS_Qtimer_Run&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(qtimer, newtime)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Start counting with given &lt;em&gt;newtime&lt;/em&gt;. Timeout flag is cleared.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row6&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_qtimer_break&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_qtimer_break&quot;&gt;OS_Qtimer_Break&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(qtimer)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Stop timer and delete it from queue. Timeout flag became set.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row7&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_qtimer_wait&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_qtimer_wait&quot;&gt;OS_Qtimer_Wait&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(qtimer)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Wait for timer will be overflowed  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row8&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_qtimer_delay&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_qtimer_delay&quot;&gt;OS_Qtimer_Delay&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(qtimer, delay)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Delay current task using timer  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row9&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Checking&lt;/strong&gt;    &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row10&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/description/data_types#ost_qtimer&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:description:data_types&quot;&gt;_OST_QTIMER&lt;/a&gt; &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_qtimer_get&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_qtimer_get&quot;&gt;OS_Qtimer_Get&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(qtimer)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Get dinamic timer&amp;#039;s remaining time.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row11&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_qtimer_check&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_qtimer_check&quot;&gt;OS_Qtimer_Check&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(qtimer)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Check for timer is overflowed  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row12&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_qtimer_isrun&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_qtimer_isrun&quot;&gt;OS_Qtimer_IsRun&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(qtimer)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Check for timer is counting  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Queue of timers&quot; [30609-32879] --&gt;
&lt;h2&gt;&lt;a name=&quot;old_style_timers&quot; id=&quot;old_style_timers&quot;&gt;Old style timers&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Old style timers&quot; [32880-32909] --&gt;
&lt;h3&gt;&lt;a name=&quot;dynamic_timers&quot; id=&quot;dynamic_timers&quot;&gt;Dynamic timers&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0 centeralign&quot;&gt;  Service  &lt;/th&gt;&lt;th class=&quot;col1 centeralign&quot;&gt;  Arguments  &lt;/th&gt;&lt;th class=&quot;col2 centeralign&quot;&gt;  Description  &lt;/th&gt;&lt;th class=&quot;col3 centeralign&quot;&gt;  Properties  &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Creating/Deleting&lt;/strong&gt;    &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_create&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_create&quot;&gt;OS_Dtimer_Create&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(dtimer)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Add dynamic timer in list of active timers  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_not_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_not_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_not_int.png&quot; class=&quot;media&quot; title=&quot;Not allowed in interrupt&quot; alt=&quot;Not allowed in interrupt&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_delete&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_delete&quot;&gt;OS_Dtimer_Delete&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(dtimer)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Delete dynamic timer from list of active timers  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_not_int.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_not_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_not_int.png&quot; class=&quot;media&quot; title=&quot;Not allowed in interrupt&quot; alt=&quot;Not allowed in interrupt&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row4&quot;&gt;
		&lt;td class=&quot;col0&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Control&lt;/strong&gt; &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row5&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_run&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_run&quot;&gt;OS_Dtimer_Run&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(dtimer, newtime)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Start counting with given &lt;em&gt;newtime&lt;/em&gt;. Timeout flag is cleared.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row6&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_break&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_break&quot;&gt;OS_Dtimer_Break&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(dtimer)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Stop dynamic timer. Timeout flag became set.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row7&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_wait&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_wait&quot;&gt;OS_Dtimer_Wait&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(dtimer)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Wait for dynamic timer overflowed  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row8&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_delay&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_delay&quot;&gt;OS_Dtimer_Delay&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(dtimer, delay)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Delay current task using dynamic timer  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row9&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Checking&lt;/strong&gt;    &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row10&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/description/data_types#ost_dtimer&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:description:data_types&quot;&gt;_OST_DTIMER&lt;/a&gt; &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_get&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_get&quot;&gt;OS_Dtimer_Get&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(dtimer)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Get dinamic timer&amp;#039;s remaining time.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row11&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_check&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_check&quot;&gt;OS_Dtimer_Check&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(dtimer)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Check for dynamic timer overflowed  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row12&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_isrun&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_isrun&quot;&gt;OS_Dtimer_IsRun&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(dtimer)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Check for dynamic timer is counting  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row13&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Additional&lt;/strong&gt;     &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row14&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_pause&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_pause&quot;&gt;OS_Dtimer_Pause&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(dtimer)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Stop/pause dynamic timer. Timeout flag remain unchanged.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row15&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_continue&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_continue&quot;&gt;OS_Dtimer_Continue&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(dtimer)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Continue dinamic timer&amp;#039;s counting after pause. Timeout flag remain unchanged.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row16&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_update&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_update&quot;&gt;OS_Dtimer_Update&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(dtimer, time)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Re-run static timer for time &lt;em&gt;time&lt;/em&gt; since last overflow. Timeout flag is cleared.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row17&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_add&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_add&quot;&gt;OS_Dtimer_Add&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(dtimer, addtime)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Increase time of dinamic timer counter. Timeout flag remain unchanged.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row18&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_isactive&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_isactive&quot;&gt;OS_Dtimer_IsActive&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(dtimer)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Check for dynamic timer present in list of active timers  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row19&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_isstopped&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_isstopped&quot;&gt;OS_Dtimer_IsStopped&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(dtimer)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Check for dynamic timer is stopped  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Dynamic timers&quot; [32910-36534] --&gt;
&lt;h3&gt;&lt;a name=&quot;old_style_static_timers_not_recommended_to_use&quot; id=&quot;old_style_static_timers_not_recommended_to_use&quot;&gt;Old style static timers (not recommended to use)&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0 centeralign&quot;&gt;  Service  &lt;/th&gt;&lt;th class=&quot;col1 centeralign&quot;&gt;  Arguments  &lt;/th&gt;&lt;th class=&quot;col2 centeralign&quot;&gt;  Description  &lt;/th&gt;&lt;th class=&quot;col3 centeralign&quot;&gt;  Properties  &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Control&lt;/strong&gt; &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_oldtimer_run8&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_oldtimer_run8&quot;&gt;OS_Oldtimer_Run8&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(timer8_id, time)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Start counting 8-bit timer  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_oldtimer_run16&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_oldtimer_run16&quot;&gt;OS_Oldtimer_Run16&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(timer16_id, time)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Start counting 16-bit timer  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row4&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_oldtimer_run24&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_oldtimer_run24&quot;&gt;OS_Oldtimer_Run24&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(timer24_id, time)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Start counting 24-bit timer  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row5&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_oldtimer_run32&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_oldtimer_run32&quot;&gt;OS_Oldtimer_Run32&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(timer32_id, time)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Start counting 32-bit timer  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row6&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_oldtimer_stop&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_oldtimer_stop&quot;&gt;OS_Oldtimer_Stop&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(timer_id)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Stop/pause static timer. Timeout flag is set.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row7&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Checking&lt;/strong&gt;    &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row8&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_oldtimer_check&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_oldtimer_check&quot;&gt;OS_Oldtimer_Check&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(timer_id)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Chek for static timer overflowed  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row9&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Waiting&lt;/strong&gt;     &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row10&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_oldtimer_wait&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_oldtimer_wait&quot;&gt;OS_Oldtimer_Wait&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(timer_id)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Wait for static timer overflowed  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Abrieflist&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Old style static timers (not recommended to use)&quot; [36535-] --&gt;</description>
    </item>
    <item rdf:about="http://www.pic24.ru/doku.php/en/osa/ref/services/counting_semaphores?rev=1260572439">
        <dc:format>text/html</dc:format>
        <dc:date>2009-12-12T02:00:39+03:00</dc:date>
        <title>OSA : Counting semaphores</title>
        <link>http://www.pic24.ru/doku.php/en/osa/ref/services/counting_semaphores?rev=1260572439</link>
        <description>


&lt;h1&gt;&lt;a name=&quot;osa_counting_semaphores&quot; id=&quot;osa_counting_semaphores&quot;&gt;OSA : Counting semaphores&lt;/a&gt;&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;OSA : Counting semaphores&quot; [1-41] --&gt;
&lt;h2&gt;&lt;a name=&quot;intro&quot; id=&quot;intro&quot;&gt;Intro&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
Counting semaphore is a system variable of type &lt;em&gt;unsigned char&lt;/em&gt;, &lt;em&gt;unsigned int&lt;/em&gt; or &lt;em&gt;unsigned long&lt;/em&gt; (it depends of &lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/appendix/configuration&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:appendix:configuration&quot;&gt;OS_CSEM_SIZE&lt;/a&gt; constant). To use counting semaphores in your program you must define &lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/appendix/configuration&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:appendix:configuration&quot;&gt;OS_ENABLE_CSEM&lt;/a&gt; in &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/appendix/configuration&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:appendix:configuration&quot;&gt;OSAcfg.h&lt;/a&gt;&lt;/span&gt;
&lt;/p&gt;

&lt;p&gt;
General difference between counting and &lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/services/binary_semaphores&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:services:binary_semaphores&quot;&gt;binary&lt;/a&gt; semaphores is that counting semaphore can take any value in range from 0 to maximum type&amp;#039;s value (255, 65535, 4294967295).
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Intro&quot; [42-622] --&gt;
&lt;h2&gt;&lt;a name=&quot;definition&quot; id=&quot;definition&quot;&gt;Definition&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
Here is an example of definition counting semaphore variable:

&lt;/p&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;OST_CSEM  mycsem;&lt;/pre&gt;
&lt;p&gt;
&lt;p&gt;&lt;div class=&quot;noteclassic&quot;&gt;
For &lt;strong&gt;HT-PICC16&lt;/strong&gt; it is allowed to allocate counting semaphores only in &lt;strong&gt;bank0&lt;/strong&gt; and &lt;strong&gt;bank1&lt;/strong&gt;.

&lt;/div&gt;&lt;/p&gt;
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Definition&quot; [623-858] --&gt;
&lt;h2&gt;&lt;a name=&quot;work&quot; id=&quot;work&quot;&gt;Work&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
To work with counting semaphore variable it must be created by service &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_csem_create&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_csem_create&quot;&gt;OS_Csem_Create&lt;/a&gt;&lt;/span&gt;. After creation semaphore is zeroed. The value of counting semaphore can be changed with any service of &lt;strong&gt;set value&lt;/strong&gt; group (see below). When task is waiting for cointing semaphore, it will be put in wait mode while semaphore is zero. Once it&amp;#039;s value becames non-zero, task will be switched in ready mode. After task will get control, semaphore&amp;#039;s value will be decremented by 1.
&lt;/p&gt;

&lt;p&gt;
Attention should be paid that there are two groups of services to change semaphore&amp;#039;s value:
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; to work within task&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; to work within interrupt service routine (these service have prefix &lt;strong&gt;Int&lt;/strong&gt;)&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;

In order to call the services from interrupt, constant &lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/appendix/configuration&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:appendix:configuration&quot;&gt;OS_ENABLE_INT&lt;/a&gt; should be defined in &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/appendix/configuration&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:appendix:configuration&quot;&gt;OSAcfg.h.&lt;/a&gt;&lt;/span&gt;
&lt;/p&gt;

&lt;p&gt;
Few words about service &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_csem_signal&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_csem_signal&quot;&gt;OS_Csem_Signal&lt;/a&gt;&lt;/span&gt;. This service increases semaphore&amp;#039;s value by 1. If semaphore already set at maxiumm, then its value will &lt;strong&gt;remain unchanged&lt;/strong&gt; and &lt;strong&gt;bEventError&lt;/strong&gt; flag will be set.
&lt;/p&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Work&quot; [859-2024] --&gt;
&lt;h2&gt;&lt;a name=&quot;services&quot; id=&quot;services&quot;&gt;Services&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0 centeralign&quot;&gt;  Service  &lt;/th&gt;&lt;th class=&quot;col1 centeralign&quot;&gt;  Arguments  &lt;/th&gt;&lt;th class=&quot;col2 centeralign&quot;&gt;  Description  &lt;/th&gt;&lt;th class=&quot;col3 centeralign&quot;&gt;  Properties  &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Creating&lt;/strong&gt;    &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_csem_create&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_csem_create&quot;&gt;OS_Csem_Create&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(csem)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Create and zero counting semaphore  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_not_int.png?id=en%3Aosa%3Aref%3Aservices%3Acounting_semaphores&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_not_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_not_int.png&quot; class=&quot;media&quot; title=&quot;Not allowed in interrupt&quot; alt=&quot;Not allowed in interrupt&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Menagement&lt;/strong&gt; &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row4&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_csem_signal&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_csem_signal&quot;&gt;OS_Csem_Signal&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(csem)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; Increase counting semaphore&amp;#039;s value by 1 (wait when overflow) &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_not_int.png?id=en%3Aosa%3Aref%3Aservices%3Acounting_semaphores&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_not_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_not_int.png&quot; class=&quot;media&quot; title=&quot;Not allowed in interrupt&quot; alt=&quot;Not allowed in interrupt&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row5&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_csem_signal_now&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_csem_signal_now&quot;&gt;OS_Csem_Signal_Now&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(csem)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; Increase counting semaphore&amp;#039;s value by 1 (don&amp;#039;t wait when overflow) &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Acounting_semaphores&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row6&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_csem_set&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_csem_set&quot;&gt;OS_Csem_Set&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(csem)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Set counting semaphore&amp;#039;s value to 1.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Acounting_semaphores&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row7&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_csem_setvalue&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_csem_setvalue&quot;&gt;OS_Csem_SetValue&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(csem, value)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Set counting semaphore&amp;#039;s value to given &lt;em&gt;value&lt;/em&gt;.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Acounting_semaphores&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row8&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_csem_reset&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_csem_reset&quot;&gt;OS_Csem_Reset&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(csem)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Zero counting semaphore  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Acounting_semaphores&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row9&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Checking&lt;/strong&gt;    &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row10&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_csem_check&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_csem_check&quot;&gt;OS_Csem_Check&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(csem)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Check for counting semaphore is set (not eq. to 0)  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Acounting_semaphores&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row11&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_csem_accept&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_csem_accept&quot;&gt;OS_Csem_Accept&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(csem)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Accept counting semaphore. Decrease it&amp;#039;s value by 1.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Acounting_semaphores&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row12&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Waiting&lt;/strong&gt;     &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row13&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_csem_wait&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_csem_wait&quot;&gt;OS_Csem_Wait&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(csem)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Wait for counting semaphore. Then decrease it&amp;#039;s value by 1  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Acounting_semaphores&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Acounting_semaphores&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row14&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_csem_wait_to&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_csem_wait_to&quot;&gt;OS_Csem_Wait_TO&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(csem, timeout)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Wait for counting semaphore. Then decrease it&amp;#039;s value by 1. Exit if timeout expired  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Acounting_semaphores&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Acounting_semaphores&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Acounting_semaphores&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Services&quot; [2025-] --&gt;</description>
    </item>
    <item rdf:about="http://www.pic24.ru/doku.php/en/osa/ref/services/critical_sections?rev=1260572375">
        <dc:format>text/html</dc:format>
        <dc:date>2009-12-12T01:59:35+03:00</dc:date>
        <title>OSA : Critical sections</title>
        <link>http://www.pic24.ru/doku.php/en/osa/ref/services/critical_sections?rev=1260572375</link>
        <description>


&lt;h1&gt;&lt;a name=&quot;osa_critical_sections&quot; id=&quot;osa_critical_sections&quot;&gt;OSA : Critical sections&lt;/a&gt;&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;OSA : Critical sections&quot; [1-40] --&gt;
&lt;h2&gt;&lt;a name=&quot;intro&quot; id=&quot;intro&quot;&gt;Intro&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;

Critical sections are used to provide task with some resource inseparably when this resource is used by other tasks. For example some task works with EEPROM and entered critical section to avoid EEPROM data modifiation by other tasks.
&lt;/p&gt;

&lt;p&gt;
In fact, this is rare situation for cooperative RTOS because the programmer switchs context manualy, but still this is possible. So OSA have services to protect critical sections of program.
&lt;/p&gt;

&lt;p&gt;
To aviable work woth critical sections you must to define &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/appendix/configuration&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:appendix:configuration&quot;&gt;OS_ENABLE_CRITICAL_SECTION&lt;/a&gt;&lt;/span&gt; constant in &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/appendix/configuration&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:appendix:configuration&quot;&gt;OSAcfg.h.&lt;/a&gt;&lt;/span&gt;
&lt;/p&gt;

&lt;p&gt;
There are two services to protect program&amp;#039;s critical sections:

&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_entercriticalsection&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_entercriticalsection&quot;&gt;OS_EnterCriticalSection&lt;/a&gt;&lt;/span&gt; - to enter critical section&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_leavecriticalsection&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_leavecriticalsection&quot;&gt;OS_LeaveCriticalSection&lt;/a&gt;&lt;/span&gt; - to leave critical section&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;

When entering critical section, all interrupts are disabled (their current value stored in internal system flags). Only one task who called service &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_entercriticalsection&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_entercriticalsection&quot;&gt;OS_EnterCriticalSection&lt;/a&gt;&lt;/span&gt; can get control independent of priority, and all other tasks will be blocked until &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_leavecriticalsection&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_leavecriticalsection&quot;&gt;OS_LeaveCriticalSection&lt;/a&gt;&lt;/span&gt; will be called. When in critical section it still possible to return to schdeuler.
&lt;/p&gt;

&lt;p&gt;
&lt;p&gt;&lt;div class=&quot;noteclassic&quot;&gt;
To work with critical sections you need to know some rules written below

&lt;/div&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Intro&quot; [41-1537] --&gt;
&lt;h2&gt;&lt;a name=&quot;giex_saving&quot; id=&quot;giex_saving&quot;&gt;GIEx saving&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;

Service &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_entercriticasection&quot; class=&quot;wikilink2&quot; title=&quot;en:osa:ref:allservices:os_entercriticasection&quot; rel=&quot;nofollow&quot;&gt;OS_EnterCriticaSection&lt;/a&gt;&lt;/span&gt; saves current GIEx values, and after saving these flags will be cleared. Thus if you call this service twice at one time, then saved GIEx&amp;#039;s value at first call will be overwritten with zeroes at second call since after first call GIEx  have been cleared. &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_leavecriticalsection&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_leavecriticalsection&quot;&gt;OS_LeaveCriticalSection&lt;/a&gt;&lt;/span&gt; in this situation will restore zeroed GIEx saved at second call.
&lt;/p&gt;

&lt;p&gt;
&lt;strong&gt;Avoid calling service &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_entercriticalsection&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_entercriticalsection&quot;&gt;OS_EnterCriticalSection&lt;/a&gt;&lt;/span&gt; twice at one time.&lt;/strong&gt;
&lt;/p&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;GIEx saving&quot; [1538-2181] --&gt;
&lt;h2&gt;&lt;a name=&quot;timers&quot; id=&quot;timers&quot;&gt;Timers&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;

You will be able to use task delays (&lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_delay&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_delay&quot;&gt;OS_Delay&lt;/a&gt;&lt;/span&gt;) and waiting with timeout services only if &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_timer&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_timer&quot;&gt;OS_Timer&lt;/a&gt;&lt;/span&gt; is called not from interrupt (since interrupts are disabled while in critical section). There are two wais of solving this problem:
&lt;/p&gt;
&lt;ol&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; To enable interrupts manualy after entering critical section (if program architecture allows to use interrupts while in critical section)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; To dublicate call of &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_timer&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_timer&quot;&gt;OS_Timer&lt;/a&gt;&lt;/span&gt; in main cycle (near &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_sched&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_sched&quot;&gt;OS_Sched&lt;/a&gt;&lt;/span&gt;). See example below:&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; interrupt int_routine &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    OS_EnterInt&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
    &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;TMR2IF&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;       &lt;span class=&quot;co1&quot;&gt;// This code will not work in critical section&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
         TMR2IF &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu19&quot;&gt;0&lt;/span&gt;;
         OS_Timer&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;  &lt;span class=&quot;co1&quot;&gt;// This service will be called only outside critical section&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    OS_LeaveInt&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; Task1 &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;;;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        . . .
        &lt;span class=&quot;me1&quot;&gt;OS_EnterCriticalSection&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        OS_Delay&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        OS_LeaveCriticalSection&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        . . .
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; main &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    OS_Init&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
    OS_Task_Create&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu19&quot;&gt;0&lt;/span&gt;, Task1&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
    &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;;;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        OS_Sched&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;OS_IsInCriticalSection&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
            &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;TMR2IF&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
                TMR2IF &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu19&quot;&gt;0&lt;/span&gt;;
                OS_Timer&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;    &lt;span class=&quot;co1&quot;&gt;// This service will be called within critical section&lt;/span&gt;
            &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
        &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Timers&quot; [2182-3588] --&gt;
&lt;h2&gt;&lt;a name=&quot;wait_for_events&quot; id=&quot;wait_for_events&quot;&gt;Wait for events&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;

All task except one (who called &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_entercriticalsection&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_entercriticalsection&quot;&gt;OS_EnterCriticalSection&lt;/a&gt;&lt;/span&gt;) are blocked even if their priority is highest and they are ready to run. Thus if task enters critical section and then waits for event that occures in other task, then system will be looped. To avoid this you can first awaiting an event and then enter critical section.
&lt;/p&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; Task1 &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;;;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        . . .
        &lt;span class=&quot;co1&quot;&gt;// Incorrect&lt;/span&gt;
        OS_EnterCriticalSection&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        OS_Bsem_Wait&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;BS_USART_FREE&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        . . .
        &lt;span class=&quot;co1&quot;&gt;// Correct&lt;/span&gt;
        OS_Bsem_Wait&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;BS_USART_FREE&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        OS_EnterCriticalSection&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        . . .
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Wait for events&quot; [3589-4296] --&gt;
&lt;h2&gt;&lt;a name=&quot;services&quot; id=&quot;services&quot;&gt;Services&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0 centeralign&quot;&gt;  Service  &lt;/th&gt;&lt;th class=&quot;col1 centeralign&quot;&gt;  Arguments  &lt;/th&gt;&lt;th class=&quot;col2 centeralign&quot;&gt;  Description  &lt;/th&gt;&lt;th class=&quot;col3 centeralign&quot;&gt;  Properties  &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_isincriticalsection&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_isincriticalsection&quot;&gt;OS_IsInCriticalSection&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Return true if one of task is in critical section  &lt;/td&gt;&lt;td class=&quot;col3 rightalign&quot;&gt;   &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_entercriticalsection&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_entercriticalsection&quot;&gt;OS_EnterCriticalSection&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Enter critical section  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Acritical_sections&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_leavecriticalsection&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_leavecriticalsection&quot;&gt;OS_LeaveCriticalSection&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Leave critical section  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Acritical_sections&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Services&quot; [4297-] --&gt;</description>
    </item>
    <item rdf:about="http://www.pic24.ru/doku.php/en/osa/ref/services/flags?rev=1267250632">
        <dc:format>text/html</dc:format>
        <dc:date>2010-02-27T09:03:52+03:00</dc:date>
        <title>OSA : Flags</title>
        <link>http://www.pic24.ru/doku.php/en/osa/ref/services/flags?rev=1267250632</link>
        <description>


&lt;h1&gt;&lt;a name=&quot;osa_flags&quot; id=&quot;osa_flags&quot;&gt;OSA : Flags&lt;/a&gt;&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;OSA : Flags&quot; [1-27] --&gt;
&lt;h2&gt;&lt;a name=&quot;intro&quot; id=&quot;intro&quot;&gt;Intro&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;

Flags are similar to binary semaphores. There are two differences:
&lt;/p&gt;
&lt;ol&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; you can wait, check, set or reset several flags at one time;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; after accepting flags their values do not change.&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;

The using of flags can be usefull when task requires the results of several tasks. For example to calculate some physical parameters task needs information about the temperature, pressure and humidity. Each of these parameters is measured in it&amp;#039;s own task and set flag when measuring is complete.
&lt;/p&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span class=&quot;co2&quot;&gt;#include &amp;lt;osa.h&amp;gt;&lt;/span&gt;
&amp;nbsp;
OST_FLAG8   F_Sensors;
&amp;nbsp;
&lt;span class=&quot;co2&quot;&gt;#define  TEMPERATURE_MEASURED   0x01&lt;/span&gt;
&lt;span class=&quot;co2&quot;&gt;#define  PRESSURE_MEASURED      0x02&lt;/span&gt;
&lt;span class=&quot;co2&quot;&gt;#define  HUMIDITY_MEASURED      0x04&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; Task_Calc &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;;;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        &lt;span class=&quot;co1&quot;&gt;// Wait for all measurings complete&lt;/span&gt;
        OS_Flag_Wait_11&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;F_Sensors, TEMPERATURE_MEASURED | PRESSURE_MEASURED | HUMIDITY_MEASURED&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        OS_Flag_Set_0&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;F_Sensors, TEMPERATURE_MEASURED | PRESSURE_MEASURED | HUMIDITY_MEASURED&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
        &lt;span class=&quot;co1&quot;&gt;// Now we can to calculate&lt;/span&gt;
        ...
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Intro&quot; [28-1048] --&gt;
&lt;h2&gt;&lt;a name=&quot;definition&quot; id=&quot;definition&quot;&gt;Definition&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;

There are three types of flags: 8-, 16- and 32-bit.
&lt;/p&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;OST_FLAG      MyFlag1;	&lt;span class=&quot;co1&quot;&gt;//  8-bit flags&lt;/span&gt;
OST_FLAG16    MyFlag2;	&lt;span class=&quot;co1&quot;&gt;// 16-bit flags&lt;/span&gt;
OST_FLAG32    MyFlag3;	&lt;span class=&quot;co1&quot;&gt;// 32-bit flags&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;

It is possible to use defferent size of flags at one time.
&lt;/p&gt;

&lt;p&gt;
Flags can be allocated in any memory bank, i.e.:

&lt;/p&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;bank2    OST_FLAG16   MyFlag;&lt;/pre&gt;&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Definition&quot; [1049-1430] --&gt;
&lt;h2&gt;&lt;a name=&quot;services&quot; id=&quot;services&quot;&gt;Services&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0 centeralign&quot;&gt;  Service  &lt;/th&gt;&lt;th class=&quot;col1 centeralign&quot;&gt;  Arguments  &lt;/th&gt;&lt;th class=&quot;col2 centeralign&quot;&gt;  Description  &lt;/th&gt;&lt;th class=&quot;col3 centeralign&quot;&gt;  Properties  &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Creating&lt;/strong&gt;    &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_create&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_flag_create&quot;&gt;OS_Flag_Create&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(flags)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; (&lt;strong&gt;flag = 0&lt;/strong&gt;) Create flag and clear all it&amp;#039;s bits (&lt;strong&gt;flag = 0&lt;/strong&gt;)  &lt;/td&gt;&lt;td class=&quot;col3 rightalign&quot;&gt;   &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Menagement&lt;/strong&gt; &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row4&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_init&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_flag_init&quot;&gt;OS_Flag_Init&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(flags, value)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; (&lt;strong&gt;flag = value&lt;/strong&gt;) Set flag to givel value  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Aflags&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row5&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_set_1&quot; class=&quot;wikilink2&quot; title=&quot;en:osa:ref:allservices:os_flag_set_1&quot; rel=&quot;nofollow&quot;&gt;OS_Flag_Set_1&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(flags, mask)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; (&lt;strong&gt;flag = flags&lt;/strong&gt; | &lt;strong&gt;mask&lt;/strong&gt;) Set bits in flag by given mask  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Aflags&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row6&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_set_0&quot; class=&quot;wikilink2&quot; title=&quot;en:osa:ref:allservices:os_flag_set_0&quot; rel=&quot;nofollow&quot;&gt;OS_Flag_Set_0&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(flags, mask)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; (&lt;strong&gt;flag &amp;amp;= ~mask&lt;/strong&gt;) Clear bits in flag by given mask  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Aflags&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row7&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Checking&lt;/strong&gt;    &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row8&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_check_11&quot; class=&quot;wikilink2&quot; title=&quot;en:osa:ref:allservices:os_flag_check_11&quot; rel=&quot;nofollow&quot;&gt;OS_Flag_Check_11&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(flags, mask)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; (&lt;strong&gt; if ((flag &amp;amp; mask)==mask) &lt;/strong&gt;) Check for all bits in flags are set by given mask  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Aflags&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row9&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_check_1x&quot; class=&quot;wikilink2&quot; title=&quot;en:osa:ref:allservices:os_flag_check_1x&quot; rel=&quot;nofollow&quot;&gt;OS_Flag_Check_1x&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(flags, mask)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; (&lt;strong&gt; if ((flag &amp;amp; mask)!=0) &lt;/strong&gt;) Check for any bit in flags is set by given mask  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Aflags&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row10&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_check_00&quot; class=&quot;wikilink2&quot; title=&quot;en:osa:ref:allservices:os_flag_check_00&quot; rel=&quot;nofollow&quot;&gt;OS_Flag_Check_00&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(flags, mask)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; (&lt;strong&gt; if ((flag &amp;amp; mask)==0) &lt;/strong&gt;) Check for all bits in flag are cleared by given mask  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Aflags&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row11&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_check_0x&quot; class=&quot;wikilink2&quot; title=&quot;en:osa:ref:allservices:os_flag_check_0x&quot; rel=&quot;nofollow&quot;&gt;OS_Flag_Check_0x&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(flags, mask)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; (&lt;strong&gt; if ((flag &amp;amp; mask)!=mask) &lt;/strong&gt;) Check for any bit in flag is cleared by given mask  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Aflags&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row12&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Waiting&lt;/strong&gt;     &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row13&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_wait_11&quot; class=&quot;wikilink2&quot; title=&quot;en:osa:ref:allservices:os_flag_wait_11&quot; rel=&quot;nofollow&quot;&gt;OS_Flag_Wait_11&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(flags, mask)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; (&lt;strong&gt; if ((flag &amp;amp; mask)==mask) &lt;/strong&gt;) Wait for all bits in flags are set by given mask  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Aflags&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Aflags&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row14&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_wait_1x&quot; class=&quot;wikilink2&quot; title=&quot;en:osa:ref:allservices:os_flag_wait_1x&quot; rel=&quot;nofollow&quot;&gt;OS_Flag_Wait_1x&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(flags, mask)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; (&lt;strong&gt; wait ((flag &amp;amp; mask)!=0) &lt;/strong&gt;) Wait for any bit in flags is set by given mask  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Aflags&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Aflags&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row15&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_wait_00&quot; class=&quot;wikilink2&quot; title=&quot;en:osa:ref:allservices:os_flag_wait_00&quot; rel=&quot;nofollow&quot;&gt;OS_Flag_Wait_00&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(flags, mask)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; (&lt;strong&gt; wait ((flag &amp;amp; mask)==0) &lt;/strong&gt;) Wait for all bits in flag are cleared by given mask  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Aflags&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Aflags&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row16&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_wait_0x&quot; class=&quot;wikilink2&quot; title=&quot;en:osa:ref:allservices:os_flag_wait_0x&quot; rel=&quot;nofollow&quot;&gt;OS_Flag_Wait_0x&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(flags, mask)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; (&lt;strong&gt; wait ((flag &amp;amp; mask)!=mask) &lt;/strong&gt;) Wait for any bit in flag is cleared by given mask  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Aflags&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Aflags&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row17&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_wait_11_to&quot; class=&quot;wikilink2&quot; title=&quot;en:osa:ref:allservices:os_flag_wait_11_to&quot; rel=&quot;nofollow&quot;&gt;OS_Flag_Wait_11_TO&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(flags, mask, timeout)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; (&lt;strong&gt; wait ((flag &amp;amp; mask)==mask) &lt;/strong&gt;) Wait for all bits in flags are set by given mask. Exit if timeout expired.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Aflags&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Aflags&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Aflags&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row18&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_wait_1x_to&quot; class=&quot;wikilink2&quot; title=&quot;en:osa:ref:allservices:os_flag_wait_1x_to&quot; rel=&quot;nofollow&quot;&gt;OS_Flag_Wait_1x_TO&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(flags, mask, timeout)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; (&lt;strong&gt; wait ((flag &amp;amp; mask)!=0) &lt;/strong&gt;) Wait for any bit in flags is set by given mask. Exit if timeout expired.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Aflags&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Aflags&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Aflags&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row19&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_wait_00_to&quot; class=&quot;wikilink2&quot; title=&quot;en:osa:ref:allservices:os_flag_wait_00_to&quot; rel=&quot;nofollow&quot;&gt;OS_Flag_Wait_00_TO&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(flags, mask, timeout)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; (&lt;strong&gt; wait ((flag &amp;amp; mask)==0) &lt;/strong&gt;) Wait for all bits in flag are cleared by given mask. Exit if timeout expired.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Aflags&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Aflags&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Aflags&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row20&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_flag_wait_0x_to&quot; class=&quot;wikilink2&quot; title=&quot;en:osa:ref:allservices:os_flag_wait_0x_to&quot; rel=&quot;nofollow&quot;&gt;OS_Flag_Wait_0x_TO&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(flags, mask, timeout)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; (&lt;strong&gt; wait ((flag &amp;amp; mask)!=mask) &lt;/strong&gt;) Wait for any bit in flag is cleared by given mask. Exit if timeout expired.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Aflags&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Aflags&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Aflags&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Services&quot; [1431-] --&gt;</description>
    </item>
    <item rdf:about="http://www.pic24.ru/doku.php/en/osa/ref/services/intro?rev=1286445521">
        <dc:format>text/html</dc:format>
        <dc:date>2010-10-07T13:58:41+03:00</dc:date>
        <title>OSA : SERVICES</title>
        <link>http://www.pic24.ru/doku.php/en/osa/ref/services/intro?rev=1286445521</link>
        <description></description>
    </item>
    <item rdf:about="http://www.pic24.ru/doku.php/en/osa/ref/services/mesage_queues?rev=1260572745">
        <dc:format>text/html</dc:format>
        <dc:date>2009-12-12T02:05:45+03:00</dc:date>
        <title>OSA : Message queues</title>
        <link>http://www.pic24.ru/doku.php/en/osa/ref/services/mesage_queues?rev=1260572745</link>
        <description>


&lt;h1&gt;&lt;a name=&quot;osa_message_queues&quot; id=&quot;osa_message_queues&quot;&gt;OSA : Message queues&lt;/a&gt;&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;OSA : Message queues&quot; [1-37] --&gt;
&lt;h2&gt;&lt;a name=&quot;intro&quot; id=&quot;intro&quot;&gt;Intro&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;

The message queue is most universal tool to data exchange between tasks. Queue allow to send next message before previous was received. There are two types of queues in OSA: for pointers to messages and for simple byte messages.
&lt;/p&gt;

&lt;p&gt;
To use queues in you program you have to define constants in &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/appendix/configuration&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:appendix:configuration&quot;&gt;OSAcfg.h&lt;/a&gt;&lt;/span&gt;:
&lt;/p&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span class=&quot;co2&quot;&gt;#define OS_ENABLE_QUEUE&lt;/span&gt;
                          &lt;span class=&quot;co1&quot;&gt;// To use queues of pointers to messages&lt;/span&gt;
&lt;span class=&quot;co2&quot;&gt;#define OS_ENABLE_SQUEUE&lt;/span&gt;
                          &lt;span class=&quot;co1&quot;&gt;// To use queues of simple byte messages&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;
When theese constants defined, compiler inserts functions to work with queue in you code.
&lt;/p&gt;

&lt;p&gt;
Queues are declared through variables of queue type: &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/description/data_types#ost_queue&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:description:data_types&quot;&gt;OST_QUEUE&lt;/a&gt;&lt;/span&gt; and &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/description/data_types#ost_squeue&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:description:data_types&quot;&gt;OST_SQUEUE&lt;/a&gt;&lt;/span&gt;:
&lt;/p&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;OST_QUEUE  queue;    &lt;span class=&quot;co1&quot;&gt;// Declare queue of pointer to messages&lt;/span&gt;
OST_SQUEUE squeue;   &lt;span class=&quot;co1&quot;&gt;// Declare queue of simple byte messages&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;
Variable of &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/description/data_types#ost_queue&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:description:data_types&quot;&gt;OST_QUEUE&lt;/a&gt;&lt;/span&gt; (or &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/description/data_types#ost_squeue&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:description:data_types&quot;&gt;OST_SQUEUE&lt;/a&gt;&lt;/span&gt;) type contains information of queue size, number of existing messages and pointer to buffer of messages.
Buffer of messages is an array in RAM where sent messages will be stored to:
&lt;/p&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;OST_MSG   msg_queue&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;;         &lt;span class=&quot;co1&quot;&gt;// Buffer for 10 pointer to messages&lt;/span&gt;
OST_SMSG  smsg_queue&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;15&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;;        &lt;span class=&quot;co1&quot;&gt;// Buffer for 15 simple byte messages&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;
To work with queue we have to create it by service &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_queue_create&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_queue_create&quot;&gt;OS_Queue_Create&lt;/a&gt;&lt;/span&gt; (or &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_squeue_create&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_squeue_create&quot;&gt;OS_Squeue_Create&lt;/a&gt;&lt;/span&gt;):

&lt;/p&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;    OS_Queue_Create&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;queue, msg_queue, &lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;  &lt;span class=&quot;co1&quot;&gt;// Create queue of 10 pointer to messages.&lt;/span&gt;
                                         &lt;span class=&quot;co1&quot;&gt;// Sent messages will be stored in msg_queue array&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;
After creating queue we can send and accept messages through queue.
&lt;/p&gt;

&lt;p&gt;
&lt;p&gt;&lt;div class=&quot;noteclassic&quot;&gt;
For &lt;strong&gt;PIC16&lt;/strong&gt; queue descriptor and message buffer can be allocated in &lt;strong&gt;bank0&lt;/strong&gt; and &lt;strong&gt;bank1&lt;/strong&gt; only.

&lt;/div&gt;&lt;/p&gt;
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Intro&quot; [38-2078] --&gt;
&lt;h3&gt;&lt;a name=&quot;combination&quot; id=&quot;combination&quot;&gt;Combination&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;

When it is supposed that sizes of &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/description/data_types#ost_msg&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:description:data_types&quot;&gt;OST_MSG&lt;/a&gt;&lt;/span&gt; and &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/description/data_types#ost_smsg&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:description:data_types&quot;&gt;OST_SMSG&lt;/a&gt;&lt;/span&gt; are same, we can to combine queue functions. This will reduce ROM usage. To do it we have to define constant in &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/appendix/configuration&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:appendix:configuration&quot;&gt;OSAcfg.h&lt;/a&gt;&lt;/span&gt;:
&lt;/p&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span class=&quot;co2&quot;&gt;#define OS_QUEUE_SQUEUE_IDENTICAL&lt;/span&gt;&lt;/pre&gt;&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Combination&quot; [2079-2485] --&gt;
&lt;h2&gt;&lt;a name=&quot;services&quot; id=&quot;services&quot;&gt;Services&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Services&quot; [2486-2507] --&gt;
&lt;h3&gt;&lt;a name=&quot;queue_of_pointers_to_message&quot; id=&quot;queue_of_pointers_to_message&quot;&gt;Queue of pointers to message&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0 centeralign&quot;&gt;  Service  &lt;/th&gt;&lt;th class=&quot;col1 centeralign&quot;&gt;  Arguments  &lt;/th&gt;&lt;th class=&quot;col2 centeralign&quot;&gt;  Description  &lt;/th&gt;&lt;th class=&quot;col3 centeralign&quot;&gt;  Properties  &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Creating&lt;/strong&gt;    &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_queue_create&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_queue_create&quot;&gt;OS_Queue_Create&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(queue, buffer, size)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Create and clear queue.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_not_int.png?id=en%3Aosa%3Aref%3Aservices%3Amesage_queues&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_not_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_not_int.png&quot; class=&quot;media&quot; title=&quot;Not allowed in interrupt&quot; alt=&quot;Not allowed in interrupt&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Sending&lt;/strong&gt;     &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row4&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_queue_send&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_queue_send&quot;&gt;OS_Queue_Send&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(queue, message)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Send message via queue. If queue full then wait for free place  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Amesage_queues&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Amesage_queues&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row5&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_queue_send_to&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_queue_send_to&quot;&gt;OS_Queue_Send_TO&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(queue, message, timeout)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Send message via queue. If queue full then wait for free place. Exit if timeout expired.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Amesage_queues&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Amesage_queues&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Amesage_queues&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row6&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_queue_send_now&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_queue_send_now&quot;&gt;OS_Queue_Send_Now&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(queue, message)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Send message via queue. If queue is full then most rearly message will be pushed out.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Amesage_queues&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row7&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Checking&lt;/strong&gt;    &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row8&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_queue_check&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_queue_check&quot;&gt;OS_Queue_Check&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(queue)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Check for there is any message in queue.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Amesage_queues&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row9&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_queue_isfull&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_queue_isfull&quot;&gt;OS_Queue_IsFull&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(queue)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Check for queue of messages is full.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Amesage_queues&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row10&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_queue_isempty&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_queue_isempty&quot;&gt;OS_Queue_IsEmpty&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(queue)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Check for queue of messages is empty.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Amesage_queues&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row11&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Waiting&lt;/strong&gt;     &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row12&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_queue_wait&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_queue_wait&quot;&gt;OS_Queue_Wait&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(queue, os_msg_type_var)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Wait message from queue. After accepting message will be deleted from queue.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Amesage_queues&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Amesage_queues&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row13&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_queue_wait_to&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_queue_wait_to&quot;&gt;OS_Queue_Wait_TO&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(queue, os_msg_type_var, timeout)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Wait message from queue. After accepting message will be deleted from queue. Exit if timeout expired.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Amesage_queues&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Amesage_queues&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Amesage_queues&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Queue of pointers to message&quot; [2508-5125] --&gt;
&lt;h3&gt;&lt;a name=&quot;queue_of_simple_messages&quot; id=&quot;queue_of_simple_messages&quot;&gt;Queue of simple messages&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0 centeralign&quot;&gt;  Service  &lt;/th&gt;&lt;th class=&quot;col1 centeralign&quot;&gt;  Arguments  &lt;/th&gt;&lt;th class=&quot;col2 centeralign&quot;&gt;  Description  &lt;/th&gt;&lt;th class=&quot;col3 centeralign&quot;&gt;  Properties  &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Creating&lt;/strong&gt;    &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_squeue_create&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_squeue_create&quot;&gt;OS_Squeue_Create&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(squeue, buffer, size)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Create and clear queue.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_not_int.png?id=en%3Aosa%3Aref%3Aservices%3Amesage_queues&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_not_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_not_int.png&quot; class=&quot;media&quot; title=&quot;Not allowed in interrupt&quot; alt=&quot;Not allowed in interrupt&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Sending&lt;/strong&gt;     &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row4&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_squeue_send&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_squeue_send&quot;&gt;OS_Squeue_Send&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(squeue, smessage)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Send simple message via queue. If queue full then wait for free place  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Amesage_queues&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Amesage_queues&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row5&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_squeue_send_to&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_squeue_send_to&quot;&gt;OS_Squeue_Send_TO&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(squeue, smessage, timeout)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Send message via queue. If queue full then wait for free place. Exit if timeout expired.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Amesage_queues&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Amesage_queues&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Amesage_queues&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row6&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_squeue_send_now&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_squeue_send_now&quot;&gt;OS_Squeue_Send_Now&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(squeue, smessage)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Send message via queue. If queue is full then most rearly message will be pushed out.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Amesage_queues&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row7&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Checking&lt;/strong&gt;    &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row8&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_squeue_check&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_squeue_check&quot;&gt;OS_Squeue_Check&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(squeue)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Check for there is any simple message in queue.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Amesage_queues&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row9&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_squeue_isfull&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_squeue_isfull&quot;&gt;OS_Squeue_IsFull&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(squeue)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Check for queue of simple messages is full.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Amesage_queues&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row10&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_squeue_isempty&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_squeue_isempty&quot;&gt;OS_Squeue_IsEmpty&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(squeue)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Check for queue of simple messages is empty.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Amesage_queues&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row11&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Waiting&lt;/strong&gt;     &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row12&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_squeue_wait&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_squeue_wait&quot;&gt;OS_Squeue_Wait&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(squeue, os_smsg_type_var)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Wait message from queue. After accepting message will be deleted from queue.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Amesage_queues&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Amesage_queues&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row13&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_squeue_wait_to&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_squeue_wait_to&quot;&gt;OS_Squeue_Wait_TO&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(squeue, os_smsg_type_var, timeout)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Wait message from queue. After accepting message will be deleted from queue. Exit if timeout expired.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Amesage_queues&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Amesage_queues&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Amesage_queues&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Queue of simple messages&quot; [5126-] --&gt;</description>
    </item>
    <item rdf:about="http://www.pic24.ru/doku.php/en/osa/ref/services/messages?rev=1265042163">
        <dc:format>text/html</dc:format>
        <dc:date>2010-02-01T19:36:03+03:00</dc:date>
        <title>OSA : Messages</title>
        <link>http://www.pic24.ru/doku.php/en/osa/ref/services/messages?rev=1265042163</link>
        <description>


&lt;h1&gt;&lt;a name=&quot;osa_messages&quot; id=&quot;osa_messages&quot;&gt;OSA : Messages&lt;/a&gt;&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;OSA : Messages&quot; [1-30] --&gt;
&lt;h2&gt;&lt;a name=&quot;intro&quot; id=&quot;intro&quot;&gt;Intro&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;

Messages is one of way to exchange data between tasks. The message can contain any information: data from USART, external sensorv values, buttons and switches state, ect. There are two types of messages in OSA: &lt;strong&gt;pointers to messages&lt;/strong&gt; and &lt;strong&gt;simple byte messages&lt;/strong&gt;.
&lt;/p&gt;

&lt;p&gt;
&lt;strong&gt;Pointer to messages&lt;/strong&gt; are most universal. Through this type of messages user can send any information of any size. Task send only pointer to this information.
&lt;/p&gt;

&lt;p&gt;
&lt;strong&gt;Simple byte messages&lt;/strong&gt; can accept values form 1 to 255 (0 - message absent). This type of message is realized in OSA to reduce memory usage. Simple byte message needs 1 byte of RAM (pointer to message needs 2 bytes for PIC10, PIC12 and PIC16 and 3 bytes for other).
&lt;/p&gt;

&lt;p&gt;
The message can be in on of two states: &lt;strong&gt;free&lt;/strong&gt; (or &lt;strong&gt;absent&lt;/strong&gt;) and &lt;strong&gt;busy&lt;/strong&gt; (or &lt;strong&gt;existing&lt;/strong&gt;). If message contains information, then it is &lt;strong&gt;existing&lt;/strong&gt;, else it is &lt;strong&gt;free&lt;/strong&gt;.
&lt;/p&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Intro&quot; [31-932] --&gt;
&lt;h2&gt;&lt;a name=&quot;pointers_to_messages&quot; id=&quot;pointers_to_messages&quot;&gt;Pointers to messages&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;

By default the type of pointer to message is &lt;em&gt;void*&lt;/em&gt;. User can change it by defining &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/description/data_types#ost_msg&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:description:data_types&quot;&gt;OST_MSG&lt;/a&gt;&lt;/span&gt; type in &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/appendix/configuration&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:appendix:configuration&quot;&gt;OSAcfg.h.&lt;/a&gt;&lt;/span&gt;:
&lt;/p&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span class=&quot;co2&quot;&gt;#define OS_MSG_TYPE   const char *&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;
In this example we tell to compiller that pointer to message will point to data in ROM.
&lt;/p&gt;

&lt;p&gt;
To work with pointer to message we have to create it by service &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_msg_create&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_msg_create&quot;&gt;OS_Msg_Create&lt;/a&gt;&lt;/span&gt;.
&lt;/p&gt;

&lt;p&gt;
There are three services to send message: &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_msg_send&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_msg_send&quot;&gt;OS_Msg_Send&lt;/a&gt;&lt;/span&gt;, &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_msg_send_to&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_msg_send_to&quot;&gt;OS_Msg_Send_TO&lt;/a&gt;&lt;/span&gt; and &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_msg_send_now&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_msg_send_now&quot;&gt;OS_Msg_Send_Now&lt;/a&gt;&lt;/span&gt;.
&lt;/p&gt;

&lt;p&gt;
&lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_msg_send&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_msg_send&quot;&gt;OS_Msg_Send&lt;/a&gt;&lt;/span&gt; first checks for message is free. If it is busy (i.e. previous message was not received by another task yet) then task put in wait state while message will not became free. If message is free, then it can be sent immediately.
&lt;/p&gt;

&lt;p&gt;
&lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_msg_send_to&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_msg_send_to&quot;&gt;OS_Msg_Send_TO&lt;/a&gt;&lt;/span&gt; - same as &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_msg_send&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_msg_send&quot;&gt;OS_Msg_Send&lt;/a&gt;&lt;/span&gt; with exit if timeout expired while waiting for message is free.
&lt;/p&gt;

&lt;p&gt;
&lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_msg_send_now&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_msg_send_now&quot;&gt;OS_Msg_Send_Now&lt;/a&gt;&lt;/span&gt; sends message immediately regardless of current message state. If message was busy before calling this service, then it will be overwritten by new data, and system flag &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_iseventerror&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_iseventerror&quot;&gt;OS_IsEventError&lt;/a&gt;&lt;/span&gt; will be set.
&lt;/p&gt;

&lt;p&gt;

Here is a small example of using pointer to message:
&lt;/p&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;OST_MSG_CB    msg_cb;
&amp;nbsp;
&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; Task_USARTReceive &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt; BUF&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;;        &lt;span class=&quot;co1&quot;&gt;// Buffer for received data from UART&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt; Message&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;;    &lt;span class=&quot;co1&quot;&gt;// Message body&lt;/span&gt;
&amp;nbsp;
    OS_Msg_Create&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;msg_cb&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;         &lt;span class=&quot;co1&quot;&gt;// First we create message&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;;;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        ...
        &lt;span class=&quot;co1&quot;&gt;// Receiving UART data&lt;/span&gt;
        ...
        &lt;span class=&quot;co1&quot;&gt;// Wait for message became free&lt;/span&gt;
        OS_Cond_Wait&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;OS_Msg_Check&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;msg_cb&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        &lt;span class=&quot;co1&quot;&gt;// When we get here we can be sure that previous message was accepted by another task&lt;/span&gt;
        &lt;span class=&quot;co1&quot;&gt;// and Message[] array does not contain any information.&lt;/span&gt;
&amp;nbsp;
        &lt;span class=&quot;co1&quot;&gt;// Copying received data to message buffer&lt;/span&gt;
        &lt;span class=&quot;kw3&quot;&gt;memcpy&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;Message, BUF, &lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        &lt;span class=&quot;co1&quot;&gt;// and sending message&lt;/span&gt;
        OS_Msg_Send&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;msg_cb, &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;OST_MSG&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;Message&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        ...
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
. . .
&amp;nbsp;
&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; Task_Work &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    OST_MSG msg;
    &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;;;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        &lt;span class=&quot;co1&quot;&gt;// Waiting for message&lt;/span&gt;
        OS_Msg_Wait&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;msg_cb, msg&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
&amp;nbsp;
        &lt;span class=&quot;co1&quot;&gt;// Now msg points to array Message from Task_USARTReceive&lt;/span&gt;
        &lt;span class=&quot;co1&quot;&gt;// After service OS_Msg_Wait message msg_cb becames free&lt;/span&gt;
        ...
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Pointers to messages&quot; [933-3550] --&gt;
&lt;h2&gt;&lt;a name=&quot;simple_byte_messages&quot; id=&quot;simple_byte_messages&quot;&gt;Simple byte messages&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;

By default type of simple byte message is &lt;em&gt;unsigned char&lt;/em&gt;. However user can change type of message by defining &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/description/data_types#ost_smsg&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:description:data_types&quot;&gt;OST_SMSG&lt;/a&gt;&lt;/span&gt; in &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/appendix/configuration&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:appendix:configuration&quot;&gt;OSAcfg.h&lt;/a&gt;&lt;/span&gt;:
&lt;/p&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span class=&quot;co2&quot;&gt;#define OS_SMSG_TYPE    unsigned long  // change SMSG type&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;
Changing type of simple message we lossing advantage in RAM usage. But it can be usefull in some cases. I.e. when we using pointer to message, we can&amp;#039;t modify memory where body of message placed until message will be accepted (array Message[] in previous example). When we using simple message this restriction removed because body of message copied in message variable.
&lt;/p&gt;

&lt;p&gt;
&lt;p&gt;&lt;div class=&quot;noteclassic&quot;&gt;
You can not use structures, arrays and unions as type of simple messages. Only enumerabletypes can be used: char, int, long, bit, float and double.

&lt;/div&gt;&lt;/p&gt;
&lt;/p&gt;

&lt;p&gt;
Work with simple messages is similar to pointer to messages. Here is an example of simple byte message using:
&lt;/p&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;OST_SMSG  smsg_Buttons;
. . .
&amp;nbsp;
&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; Task_Buttons &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    OS_Smsg_Create&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;smsg_Buttons&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
    &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;;;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        . . .
        &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;RB0 || &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;RB1 || &lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;RB2&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
            OS_Smsg_Send&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;smsg_Buttons, &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;OST_SMSG&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;PORTB &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0x07&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        ...
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
...
&amp;nbsp;
&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; Task_Work &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    OST_SMSG smsg;
    &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;;;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        OS_Smsg_Wait&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;smsg_Buttons, smsg&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
        &lt;span class=&quot;co1&quot;&gt;// Processing pressed button&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;smsg &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0x01&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; ...;
        &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;smsg &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0x02&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; ...;
        &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;smsg &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0x04&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; ...;
        ...
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Simple byte messages&quot; [3551-5058] --&gt;
&lt;h2&gt;&lt;a name=&quot;services&quot; id=&quot;services&quot;&gt;Services&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Services&quot; [5059-5081] --&gt;
&lt;h3&gt;&lt;a name=&quot;pointers_to_messages1&quot; id=&quot;pointers_to_messages1&quot;&gt;Pointers to messages&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0 centeralign&quot;&gt;  Service  &lt;/th&gt;&lt;th class=&quot;col1 centeralign&quot;&gt;  Arguments  &lt;/th&gt;&lt;th class=&quot;col2 centeralign&quot;&gt;  Description  &lt;/th&gt;&lt;th class=&quot;col3 centeralign&quot;&gt;  Properties  &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Creating&lt;/strong&gt;    &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_msg_create&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_msg_create&quot;&gt;OS_Msg_Create&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(msg_cb)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Create message and zero it.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_not_int.png?id=en%3Aosa%3Aref%3Aservices%3Amessages&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_not_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_not_int.png&quot; class=&quot;media&quot; title=&quot;Not allowed in interrupt&quot; alt=&quot;Not allowed in interrupt&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Sending&lt;/strong&gt;     &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row4&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_msg_send&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_msg_send&quot;&gt;OS_Msg_Send&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(msg_cb, message)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Send message. If message is already exists then wait when it became free.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Amessages&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Amessages&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row5&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_msg_send_to&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_msg_send_to&quot;&gt;OS_Msg_Send_TO&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(msg_cb, message, timeout)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Send message. If message is already exists then wait when it became free. Exit if timeout expired.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Amessages&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Amessages&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Amessages&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row6&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_msg_send_now&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_msg_send_now&quot;&gt;OS_Msg_Send_Now&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(msg_cb, message)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Send message. If message is already exists then it will be overwritten.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Amessages&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row7&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Checking&lt;/strong&gt;    &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row8&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_msg_check&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_msg_check&quot;&gt;OS_Msg_Check&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(msg_cb)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Check for message exists  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Amessages&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row9&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_msg_accept&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_msg_accept&quot;&gt;OS_Msg_Accept&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(msg_cb, os_msg_type_var)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Accept existing message. After accepting message is set free.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Amessages&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row10&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Waiting&lt;/strong&gt;     &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row11&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_msg_wait&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_msg_wait&quot;&gt;OS_Msg_Wait&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(msg_cb, os_msg_type_var)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Wait for message. After waiting message is set free  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Amessages&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Amessages&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row12&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_msg_wait_to&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_msg_wait_to&quot;&gt;OS_Msg_Wait_TO&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(msg_cb, os_msg_type_var, timeout)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Wait for message. Exit if timeout expired.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Amessages&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Amessages&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Amessages&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Pointers to messages&quot; [5082-7365] --&gt;
&lt;h3&gt;&lt;a name=&quot;simple_messages&quot; id=&quot;simple_messages&quot;&gt;Simple messages&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0 centeralign&quot;&gt;  Service  &lt;/th&gt;&lt;th class=&quot;col1 centeralign&quot;&gt;  Arguments  &lt;/th&gt;&lt;th class=&quot;col2 centeralign&quot;&gt;  Description  &lt;/th&gt;&lt;th class=&quot;col3 centeralign&quot;&gt;  Properties  &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Creating&lt;/strong&gt;    &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_smsg_create&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_smsg_create&quot;&gt;OS_Smsg_Create&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(smsg)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Create and zero simple message  &lt;/td&gt;&lt;td class=&quot;col3 rightalign&quot;&gt;   &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Sending&lt;/strong&gt;     &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row4&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_smsg_send&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_smsg_send&quot;&gt;OS_Smsg_Send&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(smsg, smessage)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Send simple message. If message already exists then wait when it became free.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Amessages&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Amessages&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row5&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_smsg_send_to&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_smsg_send_to&quot;&gt;OS_Smsg_Send_TO&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(smsg, smessage, timeout)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Send simple message. If message already exists then wait when it became free. Exit if timeout expired.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Amessages&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Amessages&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Amessages&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row6&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_smsg_send_now&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_smsg_send_now&quot;&gt;OS_Smsg_Send_Now&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(smsg, smessage)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Send simple message. If message already exists then it will be overwritten.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Amessages&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row7&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Checking&lt;/strong&gt;    &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row8&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_smsg_check&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_smsg_check&quot;&gt;OS_Smsg_Check&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(smsg)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Check for simple message exists  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Amessages&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row9&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_smsg_accept&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_smsg_accept&quot;&gt;OS_Smsg_Accept&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(smsg, os_smsg_type_var)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Accept existing simple message. After accepting message is cleared.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_can_int.png?id=en%3Aosa%3Aref%3Aservices%3Amessages&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_can_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_can_int.png&quot; class=&quot;media&quot; title=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; alt=&quot;Have alternate service for work in ISR (suffix &amp;quot;_I&amp;quot;)&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row10&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Waiting&lt;/strong&gt;     &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row11&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_smsg_wait&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_smsg_wait&quot;&gt;OS_Smsg_Wait&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(smsg, os_smsg_type_var)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Wait for simple message. After accepting simple message is cleared.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Amessages&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Amessages&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row12&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_smsg_wait_to&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_smsg_wait_to&quot;&gt;OS_Smsg_Wait_TO&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(smsg, os_smsg_type_var, timeout)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Wait for simple message. After accepting simple message is cleared. Exit if timeout expired.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Amessages&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Amessages&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Amessages&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Simple messages&quot; [7366-] --&gt;</description>
    </item>
    <item rdf:about="http://www.pic24.ru/doku.php/en/osa/ref/services/system_services?rev=1260572268">
        <dc:format>text/html</dc:format>
        <dc:date>2009-12-12T01:57:48+03:00</dc:date>
        <title>OSA : System services</title>
        <link>http://www.pic24.ru/doku.php/en/osa/ref/services/system_services?rev=1260572268</link>
        <description>


&lt;h1&gt;&lt;a name=&quot;osa_system_services&quot; id=&quot;osa_system_services&quot;&gt;OSA : System services&lt;/a&gt;&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;OSA : System services&quot; [1-37] --&gt;
&lt;h2&gt;&lt;a name=&quot;common_services&quot; id=&quot;common_services&quot;&gt;Common services&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0 centeralign&quot;&gt;  Service  &lt;/th&gt;&lt;th class=&quot;col1 centeralign&quot;&gt;  Description  &lt;/th&gt;&lt;th class=&quot;col2 centeralign&quot;&gt;  Properties  &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_init&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_init&quot;&gt;OS_Init&lt;/a&gt;(&lt;/span&gt;&lt;em&gt;&lt;/em&gt;&lt;span class=&quot;important&quot;&gt;)&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt;Init system variables.&lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_not_int.png?id=en%3Aosa%3Aref%3Aservices%3Asystem_services&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_not_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_not_int.png&quot; class=&quot;media&quot; alt=&quot;&quot; /&gt;&lt;/a&gt; &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;

Clears all task descriptors, all binary semaphores and static timers. This service must be called before &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_run&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_run&quot;&gt;OS_Run&lt;/a&gt;&lt;/span&gt;().
&lt;/p&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0 centeralign&quot;&gt;  Service  &lt;/th&gt;&lt;th class=&quot;col1 centeralign&quot;&gt;  Description  &lt;/th&gt;&lt;th class=&quot;col2 centeralign&quot;&gt;  Properties  &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_timer&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_timer&quot;&gt;OS_Timer&lt;/a&gt;(&lt;/span&gt;&lt;em&gt;&lt;/em&gt;&lt;span class=&quot;important&quot;&gt;)&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt;Work with all timers &lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Asystem_services&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; alt=&quot;&quot; /&gt;&lt;/a&gt; &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;

This service must be used if:
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; some tasks use &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_delay&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_delay&quot;&gt;OS_Delay&lt;/a&gt;&lt;/span&gt;();&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; some tasks wait events with timeout;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; static or dinamic timers are used in program.&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;

Calling this service is placed into periodical place in program (e.i. TMR0 inttertupt routine).
&lt;/p&gt;

&lt;p&gt;
&lt;p&gt;&lt;div class=&quot;noteclassic&quot;&gt;
In this documentation we use a term &lt;em class=&quot;u&quot;&gt;&lt;strong&gt;system tick&lt;/strong&gt;&lt;/em&gt; - period of &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_timer&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_timer&quot;&gt;OS_Timer&lt;/a&gt;&lt;/span&gt; calling. All delays and timeouts parameters in services are given in &lt;strong&gt;system ticks&lt;/strong&gt;.

&lt;/div&gt;&lt;/p&gt;
&lt;/p&gt;

&lt;p&gt;

Every execution &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_timer&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_timer&quot;&gt;OS_Timer&lt;/a&gt;&lt;/span&gt;() all active timers are increased by 1 (except 24-bit old style static timers wich are increased 1 type per 256 ticks).
&lt;/p&gt;

&lt;p&gt;
Example of using:

&lt;/p&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; interrupt isr&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;T0IE &lt;span class=&quot;sy3&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; T0IF&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        TMR0 &lt;span class=&quot;sy2&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;250&lt;/span&gt;;
        T0IF &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu19&quot;&gt;0&lt;/span&gt;;
        OS_Timer&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0 centeralign&quot;&gt;  Service  &lt;/th&gt;&lt;th class=&quot;col1 centeralign&quot;&gt;  Description  &lt;/th&gt;&lt;th class=&quot;col2 centeralign&quot;&gt;  Properties  &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_yield&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_yield&quot;&gt;OS_Yield&lt;/a&gt; (&lt;/span&gt;&lt;em&gt;&lt;/em&gt;&lt;span class=&quot;important&quot;&gt;)&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt;Switch context&lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Asystem_services&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Asystem_services&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; alt=&quot;&quot; /&gt;&lt;/a&gt; &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;

This service unconditionaly switchs cintext (returns to schoduler) to allow other task to be executed.
&lt;/p&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Common services&quot; [38-1707] --&gt;
&lt;h2&gt;&lt;a name=&quot;wait_services&quot; id=&quot;wait_services&quot;&gt;Wait services&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0 centeralign&quot;&gt;  Service  &lt;/th&gt;&lt;th class=&quot;col1 centeralign&quot;&gt;  Description  &lt;/th&gt;&lt;th class=&quot;col2 centeralign&quot;&gt;  Properties  &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_delay&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_delay&quot;&gt;OS_Delay&lt;/a&gt; (&lt;/span&gt;&lt;em&gt;delaytime&lt;/em&gt;&lt;span class=&quot;important&quot;&gt;)&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt;Delay current task by &lt;em&gt;delaytime&lt;/em&gt; system ticks&lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Asystem_services&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Asystem_services&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Asystem_services&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; alt=&quot;&quot; /&gt;&lt;/a&gt; &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;

Puts task in waiting state for time given in parameter &lt;em&gt;delaytime&lt;/em&gt;.
&lt;/p&gt;

&lt;p&gt;
For example task indicates temperature to the LCD one ime per second. Let &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_timer&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_timer&quot;&gt;OS_Timer&lt;/a&gt;&lt;/span&gt; period = 10 ms. Task will looks like:
&lt;/p&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; Task_Indicate &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;;;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        OS_Delay&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;	            &lt;span class=&quot;co1&quot;&gt;// Delay = 100 * 10 ms = 1 sec&lt;/span&gt;
        IndicateTemerature&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;	      &lt;span class=&quot;co1&quot;&gt;// Out data to LCD&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;
Using this service you must remember that &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_timer&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_timer&quot;&gt;OS_Timer&lt;/a&gt;&lt;/span&gt; is discrete. So accuracy of all delay is &lt;strong&gt;one system tick&lt;/strong&gt;. If &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_timer&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_timer&quot;&gt;OS_Timer&lt;/a&gt;&lt;/span&gt; calling interval is 10 ms, then &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_delay&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_delay&quot;&gt;OS_Delay&lt;/a&gt;&lt;/span&gt;(1) may wait 10 ms, and may wait 0 ms (it depends of at what stage of &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_timer&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_timer&quot;&gt;OS_Timer&lt;/a&gt;&lt;/span&gt; period &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_delay&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_delay&quot;&gt;OS_Delay&lt;/a&gt;&lt;/span&gt; was called).
Therefore you should either to be sure that length of delay is not important or to decrease system ticks and increase delay value. For example reduce the value of system tick to 1 ms and call &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_delay&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_delay&quot;&gt;OS_Delay&lt;/a&gt;&lt;/span&gt;(10). Here we can be sure that delay will last for 9-10 ms.
&lt;/p&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0 centeralign&quot;&gt;  Service  &lt;/th&gt;&lt;th class=&quot;col1 centeralign&quot;&gt;  Description  &lt;/th&gt;&lt;th class=&quot;col2 centeralign&quot;&gt;  Properties  &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_wait&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_wait&quot;&gt;OS_Wait&lt;/a&gt; (&lt;/span&gt;&lt;em&gt;condition&lt;/em&gt;&lt;span class=&quot;important&quot;&gt;)&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt;Wait for condition became true&lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Asystem_services&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Asystem_services&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; alt=&quot;&quot; /&gt;&lt;/a&gt; &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;

Puts task in waiting state while condition will not became true. Condition is any expression of boolean type. When conditin becames true task becames ready to execute.
&lt;/p&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;    ...
    &lt;span class=&quot;me1&quot;&gt;OS_Wait&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;m_nInPulseCounter &lt;span class=&quot;sy1&quot;&gt;&amp;gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt; || m_bButtonPressed&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
    ...&lt;/pre&gt;
&lt;p&gt;
In thi example &lt;em&gt;m_nInPulseCounter&lt;/em&gt; and &lt;em&gt;m_bButtonPressed&lt;/em&gt; are some external variables that can be set anywhere in program. Task will be in waiting mode while m_nInPulseCounter less than 10 and button not pressed.
&lt;/p&gt;

&lt;p&gt;

&lt;br/&gt;

&lt;/p&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0 centeralign&quot;&gt;  Service  &lt;/th&gt;&lt;th class=&quot;col1 centeralign&quot;&gt;  Description  &lt;/th&gt;&lt;th class=&quot;col2 centeralign&quot;&gt;  Properties  &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_wait_to&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_wait_to&quot;&gt;OS_Wait_TO&lt;/a&gt; (&lt;/span&gt;&lt;em&gt;condition, timeout&lt;/em&gt;&lt;span class=&quot;important&quot;&gt;)&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt;Same as &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_wait&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_wait&quot;&gt;OS_Wait&lt;/a&gt;&lt;/span&gt;() with exit if timeout expired &lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Asystem_services&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Asystem_services&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Asystem_services&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; alt=&quot;&quot; /&gt;&lt;/a&gt; &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;

Puts task in waiting state while condition will not became true or while timeout will not expired. Timeout value is given in system ticks.
&lt;/p&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;    ...
    &lt;span class=&quot;me1&quot;&gt;OS_Wait_TO&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;m_bButtonPressed, &lt;span class=&quot;nu0&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
    &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;OS_IsTimeout&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; ...;
    ...&lt;/pre&gt;
&lt;p&gt;
Here we wait button event within 100 system ticks. After exit waiting we check was there timeout or not by service &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_istimeout&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_istimeout&quot;&gt;OS_IsTimeout&lt;/a&gt;&lt;/span&gt;.
&lt;/p&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Wait services&quot; [1708-4631] --&gt;
&lt;h2&gt;&lt;a name=&quot;system_state&quot; id=&quot;system_state&quot;&gt;System state&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;

All services that check system state return 0 or 1 deending of system state flags.

&lt;/p&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0 centeralign&quot;&gt;  Service  &lt;/th&gt;&lt;th class=&quot;col1 centeralign&quot;&gt;  Description  &lt;/th&gt;&lt;th class=&quot;col2 centeralign&quot;&gt;  Properties  &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;em&gt;bool&lt;/em&gt; &lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_istimeout&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_istimeout&quot;&gt;OS_IsTimeout&lt;/a&gt; (&lt;/span&gt;&lt;em&gt;&lt;/em&gt;&lt;span class=&quot;important&quot;&gt;)&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt;Check for exit waiting with timeout&lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Asystem_services&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Asystem_services&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; alt=&quot;&quot; /&gt;&lt;/a&gt; &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;

This service can be used after waitng some event with timeout to check the reason of exit waiting. If returns 1 then timeout expired and event was not occured. If returns 0 then event occured and there was not timeout.
&lt;/p&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0 centeralign&quot;&gt;  Service  &lt;/th&gt;&lt;th class=&quot;col1 centeralign&quot;&gt;  Description  &lt;/th&gt;&lt;th class=&quot;col2 centeralign&quot;&gt;  Properties  &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;em&gt;bool&lt;/em&gt; &lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_iserror&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_iserror&quot;&gt;OS_IsError&lt;/a&gt; (&lt;/span&gt;&lt;em&gt;&lt;/em&gt;&lt;span class=&quot;important&quot;&gt;)&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt;Check for system error&lt;/td&gt;&lt;td class=&quot;col2 rightalign&quot;&gt;  &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;

System errors are:
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Task creation error (there is no free descriptor)&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0 centeralign&quot;&gt;  Service  &lt;/th&gt;&lt;th class=&quot;col1 centeralign&quot;&gt;  Description  &lt;/th&gt;&lt;th class=&quot;col2 centeralign&quot;&gt;  Properties  &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;em&gt;bool&lt;/em&gt; &lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_iseventerror&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_iseventerror&quot;&gt;OS_IsEventError&lt;/a&gt; (&lt;/span&gt;&lt;em&gt;&lt;/em&gt;&lt;span class=&quot;important&quot;&gt;)&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt;Check for event error &lt;/td&gt;&lt;td class=&quot;col2 rightalign&quot;&gt;  &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;

Event errors are:
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Increasing counting semaphore when it already has maximum value&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Sending message when it allready exists&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Sending message via queue that allready full&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0 centeralign&quot;&gt;  Service  &lt;/th&gt;&lt;th class=&quot;col1 centeralign&quot;&gt;  Description  &lt;/th&gt;&lt;th class=&quot;col2 centeralign&quot;&gt;  Properties  &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;em&gt;bool&lt;/em&gt; &lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_isincriticalsection&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_isincriticalsection&quot;&gt;OS_IsInCriticalSection&lt;/a&gt; (&lt;/span&gt;&lt;em&gt;&lt;/em&gt;&lt;span class=&quot;important&quot;&gt;)&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt;Returns 1 if one of tasks is in critical section&lt;/td&gt;&lt;td class=&quot;col2 rightalign&quot;&gt;  &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;System state&quot; [4632-5957] --&gt;
&lt;h2&gt;&lt;a name=&quot;interrupt_control_services&quot; id=&quot;interrupt_control_services&quot;&gt;Interrupt control services&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0 centeralign&quot;&gt;  Service  &lt;/th&gt;&lt;th class=&quot;col1 centeralign&quot;&gt;  Description  &lt;/th&gt;&lt;th class=&quot;col2 centeralign&quot;&gt;  Properties  &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_enterint&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_enterint&quot;&gt;OS_EnterInt&lt;/a&gt; (&lt;/span&gt;&lt;em&gt;&lt;/em&gt;&lt;span class=&quot;important&quot;&gt;)&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; For &lt;strong&gt;PICC16&lt;/strong&gt; and &lt;strong&gt;PICC18&lt;/strong&gt;: sould be called in the begin of intterupt routine (saves FSR value)&lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_int.png?id=en%3Aosa%3Aref%3Aservices%3Asystem_services&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_int.png&quot; class=&quot;media&quot; alt=&quot;&quot; /&gt;&lt;/a&gt; &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_leaveint&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_leaveint&quot;&gt;OS_LeaveInt&lt;/a&gt; (&lt;/span&gt;&lt;em&gt;&lt;/em&gt;&lt;span class=&quot;important&quot;&gt;)&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; For &lt;strong&gt;PICC16&lt;/strong&gt; and &lt;strong&gt;PICC18&lt;/strong&gt;: sould be called in the end of intterupt routine (restores FSR value)&lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_int.png?id=en%3Aosa%3Aref%3Aservices%3Asystem_services&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_int.png&quot; class=&quot;media&quot; alt=&quot;&quot; /&gt;&lt;/a&gt; &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;

&lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_enterint&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_enterint&quot;&gt;OS_EnterInt&lt;/a&gt;&lt;/span&gt; calling inserted in the begin of interrupt routine just after definition of local variables. &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_leaveint&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_leaveint&quot;&gt;OS_LeaveInt&lt;/a&gt;&lt;/span&gt;() calling inserted in the end of interrupt just before closing &amp;#039;}&amp;#039;.
&lt;/p&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; interrupt int_routine &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt;  var1, var2;
    &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt;   var3;
    OS_EnterInt&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
    ...                &lt;span class=&quot;co1&quot;&gt;//&lt;/span&gt;
    ...                &lt;span class=&quot;co1&quot;&gt;//&lt;/span&gt;
    OS_LeaveInt&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0 centeralign&quot;&gt;  Service  &lt;/th&gt;&lt;th class=&quot;col1 centeralign&quot;&gt;  Description  &lt;/th&gt;&lt;th class=&quot;col2 centeralign&quot;&gt;  Properties  &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;em&gt;char&lt;/em&gt; &lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_di&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_di&quot;&gt;OS_DI&lt;/a&gt; (&lt;/span&gt;&lt;em&gt;&lt;/em&gt;&lt;span class=&quot;important&quot;&gt;)&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt;Disable interrupts. Returns current GIEx value&lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_not_int.png?id=en%3Aosa%3Aref%3Aservices%3Asystem_services&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_not_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_not_int.png&quot; class=&quot;media&quot; alt=&quot;&quot; /&gt;&lt;/a&gt; &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_ei&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_ei&quot;&gt;OS_EI&lt;/a&gt; (&lt;/span&gt;&lt;em&gt;&lt;/em&gt;&lt;span class=&quot;important&quot;&gt;)&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt;Enable all interrupts&lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_not_int.png?id=en%3Aosa%3Aref%3Aservices%3Asystem_services&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_not_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_not_int.png&quot; class=&quot;media&quot; alt=&quot;&quot; /&gt;&lt;/a&gt; &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_ri&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_ri&quot;&gt;OS_RI&lt;/a&gt; (&lt;/span&gt;&lt;em&gt;char&lt;/em&gt;&lt;span class=&quot;important&quot;&gt;)&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt;Restore GIEx value saved in &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_di&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_di&quot;&gt;OS_DI&lt;/a&gt;&lt;/span&gt;()&lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_not_int.png?id=en%3Aosa%3Aref%3Aservices%3Asystem_services&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_not_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_not_int.png&quot; class=&quot;media&quot; alt=&quot;&quot; /&gt;&lt;/a&gt; &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;

&lt;p&gt;&lt;div class=&quot;notewarning&quot;&gt;
Service &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_ri&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_ri&quot;&gt;OS_RI&lt;/a&gt;&lt;/span&gt; restores only &amp;quot;1&amp;quot; but not &amp;quot;0&amp;quot;. If before &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_di&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_di&quot;&gt;OS_DI&lt;/a&gt;&lt;/span&gt;() flag GIE == 0, and after &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_di&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_di&quot;&gt;OS_DI&lt;/a&gt;&lt;/span&gt;() GIE was set by &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_ei&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_ei&quot;&gt;OS_EI&lt;/a&gt;&lt;/span&gt;(), then &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_ri&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_ri&quot;&gt;OS_RI&lt;/a&gt;&lt;/span&gt;() will not restore zero value of GIE.

&lt;/div&gt;&lt;/p&gt;
&lt;/p&gt;

&lt;p&gt;
here is example of using these service to generate pulse in 5 cycles:

&lt;/p&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt; gie_temp;
    ...
    &lt;span class=&quot;me1&quot;&gt;gie_temp&lt;/span&gt; &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; OS_DI&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
    RB0 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;;
    NOP&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
    NOP&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
    NOP&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
    NOP&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
    RB0 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu19&quot;&gt;0&lt;/span&gt;;
    OS_RI&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;gie_temp&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
    ...
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Interrupt control services&quot; [5958-8022] --&gt;
&lt;h2&gt;&lt;a name=&quot;all_system_services&quot; id=&quot;all_system_services&quot;&gt;All system services&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0 centeralign&quot;&gt;  Service  &lt;/th&gt;&lt;th class=&quot;col1 centeralign&quot;&gt;  Arguments  &lt;/th&gt;&lt;th class=&quot;col2 centeralign&quot;&gt;  Description  &lt;/th&gt;&lt;th class=&quot;col3 centeralign&quot;&gt;  Properties  &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;System&lt;/strong&gt;    &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_sched&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_sched&quot;&gt;OS_Sched&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; List all tasks, select ready task with highest priority and run it.  &lt;/td&gt;&lt;td class=&quot;col3 rightalign&quot;&gt;   &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_run&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_run&quot;&gt;OS_Run&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Run operating system&amp;#039;s kernel. Calls &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_sched&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_sched&quot;&gt;OS_Sched&lt;/a&gt;&lt;/span&gt;() in infinite loop.  &lt;/td&gt;&lt;td class=&quot;col3 rightalign&quot;&gt;   &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row4&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_init&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_init&quot;&gt;OS_Init&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Init system vars  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_not_int.png?id=en%3Aosa%3Aref%3Aservices%3Asystem_services&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_not_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_not_int.png&quot; class=&quot;media&quot; title=&quot;Not allowed in interrupt&quot; alt=&quot;Not allowed in interrupt&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row5&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_timer&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_timer&quot;&gt;OS_Timer&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Insrease all active timers.  &lt;/td&gt;&lt;td class=&quot;col3 rightalign&quot;&gt;   &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row6&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Waiting&lt;/strong&gt;     &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row7&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_yield&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_yield&quot;&gt;OS_Yield&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Return to scheduler  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Asystem_services&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Asystem_services&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row8&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_delay&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_delay&quot;&gt;OS_Delay&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(delaytime)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Delay current task for &lt;em&gt;delaytime&lt;/em&gt; system ticks  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Asystem_services&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Asystem_services&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Asystem_services&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row9&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_wait&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_wait&quot;&gt;OS_Wait&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(condition)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Wait for condition is true  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Asystem_services&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Asystem_services&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row10&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_wait_to&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_wait_to&quot;&gt;OS_Wait_TO&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(condition, timeout)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Wait for condition is true. Exit if timeout expired.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Asystem_services&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Asystem_services&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Asystem_services&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row11&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Checking&lt;/strong&gt;    &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row12&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_istimeout&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_istimeout&quot;&gt;OS_IsTimeout&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Return true if timeout occured in previos wait service.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Asystem_services&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row13&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_iserror&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_iserror&quot;&gt;OS_IsError&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Check for error after task creating  &lt;/td&gt;&lt;td class=&quot;col3 rightalign&quot;&gt;   &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row14&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_iseventerror&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_iseventerror&quot;&gt;OS_IsEventError&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Check for error after work with events  &lt;/td&gt;&lt;td class=&quot;col3 rightalign&quot;&gt;   &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row15&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_isincriticalsection&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_isincriticalsection&quot;&gt;OS_IsInCriticalSection&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Return true if one of task is in critical section  &lt;/td&gt;&lt;td class=&quot;col3 rightalign&quot;&gt;   &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row16&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Interrupts&lt;/strong&gt;     &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row17&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_enterint&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_enterint&quot;&gt;OS_EnterInt&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; For &lt;strong&gt;PICC16&lt;/strong&gt; and &lt;strong&gt;PICC18&lt;/strong&gt;: save FSR in the begin of ISR function  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_int.png?id=en%3Aosa%3Aref%3Aservices%3Asystem_services&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_int.png&quot; class=&quot;media&quot; title=&quot;Only insize interrupt&quot; alt=&quot;Only insize interrupt&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row18&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_leaveint&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_leaveint&quot;&gt;OS_LeaveInt&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; For &lt;strong&gt;PICC16&lt;/strong&gt; and &lt;strong&gt;PICC18&lt;/strong&gt;: restore saved FSR in the end of ISR function  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_int.png?id=en%3Aosa%3Aref%3Aservices%3Asystem_services&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_int.png&quot; class=&quot;media&quot; title=&quot;Only insize interrupt&quot; alt=&quot;Only insize interrupt&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row19&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;char &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_di&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_di&quot;&gt;OS_DI&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Disable all interrupts and save previos state of GIEx flags  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_not_int.png?id=en%3Aosa%3Aref%3Aservices%3Asystem_services&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_not_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_not_int.png&quot; class=&quot;media&quot; title=&quot;Not allowed in interrupt&quot; alt=&quot;Not allowed in interrupt&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row20&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_ei&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_ei&quot;&gt;OS_EI&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Enable all interrupts  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_not_int.png?id=en%3Aosa%3Aref%3Aservices%3Asystem_services&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_not_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_not_int.png&quot; class=&quot;media&quot; title=&quot;Not allowed in interrupt&quot; alt=&quot;Not allowed in interrupt&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row21&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_ri&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_ri&quot;&gt;OS_RI&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(char)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Restore previosly saved by &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_di&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_di&quot;&gt;OS_DI&lt;/a&gt;&lt;/span&gt; service GIEx flags  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_not_int.png?id=en%3Aosa%3Aref%3Aservices%3Asystem_services&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_not_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_not_int.png&quot; class=&quot;media&quot; title=&quot;Not allowed in interrupt&quot; alt=&quot;Not allowed in interrupt&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row22&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_entercriticalsection&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_entercriticalsection&quot;&gt;OS_EnterCriticalSection&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Enter critical section  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Asystem_services&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row23&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_leavecriticalsection&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_leavecriticalsection&quot;&gt;OS_LeaveCriticalSection&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Leave critical section  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Asystem_services&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;All system services&quot; [8023-] --&gt;</description>
    </item>
    <item rdf:about="http://www.pic24.ru/doku.php/en/osa/ref/services/tasks?rev=1268225820">
        <dc:format>text/html</dc:format>
        <dc:date>2010-03-10T15:57:00+03:00</dc:date>
        <title>OSA : Tasks</title>
        <link>http://www.pic24.ru/doku.php/en/osa/ref/services/tasks?rev=1268225820</link>
        <description>


&lt;h1&gt;&lt;a name=&quot;osa_tasks&quot; id=&quot;osa_tasks&quot;&gt;OSA : Tasks&lt;/a&gt;&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;OSA : Tasks&quot; [1-29] --&gt;
&lt;h2&gt;&lt;a name=&quot;intro&quot; id=&quot;intro&quot;&gt;Intro&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;

Task in OSA is C-function. This function must contain infinite loop wich has inside at least one service that switchs task context. Simple task can looks like:

&lt;/p&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; SimpleTask &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;;;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;      &lt;span class=&quot;co1&quot;&gt;// Inifinite loop&lt;/span&gt;
        OS_Yield&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;; &lt;span class=&quot;co1&quot;&gt;// Unconditional context switching&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;
&lt;p&gt;&lt;div class=&quot;noteclassic&quot;&gt;
When using &lt;strong&gt;mikroC PRO&lt;/strong&gt; you must tell to linker that function will be called indirrectly by adding #paragma directive, e.g.:
&lt;/p&gt;

&lt;p&gt;
&lt;span class=&quot;important&quot;&gt;#pragma funcall main SimpleTask&lt;/span&gt;

&lt;/div&gt;&lt;/p&gt;
&lt;/p&gt;

&lt;p&gt;
Each task can be in one of five states:
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; not created&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; waiting&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; ready&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; running&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; paused&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;

Every task has priority. There are eight priority levels from 0 (highest) to 7 (lowest). Priority can be changed in runtime.(&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/description/events_and_priority&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:description:events_and_priority&quot;&gt;More about priorities and states&lt;/a&gt;).
&lt;/p&gt;

&lt;p&gt;
To work with tasks OSA reserves RAM for task descriptors. Number of tasks wich can be active at one time is set by constant &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/appendix/configuration&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:appendix:configuration&quot;&gt;OS_TASKS&lt;/a&gt;&lt;/span&gt; in &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/appendix/configuration&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:appendix:configuration&quot;&gt;OSAcfg.h&lt;/a&gt;&lt;/span&gt;.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Intro&quot; [30-1077] --&gt;
&lt;h2&gt;&lt;a name=&quot;pointer_to_tcb&quot; id=&quot;pointer_to_tcb&quot;&gt;Pointer to TCB&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
Most operations on the task are making through pointer to it&amp;#039;s descriptor called &lt;strong&gt;tcb&lt;/strong&gt; (Task Control Block). Task descriptors can not be accessed directly. Bu you can to define a global variable of type &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/description/data_types#ost_task_pointer&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:description:data_types&quot;&gt;OST_TASK_POINTER&lt;/a&gt;&lt;/span&gt;, wich will point to the descriptor of task.
&lt;/p&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;OST_TASK_POINTER tp_MyTask;&lt;/pre&gt;
&lt;p&gt;
To control task through this variable we must to initialize it by service &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_getcurtask&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_getcurtask&quot;&gt;OS_GetCurTask&lt;/a&gt;&lt;/span&gt;. Inside task this service returns pointer to current task&amp;#039;s descriptor. It is recommended to call this service in the begin of task-function.
&lt;/p&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; MyTask &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    tp_MyTask &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; OS_GetCurTask&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
    &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;;;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        &lt;span class=&quot;coMULTI&quot;&gt;/*...*/&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;
Also it is possible to control task by itself. In this case you can use system macro &lt;strong&gt;this_task&lt;/strong&gt; (or service &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_getcurtask&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_getcurtask&quot;&gt;OS_GetCurTask&lt;/a&gt;&lt;/span&gt;) as the parameter.
&lt;/p&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; MyTask &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;;;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        &lt;span class=&quot;coMULTI&quot;&gt;/*...*/&lt;/span&gt;
        OS_Task_SetPriority&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;this_task, &lt;span class=&quot;nu19&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;     &lt;span class=&quot;co1&quot;&gt;// set highest priority for current task&lt;/span&gt;
        &lt;span class=&quot;coMULTI&quot;&gt;/*...*/&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Pointer to TCB&quot; [1078-2251] --&gt;
&lt;h2&gt;&lt;a name=&quot;task_creation&quot; id=&quot;task_creation&quot;&gt;Task creation&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;

Task is created by service &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_task_create&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_task_create&quot;&gt;OS_Task_Create&lt;/a&gt;&lt;/span&gt;.
For example:
&lt;/p&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span class=&quot;co2&quot;&gt;#include &amp;lt;osa.h&amp;gt;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; Task1 &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;;;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        OS_Yield&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
...
&amp;nbsp;
&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; main &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    OS_Init&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
    OS_Task_Create&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;, Task1&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
    ...
    &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;;;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; OS_Sched&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;
In this example we created task from C-function Task1() with lowest priority. After this service worked, operating system will know that function Task1() is a task and will give control to it when it will be ready.
&lt;/p&gt;

&lt;p&gt;
We must to provide service &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_task_create&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_task_create&quot;&gt;OS_Task_Create&lt;/a&gt;&lt;/span&gt; with priority even if priority mode disabled (constant &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/appendix/configuration&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:appendix:configuration&quot;&gt;OS_DESABLE_PRIORITY&lt;/a&gt;&lt;/span&gt; is defined in &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/appendix/configuration&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:appendix:configuration&quot;&gt;OSAcfg.h&lt;/a&gt;&lt;/span&gt;).
&lt;/p&gt;

&lt;p&gt;
After &lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_Task_Create() executed you can get a pointer to descriptor of created task with service &lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_Task_GetCreated (it is usefull when one task will control other task):
&lt;/p&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;    OST_TASK_POINTER  tp;
&amp;nbsp;
    OS_Task_Create&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu19&quot;&gt;0&lt;/span&gt;, MyTask&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
    &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;OS_IsError&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; tp &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; OS_Task_GetCreated&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;/pre&gt;
&lt;p&gt;
&lt;p&gt;&lt;div class=&quot;noteclassic&quot;&gt;
When using &lt;strong&gt;CCS&lt;/strong&gt; all function-tasks should be defined in main() by service &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_task_create&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_task_create&quot;&gt;OS_Task_Define&lt;/a&gt;&lt;/span&gt;

&lt;/div&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;p&gt;
&lt;strong&gt; Task creation error &lt;/strong&gt;
&lt;/p&gt;

&lt;p&gt;
If before calling service &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_task_create&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_task_create&quot;&gt;OS_Task_Create&lt;/a&gt;&lt;/span&gt; there is no free task descriptor, then task will not be created and system flag &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_iserror&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_iserror&quot;&gt;OS_IsError&lt;/a&gt;&lt;/span&gt; will be set.
&lt;/p&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;    OS_Task_Create&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;7&lt;/span&gt;, Task1&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
    &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;OS_IsError&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; ...	;	&lt;span class=&quot;co1&quot;&gt;//&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;
If &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_task_create&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_task_create&quot;&gt;OS_Task_Create&lt;/a&gt;&lt;/span&gt;() exits with error then you need to increase constant &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/appendix/configuration&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:appendix:configuration&quot;&gt;OS_TASKS&lt;/a&gt;&lt;/span&gt; in &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/appendix/configuration&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:appendix:configuration&quot;&gt;OSAcfg.h&lt;/a&gt;&lt;/span&gt; and then re-build project. If it is supposed that there must be free decriptor, then you need to serach error in program (e.g. some task had to be stopped but still running).

&lt;/p&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Task creation&quot; [2252-4288] --&gt;
&lt;h2&gt;&lt;a name=&quot;task_deleting&quot; id=&quot;task_deleting&quot;&gt;Task deleting&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;

To delete task (to delete it from list of active task and to free descriptor) you can use service &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_task_delete&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_task_delete&quot;&gt;OS_Task_Delete&lt;/a&gt;&lt;/span&gt;. Before deleting task you should be sure that task free all resources. It is recommended to deleting task by itself only (but OSA services aloows to delete task from any place in program).
&lt;/p&gt;

&lt;p&gt;
&lt;p&gt;&lt;div class=&quot;noteclassic&quot;&gt;
Be sure that deleting task free all resources.

&lt;/div&gt;&lt;/p&gt;
&lt;/p&gt;

&lt;p&gt;
After calling &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_task_delete&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_task_delete&quot;&gt;OS_Task_Delete&lt;/a&gt;&lt;/span&gt; task descriptor will be free. If this service called to delete current task (with &lt;strong&gt;this_task&lt;/strong&gt; perameter) then system automatically switchs context. After &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_task_delete&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_task_delete&quot;&gt;OS_Task_Delete(this_task)&lt;/a&gt;&lt;/span&gt; no operators will be executed.
&lt;/p&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;    ...
    &lt;span class=&quot;me1&quot;&gt;OS_Task_Delete&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;this_task&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
    Counter ++;
    ...&lt;/pre&gt;
&lt;p&gt;
In this example variable &lt;em&gt;counter&lt;/em&gt; will not be increased.
&lt;/p&gt;

&lt;p&gt;
To stop current task and to run another, first we must to create a new task and after that we can delete current. Elsewere new task will not be created.
&lt;/p&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;    . . .
    &lt;span class=&quot;me1&quot;&gt;OS_Task_Create&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, Task_NewTask&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
    OS_Task_Delete&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;this_task&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
    . . .&lt;/pre&gt;
&lt;p&gt;
But this method has a lack: we must have at least one free task descriptor at all times. For example, program of dictaphone consist of several tasks: buttons, indication, recording, playing, battary checking. Here we have 2 tasks that can not be active at one time: recording and playing. Thus at one time only 4 tasks can be active. When we switching from recording task to playing task, first we must to create playing task and than to stop recording. Thus we must have 5 task descriptors for 4 active tasks.
&lt;/p&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; Task_Play &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    . . .
    &lt;span class=&quot;me1&quot;&gt;OS_Task_Create&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, Task_Record&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
    OS_Task_Delete&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;this_task&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
    . . .
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;
In this case several bytes of RAM (used by fifth task descriptor) are not used most of the time. To avoid this problem we can use service &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_task_replace&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_task_replace&quot;&gt;OS_Task_Replace&lt;/a&gt;&lt;/span&gt;:
&lt;/p&gt;

&lt;p&gt;
This service will stop current task and create new in just released descriptor.
&lt;/p&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;    . . .
    &lt;span class=&quot;me1&quot;&gt;OS_Task_Replace&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;, Task_Record&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
    . . .&lt;/pre&gt;&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Task deleting&quot; [4289-6482] --&gt;
&lt;h2&gt;&lt;a name=&quot;task_priority_change&quot; id=&quot;task_priority_change&quot;&gt;Task priority change&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;

We can change priority of tasks in real-time. There are two services to work with task priority: &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_task_getpriority&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_task_getpriority&quot;&gt;OS_Task_GetPriority&lt;/a&gt;&lt;/span&gt; and &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_task_setpriority&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_task_setpriority&quot;&gt;OS_Task_SetPriority&lt;/a&gt;&lt;/span&gt;.
&lt;/p&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Task priority change&quot; [6483-6770] --&gt;
&lt;h2&gt;&lt;a name=&quot;task_local_variables&quot; id=&quot;task_local_variables&quot;&gt;Task local variables&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;

All active (created) tasks are parallel processes, and you should remember that their local variables may intersect. Thus local variable&amp;#039;s value may be lost (rewritten by parallel task) after context switching. To avoid loss of variable&amp;#039;s value, it must be declared as static. I.e.:
&lt;/p&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; Task1 &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
  &lt;span class=&quot;kw4&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt; s_cCounter;  &lt;span class=&quot;co1&quot;&gt;// This variable will remain unchanged after context switching&lt;/span&gt;
  &lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt; i, j;               &lt;span class=&quot;co1&quot;&gt;// Theese variables are temporary. They can be used only within one task&lt;/span&gt;
                           &lt;span class=&quot;co1&quot;&gt;// session (from getting control to context switching)&lt;/span&gt;
  . . .
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Task local variables&quot; [6771-7424] --&gt;
&lt;h2&gt;&lt;a name=&quot;services&quot; id=&quot;services&quot;&gt;Services&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0 centeralign&quot;&gt;  Service  &lt;/th&gt;&lt;th class=&quot;col1 centeralign&quot;&gt;  Arguments  &lt;/th&gt;&lt;th class=&quot;col2 centeralign&quot;&gt;  Description  &lt;/th&gt;&lt;th class=&quot;col3 centeralign&quot;&gt;  Properties  &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Creating/Deleting&lt;/strong&gt;    &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_task_define&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_task_define&quot;&gt;OS_Task_Define&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(TaskName)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; &lt;strong&gt;For CCS&lt;/strong&gt;: Tell to compiler that function &lt;em&gt;Taskname&lt;/em&gt; is a task and it will be called indirrectly. This service called from main() only  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;strong&gt;main&lt;/strong&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_task_create&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_task_create&quot;&gt;OS_Task_Create&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(priority, TaskName)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Create task and add it to list of active tasks  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_not_int.png?id=en%3Aosa%3Aref%3Aservices%3Atasks&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_not_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_not_int.png&quot; class=&quot;media&quot; title=&quot;Not allowed in interrupt&quot; alt=&quot;Not allowed in interrupt&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row4&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_task_replace&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_task_replace&quot;&gt;OS_Task_Replace&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(priority, TaskName)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Stop and delete current task and create new task  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Atasks&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row5&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_task_delete&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_task_delete&quot;&gt;OS_Task_Delete&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(tp)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Delete task  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Atasks&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row6&quot;&gt;
		&lt;td class=&quot;col0&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Menagement&lt;/strong&gt; &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row7&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;OST_TASK_POINTER&lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_task_getcur&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_task_getcur&quot;&gt;OS_Task_GetCur&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Get pointer to currect task&amp;#039;s descriptor  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Atasks&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row8&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;OST_TASK_POINTER&lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/osa/ref/allservices/os_task_getcreated&quot; class=&quot;wikilink1&quot; title=&quot;osa:ref:allservices:os_task_getcreated&quot;&gt;OS_Task_GetCreated&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Get pointer to just created task&amp;#039;s descriptor  &lt;/td&gt;&lt;td class=&quot;col3 rightalign&quot;&gt;   &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row9&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_task_pause&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_task_pause&quot;&gt;OS_Task_Pause&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(tp)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Pause task  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Atasks&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row10&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_task_continue&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_task_continue&quot;&gt;OS_Task_Continue&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(tp)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Continue paused task  &lt;/td&gt;&lt;td class=&quot;col3 rightalign&quot;&gt;   &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row11&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;char &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_task_getpriority&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_task_getpriority&quot;&gt;OS_Task_GetPriority&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(tp)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Get priority of task  &lt;/td&gt;&lt;td class=&quot;col3 rightalign&quot;&gt;   &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row12&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_task_setpriority&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_task_setpriority&quot;&gt;OS_Task_SetPriority&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(tp, priority)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Change task&amp;#039;s priority  &lt;/td&gt;&lt;td class=&quot;col3 rightalign&quot;&gt;   &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row13&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Checking&lt;/strong&gt;    &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row14&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_task_ispaused&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_task_ispaused&quot;&gt;OS_Task_IsPaused&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(tp)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Check for task s paused  &lt;/td&gt;&lt;td class=&quot;col3 rightalign&quot;&gt;   &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Services&quot; [7425-] --&gt;</description>
    </item>
    <item rdf:about="http://www.pic24.ru/doku.php/en/osa/ref/services/timers?rev=1260572831">
        <dc:format>text/html</dc:format>
        <dc:date>2009-12-12T02:07:11+03:00</dc:date>
        <title>OSA : Timers</title>
        <link>http://www.pic24.ru/doku.php/en/osa/ref/services/timers?rev=1260572831</link>
        <description>


&lt;h1&gt;&lt;a name=&quot;osa_timers&quot; id=&quot;osa_timers&quot;&gt;OSA : Timers&lt;/a&gt;&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;OSA : Timers&quot; [1-28] --&gt;
&lt;h2&gt;&lt;a name=&quot;intro&quot; id=&quot;intro&quot;&gt;Intro&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;

Timers in OSA are used to simplify writing time-depended code. Using timers you can allocate quantum of time for task, or make delays or timeouts in functions that are not tasks. Timing in OSA is making by &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_timer&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_timer&quot;&gt;OS_Timer&lt;/a&gt;&lt;/span&gt; service. When calling this service, all active timers incremented by 1. If any timer will overflow, then corresponding timeout bit will be set.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Intro&quot; [29-448] --&gt;
&lt;h2&gt;&lt;a name=&quot;types_of_timers_in_osa&quot; id=&quot;types_of_timers_in_osa&quot;&gt;Types of timers in OSA&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;

There are two types of timers in OSA: &lt;strong&gt;dynamic&lt;/strong&gt; and &lt;strong&gt;static&lt;/strong&gt;. Main difference between them is that &lt;strong&gt;dinamic&lt;/strong&gt; timers can be created and deleted in real-time and &lt;strong&gt;static&lt;/strong&gt; are created once on compilation stage and can not be deleted.
&lt;/p&gt;

&lt;p&gt;
The advantage of &lt;strong&gt;dinamic&lt;/strong&gt; timers is that they can be declared in any place of program, thus they can be used in independed program modules. The disadvantage is that they use more RAM and ROM and work slowest than &lt;strong&gt;static&lt;/strong&gt; timers.
&lt;/p&gt;

&lt;p&gt;
The advantage of &lt;strong&gt;static&lt;/strong&gt; timers is that they are fast and use little RAM and ROM. The disadvantage is that their number is fixed and must be set on project stage in &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/appendix/configuration&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:appendix:configuration&quot;&gt;OSAcfg.h.&lt;/a&gt;&lt;/span&gt;
&lt;/p&gt;

&lt;p&gt;
In addition, important difference is that &lt;strong&gt;static&lt;/strong&gt; timer after overflow stops, and &lt;strong&gt;dinamic&lt;/strong&gt; continue counting.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Types of timers in OSA&quot; [449-1299] --&gt;
&lt;h2&gt;&lt;a name=&quot;dynamic_timers&quot; id=&quot;dynamic_timers&quot;&gt;Dynamic timers&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Dynamic timers&quot; [1300-1327] --&gt;
&lt;h3&gt;&lt;a name=&quot;intro1&quot; id=&quot;intro1&quot;&gt;Intro&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;

To use dinamic timers in your program you have to define constant in OSAcfg.g:

&lt;/p&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span class=&quot;co2&quot;&gt;#define OS_ENABLE_DTIMERS&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;
This will include functions for working with dynamic timers in you code. Variables of dynamic timers are declared using &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/description/data_types#ost_dtimer&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:description:data_types&quot;&gt;OST_DTIMER&lt;/a&gt;&lt;/span&gt; type:
&lt;/p&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;OST_DTIMER mytimer;&lt;/pre&gt;
&lt;p&gt;
Variable &lt;em&gt;mytimer&lt;/em&gt; contains timer counter, timer&amp;#039;s state flags and pointer to next timer in list. Size of timer counter for dynamic timers is set by &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_size&quot; class=&quot;wikilink2&quot; title=&quot;en:osa:ref:allservices:os_dtimer_size&quot; rel=&quot;nofollow&quot;&gt;OS_DTIMER_SIZE&lt;/a&gt;&lt;/span&gt; constant in &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/appendix/configuration&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:appendix:configuration&quot;&gt;OSAcfg.h&lt;/a&gt;&lt;/span&gt; (By default this constant is equal to &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/appendix/configuration&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:appendix:configuration&quot;&gt;OS_TIMER_SIZE&lt;/a&gt;&lt;/span&gt;).
&lt;/p&gt;

&lt;p&gt;
&lt;p&gt;&lt;div class=&quot;noteclassic&quot;&gt;
For &lt;strong&gt;PIC16&lt;/strong&gt; dynamic timers can be allocated in &lt;strong&gt;bank0&lt;/strong&gt; and &lt;strong&gt;bank1&lt;/strong&gt; only.

&lt;/div&gt;&lt;/p&gt;
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Intro&quot; [1328-2167] --&gt;
&lt;h3&gt;&lt;a name=&quot;timer_s_states&quot; id=&quot;timer_s_states&quot;&gt;Timer&amp;#039;s states&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;

Dynamic timer can be in one of 4 states:
&lt;/p&gt;
&lt;table class = &quot;fpl&quot;&gt;
	&lt;tr&gt;
		&lt;td&gt;
 &lt;strong&gt;Not created&lt;/strong&gt; (or &lt;strong&gt;deleted&lt;/strong&gt;)		&lt;/td&gt;
		&lt;td&gt;
 The timer is not in list of active timers. The system does not know about it and does not work with it		&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;
 &lt;strong&gt;Active&lt;/strong&gt;		&lt;/td&gt;
		&lt;td&gt;
 The timer was created by service &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_create&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_create&quot;&gt;OS_Dtimer_Create&lt;/a&gt;&lt;/span&gt; and was put into list of active timers.		&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;
 &lt;strong&gt;Counting&lt;/strong&gt;		&lt;/td&gt;
		&lt;td&gt;
 Every call of &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_timer&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_timer&quot;&gt;OS_Timer&lt;/a&gt;&lt;/span&gt; service timer&amp;#039;s counter will increment by 1. To start counting you can use one of services:
&lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_run&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_run&quot;&gt;OS_Dtimer_Run&lt;/a&gt;&lt;/span&gt; or &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_continue&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_continue&quot;&gt;OS_Dtimer_Continue&lt;/a&gt;&lt;/span&gt;.		&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;
 &lt;strong&gt;Stopped&lt;/strong&gt;		&lt;/td&gt;
		&lt;td&gt;
 The timer was stopped by &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_stop&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_stop&quot;&gt;OS_Dtimer_Stop&lt;/a&gt;&lt;/span&gt; service. It is still present in list of active timers, but not counting.		&lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Timer's states&quot; [2168-3042] --&gt;
&lt;h3&gt;&lt;a name=&quot;example&quot; id=&quot;example&quot;&gt;Example&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;

Here is small example of using dynamic timer to generate pulse of given length and with frequency filling. (It supposed that system tick = 1 ms):
&lt;/p&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;OST_SMSG smsg;
&amp;nbsp;
&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; Task1 &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;;;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        ...
        &lt;span class=&quot;me1&quot;&gt;OS_Smsg_Send&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;smsg, &lt;span class=&quot;nu0&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;  &lt;span class=&quot;co1&quot;&gt;// We need 200 ms pulse&lt;/span&gt;
        ...
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
&amp;nbsp;
&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; Task2 &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    OST_SMSG msg;
    &lt;span class=&quot;kw4&quot;&gt;static&lt;/span&gt; OST_DTIMER myTimer;
    RB0 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu19&quot;&gt;0&lt;/span&gt;;
    OS_Dtimer_Create&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;myTimer&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;                 &lt;span class=&quot;co1&quot;&gt;// Create dynamic timer&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;;;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
        OS_Smsg_Wait&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;smsg, msg&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;               &lt;span class=&quot;co1&quot;&gt;// Wait for message to start pulse&lt;/span&gt;
        OS_Dtimer_Run&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;myTimer, msg&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;           &lt;span class=&quot;co1&quot;&gt;// Run timer with given value&lt;/span&gt;
        &lt;span class=&quot;kw1&quot;&gt;do&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
            RB0 &lt;span class=&quot;sy3&quot;&gt;^&lt;/span&gt;&lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;;                         &lt;span class=&quot;co1&quot;&gt;// Generate meander&lt;/span&gt;
            OS_Delay&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;	                &lt;span class=&quot;co1&quot;&gt;// Filling frequency = 100 Hz&lt;/span&gt;
        &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;sy3&quot;&gt;!&lt;/span&gt;OS_Dtimer_Check&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;myTimer&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;   &lt;span class=&quot;co1&quot;&gt;// Wait for timeout&lt;/span&gt;
        RB0 &lt;span class=&quot;sy1&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu19&quot;&gt;0&lt;/span&gt;;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Example&quot; [3043-3949] --&gt;
&lt;h2&gt;&lt;a name=&quot;static_timers&quot; id=&quot;static_timers&quot;&gt;Static timers&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Static timers&quot; [3950-3976] --&gt;
&lt;h3&gt;&lt;a name=&quot;intro2&quot; id=&quot;intro2&quot;&gt;Intro&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
&lt;p&gt;&lt;div class=&quot;noteclassic&quot;&gt;
It is recomended to use static timers only when it is nessesary to reduce time of &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_timer&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_timer&quot;&gt;OS_Timer&lt;/a&gt;&lt;/span&gt; executing, RAM and/or ROM. In all other cases it is recomended to use dynamic timers.

&lt;/div&gt;&lt;/p&gt;
&lt;/p&gt;

&lt;p&gt;
To use static timers in your program you need to set number of timers you want to use in &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/appendix/configuration&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:appendix:configuration&quot;&gt;OSAcfg.h&lt;/a&gt;&lt;/span&gt;:
&lt;/p&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;    &lt;span class=&quot;co2&quot;&gt;#define OS_STIMERS	5&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;
In this example array of 5 timers will be cteated. The size of static timers is set by &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/appendix/configuration&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:appendix:configuration&quot;&gt;OS_STIMER_SIZE&lt;/a&gt;&lt;/span&gt; constant in &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/appendix/configuration&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:appendix:configuration&quot;&gt;OSAcfg.h&lt;/a&gt;&lt;/span&gt;:

&lt;/p&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;    &lt;span class=&quot;co2&quot;&gt;#define OS_STIMER_SIZE   2&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;
(By default this constant is equal to &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/appendix/configuration&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:appendix:configuration&quot;&gt;OS_TIMER_SIZE&lt;/a&gt;&lt;/span&gt;).
&lt;/p&gt;

&lt;p&gt;
The most significant bit of every static timer shows current timers state: =1 - counting, =0 - stopped. Thus size of counter of static timer is 1 bit less then size of &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/appendix/configuration&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:appendix:configuration&quot;&gt;OS_STIMER_SIZE.&lt;/a&gt;&lt;/span&gt; For example, if &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/appendix/configuration&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:appendix:configuration&quot;&gt;OS_STIMER_SIZE&lt;/a&gt;&lt;/span&gt; = 2 bytes, then timer&amp;#039;s counter size is 15 bits. You should to notice it when forming delays.
&lt;/p&gt;

&lt;p&gt;
To work with static timers we provide all services by timer&amp;#039;s identification number as parameter. It is comfortable to enumerate all static timers through enum:
&lt;/p&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;enum&lt;/span&gt; OSA_STIMERS_ENUM
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    ST_TIMER0,
    ST_TIMER1,
    ST_TIMER2,
    ST_TIMER3
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;

&lt;p&gt;&lt;div class=&quot;noteclassic&quot;&gt;
The state and value of static timers are undefined after &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_init&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_init&quot;&gt;OS_Init&lt;/a&gt;&lt;/span&gt;() execution.

&lt;/div&gt;&lt;/p&gt;
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Intro&quot; [3977-5565] --&gt;
&lt;h3&gt;&lt;a name=&quot;example1&quot; id=&quot;example1&quot;&gt;Example&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;

Static timers can be applied to forming delays in low-RAM controllers. For example, we run 6 tasks under PIC10F222 and only 2 of them use service &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_delay&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_delay&quot;&gt;OS_Delay&lt;/a&gt;&lt;/span&gt;. If we use task&amp;#039;s timers, then 4 variables (timers in four of si tasks) are not used. Thus we lose 4 (or more) bytes of memory. Using static timers we can avoid losing RAM. We can to declare only 2 static timers (one for each task). In this case we get the advantage of speed (&lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_timer&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_timer&quot;&gt;OS_Timer&lt;/a&gt;&lt;/span&gt; will work with two timers instead 6), RAM (four task timers are deleted) and ROM (functions for task timers are deleted).
&lt;/p&gt;

&lt;p&gt;
&lt;strong&gt;Note&lt;/strong&gt;: this substitution is possible for forming delays only. Static timers can&amp;#039;t be used for events waiting with timeouts.
&lt;/p&gt;

&lt;p&gt;
Here is example of forming delay in task using static timer:
&lt;/p&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span class=&quot;co1&quot;&gt;// OAScfg.h&lt;/span&gt;
&lt;span class=&quot;co2&quot;&gt;#define OS_STIMERS  1&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw2&quot;&gt;enum&lt;/span&gt; OS_STIMERS_ENUM &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
   ST_MyTimer           &lt;span class=&quot;co1&quot;&gt;// Static timer's ID&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;sy2&quot;&gt;------------------------------------------------------------&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;// Fragment of program (it is supposed that system tick = 1 ms)&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; Task1 &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
  &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;;;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    ...
    &lt;span class=&quot;me1&quot;&gt;OS_Stimer_Delay&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;ST_MyTimer, &lt;span class=&quot;nu0&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;  &lt;span class=&quot;co1&quot;&gt;// 100 ms delay&lt;/span&gt;
    ...
  &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Example&quot; [5566-6791] --&gt;
&lt;h3&gt;&lt;a name=&quot;maximum_delay_values&quot; id=&quot;maximum_delay_values&quot;&gt;Maximum delay values&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;

Here are maximum possible time intervals that static timers can count for most often system ticks used:

&lt;/p&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0 centeralign&quot;&gt;  &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_timer&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_timer&quot;&gt;OS_Timer&lt;/a&gt;&lt;/span&gt;&amp;#039;s period  &lt;/th&gt;&lt;th class=&quot;col1 centeralign&quot;&gt;  1 byte  &lt;/th&gt;&lt;th class=&quot;col2 centeralign&quot;&gt;  2 bytes  &lt;/th&gt;&lt;th class=&quot;col3 centeralign&quot;&gt;  4 bytes  &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; Range:    &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  0-128     &lt;/td&gt;&lt;td class=&quot;col2 centeralign&quot;&gt;  0-32768  &lt;/td&gt;&lt;td class=&quot;col3 centeralign&quot;&gt;  0-2147483648  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; 1 ms     &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  128 ms   &lt;/td&gt;&lt;td class=&quot;col2 centeralign&quot;&gt;  32 sec    &lt;/td&gt;&lt;td class=&quot;col3 centeralign&quot;&gt;  24 days    &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; 10 ms    &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  1.2 sec  &lt;/td&gt;&lt;td class=&quot;col2 centeralign&quot;&gt;  5 min     &lt;/td&gt;&lt;td class=&quot;col3 centeralign&quot;&gt;  245 days   &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row4&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; 18.2 ms  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  4.6 sec  &lt;/td&gt;&lt;td class=&quot;col2 centeralign&quot;&gt;  9 min     &lt;/td&gt;&lt;td class=&quot;col3 centeralign&quot;&gt;  450 days   &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row5&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; 256 us   &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  65 ms    &lt;/td&gt;&lt;td class=&quot;col2 centeralign&quot;&gt;  8 sec     &lt;/td&gt;&lt;td class=&quot;col3 centeralign&quot;&gt;  6 days     &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row6&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; 1024 us  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  260 ms   &lt;/td&gt;&lt;td class=&quot;col2 centeralign&quot;&gt;  33 sec    &lt;/td&gt;&lt;td class=&quot;col3 centeralign&quot;&gt;  25 days    &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row7&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; 8192 us  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  2 sec    &lt;/td&gt;&lt;td class=&quot;col2 centeralign&quot;&gt;  4 min     &lt;/td&gt;&lt;td class=&quot;col3 centeralign&quot;&gt;  200 days   &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Maximum delay values&quot; [6792-7409] --&gt;
&lt;h2&gt;&lt;a name=&quot;services&quot; id=&quot;services&quot;&gt;Services&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Services&quot; [7410-7431] --&gt;
&lt;h3&gt;&lt;a name=&quot;dynamic_timers1&quot; id=&quot;dynamic_timers1&quot;&gt;Dynamic timers&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0 centeralign&quot;&gt;  Service  &lt;/th&gt;&lt;th class=&quot;col1 centeralign&quot;&gt;  Arguments  &lt;/th&gt;&lt;th class=&quot;col2 centeralign&quot;&gt;  Description  &lt;/th&gt;&lt;th class=&quot;col3 centeralign&quot;&gt;  Properties  &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Creating/Deleting&lt;/strong&gt;    &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_create&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_create&quot;&gt;OS_Dtimer_Create&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(dtimer)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Add dynamic timer in list of active timers  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Atimers&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_not_int.png?id=en%3Aosa%3Aref%3Aservices%3Atimers&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_not_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_not_int.png&quot; class=&quot;media&quot; title=&quot;Not allowed in interrupt&quot; alt=&quot;Not allowed in interrupt&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_delete&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_delete&quot;&gt;OS_Dtimer_Delete&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(dtimer)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Delete dynamic timer from list of active timers  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Atimers&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_not_int.png?id=en%3Aosa%3Aref%3Aservices%3Atimers&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_not_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_not_int.png&quot; class=&quot;media&quot; title=&quot;Not allowed in interrupt&quot; alt=&quot;Not allowed in interrupt&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row4&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Menagement&lt;/strong&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row5&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_run&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_run&quot;&gt;OS_Dtimer_Run&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(dtimer, newtime)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Start counting with given &lt;em&gt;newtime&lt;/em&gt;. Timeout flag is cleared.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Atimers&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row6&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_stop&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_stop&quot;&gt;OS_Dtimer_Stop&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(dtimer)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Stop/pause dynamic timer. Timeout flag remain unchanged.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Atimers&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row7&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_pause&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_pause&quot;&gt;OS_Dtimer_Pause&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(dtimer)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Same as &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_stop&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_stop&quot;&gt;OS_Dtimer_Stop&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Atimers&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row8&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_break&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_break&quot;&gt;OS_Dtimer_Break&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(dtimer)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Stop dynamic timer. Timeout flag became set.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Atimers&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row9&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_continue&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_continue&quot;&gt;OS_Dtimer_Continue&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(dtimer)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Continue dinamic timer&amp;#039;s counting after pause. Timeout flag remain unchanged.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Atimers&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row10&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_update&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_update&quot;&gt;OS_Dtimer_Update&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(dtimer, time)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Re-run static timer for time &lt;em&gt;time&lt;/em&gt; since last overflow. Timeout flag is cleared.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Atimers&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row11&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_add&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_add&quot;&gt;OS_Dtimer_Add&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(dtimer, addtime)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Increase time of dinamic timer counter. Timeout flag remain unchanged.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Atimers&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row12&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Checking&lt;/strong&gt;    &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row13&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/description/data_types#ost_dtimer&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:description:data_types&quot;&gt;_OST_DTIMER&lt;/a&gt; &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_get&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_get&quot;&gt;OS_Dtimer_Get&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(dtimer)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Get dinamic timer&amp;#039;s remaining time.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Atimers&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row14&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_check&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_check&quot;&gt;OS_Dtimer_Check&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(dtimer)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Check for dynamic timer overflowed  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Atimers&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row15&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_isactive&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_isactive&quot;&gt;OS_Dtimer_IsActive&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(dtimer)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Check for dynamic timer present in list of active timers  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Atimers&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row16&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_isstopped&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_isstopped&quot;&gt;OS_Dtimer_IsStopped&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(dtimer)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Check for dynamic timer is stopped  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Atimers&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row17&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_isrun&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_isrun&quot;&gt;OS_Dtimer_IsRun&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(dtimer)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Check for dynamic timer is counting  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Atimers&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row18&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Waiting&lt;/strong&gt;     &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row19&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_wait&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_wait&quot;&gt;OS_Dtimer_Wait&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(dtimer)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Wait for dynamic timer overflowed  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Atimers&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Atimers&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Atimers&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row20&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_dtimer_delay&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_dtimer_delay&quot;&gt;OS_Dtimer_Delay&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(dtimer, delay)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Delay current task using dynamic timer  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Atimers&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Atimers&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Atimers&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Dynamic timers&quot; [7432-11261] --&gt;
&lt;h3&gt;&lt;a name=&quot;static_timers1&quot; id=&quot;static_timers1&quot;&gt;Static timers&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0 centeralign&quot;&gt;  Service  &lt;/th&gt;&lt;th class=&quot;col1 centeralign&quot;&gt;  Arguments  &lt;/th&gt;&lt;th class=&quot;col2 centeralign&quot;&gt;  Description  &lt;/th&gt;&lt;th class=&quot;col3 centeralign&quot;&gt;  Properties  &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Menagement&lt;/strong&gt; &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_stimer_run&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_stimer_run&quot;&gt;OS_Stimer_Run&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(stimer_id, time)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Start counting static timer  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Atimers&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_stimer_stop&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_stimer_stop&quot;&gt;OS_Stimer_Stop&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(stimer_id)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Stop/pause static timer. Timeout flag is set.  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Atimers&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row4&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_stimer_pause&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_stimer_pause&quot;&gt;OS_Stimer_Pause&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(stimer_id)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Same as &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_stimer_stop&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_stimer_stop&quot;&gt;OS_Stimer_Stop&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Atimers&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row5&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_stimer_continue&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_stimer_continue&quot;&gt;OS_Stimer_Continue&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(stimer_id)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Continue counting after pause  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Atimers&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row6&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Checking&lt;/strong&gt;    &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row7&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/description/data_types#ost_stimer&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:description:data_types&quot;&gt;_OST_STIMER&lt;/a&gt; &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_stimer_get&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_stimer_get&quot;&gt;OS_Stimer_Get&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(stimer_id)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Get static timer&amp;#039;s remaining time  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Atimers&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row8&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_stimer_check&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_stimer_check&quot;&gt;OS_Stimer_Check&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(stimer_id)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Check for static timer overflowed  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Atimers&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Atimers&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row9&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;code&gt;bool &lt;/code&gt;&lt;br/&gt;
 &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_stimer_isrun&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_stimer_isrun&quot;&gt;OS_Stimer_IsRun&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(stimer_id)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Check for static timer is counting  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Atimers&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Atimers&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row10&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;4&quot;&gt; &lt;strong&gt;Waiting&lt;/strong&gt;     &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row11&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_stimer_wait&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_stimer_wait&quot;&gt;OS_Stimer_Wait&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(stimer_id)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Wait for static timer overflowed  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Atimers&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Atimers&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Atimers&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row12&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_stimer_delay&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_stimer_delay&quot;&gt;OS_Stimer_Delay&lt;/a&gt;&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;  &lt;code&gt;(stimer_id, delay)&lt;/code&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Delay current task using static timer  &lt;/td&gt;&lt;td class=&quot;col3 leftalign&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_to.png?id=en%3Aosa%3Aref%3Aservices%3Atimers&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_to.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_to.png&quot; class=&quot;media&quot; title=&quot;Service uses system timer&quot; alt=&quot;Service uses system timer&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_task.png?id=en%3Aosa%3Aref%3Aservices%3Atimers&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_task.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_task.png&quot; class=&quot;media&quot; title=&quot;Allowed only in task&quot; alt=&quot;Allowed only in task&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_ct_sw.png?id=en%3Aosa%3Aref%3Aservices%3Atimers&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_ct_sw.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_ct_sw.png&quot; class=&quot;media&quot; title=&quot;Switches contexts&quot; alt=&quot;Switches contexts&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Static timers&quot; [11262-] --&gt;</description>
    </item>
</rdf:RDF>
