Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:iot-open:practical:hardware:sut:esp32:adv1_1 [2024/03/26 08:43] – [ADV1: Using timers to execute code asynchronously] pczekalskien:iot-open:practical:hardware:sut:esp32:adv1_1 [2025/10/03 11:22] (current) – [FAQ] pczekalski
Line 117: Line 117:
  
 === Step 7 === === Step 7 ===
-This way, a main loop is empty: everything runs asynchronously, thanks to the timers.+This way, a main loop is empty: everything runs asynchronously, thanks to the timers. As suggested above, when timer handlers require long or unpredictable execution time (e.g. external communication, waiting for the reply), handlers should set a flag that is read in the main loop to execute the appropriate task and then clear the flag.
 <code c> <code c>
 void loop() void loop()
Line 128: Line 128:
  
 ===== FAQ ===== ===== FAQ =====
-**How many timers can I use?**: ESP32-S3 has 4 hardware timers. You may trick this limitation by using smart handlers that have, e.g., an internal counter and internally execute every N-th cycle. This helps to simulate more timers in a software way.+**How many timers can I use?**: ESP32-S3 has 4 hardware timers. You can circumvent this limitation by using smart handlers that have, for example, an internal counter and execute every Nth cycle internally. This helps simulate multiple timers in a software-based manner.
  
 <WRAP noprint> <WRAP noprint>
en/iot-open/practical/hardware/sut/esp32/adv1_1.1711442606.txt.gz · Last modified: 2024/03/26 08:43 by pczekalski
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0