<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Netusim ako to presne funguje, ale v dokumentacii na to
      upozornuju.</p>
    <p>ale je mi cudne ze sa to skrati. O kolko sa to skrati?</p>
    <p>Myre<br>
    </p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 2. 8. 2021 10:35, Jaroslav Buchta
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:6478535f-fed3-91da-fd9d-a3c892b4898b@hascomp.cz">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <div class="moz-cite-prefix">To jako opravdu vTaskDelay muze
        fungovat nespolehlive, teda jeste k tomu se zkratit? <br>
      </div>
      <div class="moz-cite-prefix">To snad primo pocita systemova
        preruseni od casovace (default tusim 100Hz), ze by se nejaky
        nestihly bych jeste pochopil...</div>
      <div class="moz-cite-prefix"><br>
      </div>
      <div class="moz-cite-prefix">Dne 02.08.2021 v 9:49 as5s napsal(a):<br>
      </div>
      <blockquote type="cite"
        cite="mid:7be7b28f-486b-6042-224c-c29f70e2ce70@gmail.com">
        <meta http-equiv="Content-Type" content="text/html;
          charset=UTF-8">
        <p>Dobry den,</p>
        <p>skuste pozriet na vTaskDelayUntil()</p>
        <p><a class="moz-txt-link-freetext"
href="https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/system/freertos.html#_CPPv415vTaskDelayUntilPC10TickType_tK10TickType_t"
            moz-do-not-send="true">https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/system/freertos.html#_CPPv415vTaskDelayUntilPC10TickType_tK10TickType_t</a></p>
        <p>mozno vam to bude stacit.</p>
        <p>Myre<br>
        </p>
        <div class="moz-cite-prefix">On 2. 8. 2021 9:45, Jan Půhoný
          wrote:<br>
        </div>
        <blockquote type="cite"
cite="mid:CAEwSxSEWcQeVBq=FroAkjpRNvi=L555d4VpQ1fFMCsaw4AXjHA@mail.gmail.com">
          <meta http-equiv="content-type" content="text/html;
            charset=UTF-8">
          <div dir="ltr">Dobrý den,
            <div><br>
            </div>
            <div>mám tady další zádrhel - mějme funkci, která ovládá
              výstupní piny, potřebuji po nastavení udžet cca 20 sekund
              v HIGH a pak vrátit vše do low. Jedná se o otevítání a
              zavírání ventilu. Přidal jsem tedy mezi to <span style="font-family:Consolas,"Courier New",monospace;font-size:14px;white-space:pre;background-color:rgb(30,30,30);color:rgb(220,220,170)">vTaskDelay</span><span style="color:rgb(212,212,212);font-family:Consolas,"Courier New",monospace;font-size:14px;white-space:pre;background-color:rgb(30,30,30)">(</span><span style="font-family:Consolas,"Courier New",monospace;font-size:14px;white-space:pre;background-color:rgb(30,30,30);color:rgb(181,206,168)">20000</span><span style="color:rgb(212,212,212);font-family:Consolas,"Courier New",monospace;font-size:14px;white-space:pre;background-color:rgb(30,30,30)"> / </span><span style="font-family:Consolas,"Courier New",monospace;font-size:14px;white-space:pre;background-color:rgb(30,30,30);color:rgb(86,156,214)">portTICK_PERIOD_MS</span><span style="color:rgb(212,212,212);font-family:Consolas,"Courier New",monospace;font-size:14px;white-space:pre;background-color:rgb(30,30,30)">);</span> 
              , problém je v tom, že někdy se to zpoždění značně zkrátí
              a ventil zůstane napolo otevřený. Jak se toto dá ošetřit
              aby se vTaskDelay(20000 / portTICK_PERIOD_MS); nikdy
              nemohlo zkrátit a bylo dodrženo.</div>
            <div><br>
            </div>
            <div>Volám to pak standardně přes xTaskCreatePinnedToCore()
              ....</div>
            <div><br>
            </div>
            <div>
              <div style="color:rgb(212,212,212);background-color:rgb(30,30,30);font-family:Consolas,"Courier New",monospace;font-size:14px;line-height:19px;white-space:pre"><div><span style="color:rgb(86,156,214)">void</span> <span style="color:rgb(220,220,170)">vent1On</span>(<span style="color:rgb(86,156,214)">void</span> <span style="color:rgb(86,156,214)">*</span> <span style="color:rgb(156,220,254)">parameter</span>){</div><div>  <span style="color:rgb(197,134,192)">for</span>(;;){<span style="color:rgb(106,153,85)"> // infinite loop    </span></div>

<div>    <span style="color:rgb(156,220,254)">button1</span>.<span style="color:rgb(220,220,170)">update</span>(<span style="color:rgb(181,206,168)">1</span>);</div>
<div>    <span style="color:rgb(220,220,170)">digitalWrite</span>(<span style="color:rgb(156,220,254)">ventMain1</span>, <span style="color:rgb(86,156,214)">HIGH</span>);</div><div>    <span style="color:rgb(220,220,170)">digitalWrite</span>(<span style="color:rgb(156,220,254)">ventOn1</span>, <span style="color:rgb(86,156,214)">HIGH</span>);</div><div>    <span style="color:rgb(220,220,170)">digitalWrite</span>(<span style="color:rgb(156,220,254)">ledPinRed</span>, <span style="color:rgb(86,156,214)">HIGH</span>);</div>
<div><span style="color:rgb(106,153,85)">    // Pause the task fo 20s</span></div><div>    <span style="color:rgb(220,220,170)">vTaskDelay</span>(<span style="color:rgb(181,206,168)">20000</span> / <span style="color:rgb(86,156,214)">portTICK_PERIOD_MS</span>);</div><div>    </div><div>    <span style="color:rgb(220,220,170)">digitalWrite</span>(<span style="color:rgb(156,220,254)">ventMain1</span>, <span style="color:rgb(86,156,214)">LOW</span>);</div><div>    <span style="color:rgb(220,220,170)">digitalWrite</span>(<span style="color:rgb(156,220,254)">ventOn1</span>, <span style="color:rgb(86,156,214)">LOW</span>);</div><div>    <span style="color:rgb(220,220,170)">digitalWrite</span>(<span style="color:rgb(156,220,254)">ledPinRed</span>, <span style="color:rgb(86,156,214)">LOW</span>);</div>

<div>    <span style="color:rgb(220,220,170)">vTaskDelete</span>(<span style="color:rgb(86,156,214)">NULL</span>);<span style="color:rgb(106,153,85)"> //spustí se jen jednou</span></div><div>  }</div><div>}</div></div>
              <div><br>
              </div>
              <div><br>
              </div>
              <div>xTaskCreatePinnedToCore(<br>
                    vent1On,    // Function that should be called<br>
                    "vent1On",   // Name of the task (for debugging)<br>
                    1000,            // Stack size (bytes)<br>
                    NULL,            // Parameter to pass<br>
                    1,               // Task priority<br>
                    NULL,            // Task handle<br>
                    0            // Core 1/0<br>
                  );<br>
              </div>
              <div><br clear="all">
                <div>
                  <div dir="ltr" class="gmail_signature"
                    data-smartmail="gmail_signature">
                    <div dir="ltr">
                      <div>
                        <div dir="ltr">
                          <div>HP</div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
                <br>
              </div>
            </div>
          </div>
          <br>
          <div class="gmail_quote">
            <div dir="ltr" class="gmail_attr">so 31. 7. 2021 v 8:27
              odesílatel Jan Půhoný <<a
                href="mailto:konference@puhy.cz" moz-do-not-send="true">konference@puhy.cz</a>>
              napsal:<br>
            </div>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px
              0.8ex;border-left:1px solid
              rgb(204,204,204);padding-left:1ex">
              <div dir="ltr">Díky, zkusil jsem jak 2000 tak 4000 ale
                stále stejné. Resetuje se to pořád dokola s tímto:
                <div><br>
                </div>
                <div>rst:0x1 (POWERON_RESET),boot:0x12
                  (SPI_FAST_FLASH_BOOT)<br>
                  configsip: 0, SPIWP:0xee<br>
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00<br>
                  mode:DIO, clock div:2<br>
                  load:0x3fff0018,len:4<br>
                  load:0x3fff001c,len:1044<br>
                  load:0x40078000,len:10124<br>
                  load:0x40080400,len:5828<br>
                  entry 0x400806a8</div>
                <div><br>
                </div>
                <div><b>Ale zjistil jsem, že to dělá jen pokud to
                    napájím z USB. Když to dám přímo do svého zapojení,
                    kde je pořádná kapacita na Vin, tak to drží. Takže
                    skutečně jen problém s napájením.</b></div>
                <div><br>
                </div>
                <div>Teď už to budu programovat jen přes OTA, takže
                  vyřešeno.</div>
                <div><br>
                </div>
                <div>
                  <div>HP<br>
                    <br>
                  </div>
                </div>
              </div>
              <br>
              <div class="gmail_quote">
                <div dir="ltr" class="gmail_attr">so 31. 7. 2021 v 6:44
                  odesílatel Jaroslav Buchta <<a
                    href="mailto:jaroslav.buchta@hascomp.cz"
                    target="_blank" moz-do-not-send="true">jaroslav.buchta@hascomp.cz</a>>
                  napsal:<br>
                </div>
                <blockquote class="gmail_quote" style="margin:0px 0px
                  0px 0.8ex;border-left:1px solid
                  rgb(204,204,204);padding-left:1ex">kod jsem nezkoumal
                  ale na prvni pohled mi prijde maly zasobnik pro <br>
                  vlakno, tady je to tusim v btech. dal bych 2 nebo 4K
                  na zkousku<br>
                  _______________________________________________<br>
                  HW-list mailing list  -  sponsored by <a
                    href="http://www.HW.cz" rel="noreferrer"
                    target="_blank" moz-do-not-send="true">www.HW.cz</a><br>
                  <a href="mailto:Hw-list@list.hw.cz" target="_blank"
                    moz-do-not-send="true">Hw-list@list.hw.cz</a><br>
                  <a href="http://list.hw.cz/mailman/listinfo/hw-list"
                    rel="noreferrer" target="_blank"
                    moz-do-not-send="true">http://list.hw.cz/mailman/listinfo/hw-list</a><br>
                </blockquote>
              </div>
            </blockquote>
          </div>
          <br>
          <fieldset class="mimeAttachmentHeader"></fieldset>
          <pre class="moz-quote-pre" wrap="">_______________________________________________
HW-list mailing list  -  sponsored by <a class="moz-txt-link-abbreviated" href="http://www.HW.cz" moz-do-not-send="true">www.HW.cz</a>
<a class="moz-txt-link-abbreviated" href="mailto:Hw-list@list.hw.cz" moz-do-not-send="true">Hw-list@list.hw.cz</a>
<a class="moz-txt-link-freetext" href="http://list.hw.cz/mailman/listinfo/hw-list" moz-do-not-send="true">http://list.hw.cz/mailman/listinfo/hw-list</a>
</pre>
        </blockquote>
        <br>
        <fieldset class="mimeAttachmentHeader"></fieldset>
        <pre class="moz-quote-pre" wrap="">_______________________________________________
HW-list mailing list  -  sponsored by <a class="moz-txt-link-abbreviated" href="http://www.HW.cz" moz-do-not-send="true">www.HW.cz</a>
<a class="moz-txt-link-abbreviated" href="mailto:Hw-list@list.hw.cz" moz-do-not-send="true">Hw-list@list.hw.cz</a>
<a class="moz-txt-link-freetext" href="http://list.hw.cz/mailman/listinfo/hw-list" moz-do-not-send="true">http://list.hw.cz/mailman/listinfo/hw-list</a>
</pre>
      </blockquote>
      <p><br>
      </p>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
HW-list mailing list  -  sponsored by <a class="moz-txt-link-abbreviated" href="http://www.HW.cz">www.HW.cz</a>
<a class="moz-txt-link-abbreviated" href="mailto:Hw-list@list.hw.cz">Hw-list@list.hw.cz</a>
<a class="moz-txt-link-freetext" href="http://list.hw.cz/mailman/listinfo/hw-list">http://list.hw.cz/mailman/listinfo/hw-list</a>
</pre>
    </blockquote>
  </body>
</html>