diff options
| author | Chris Webb <chris@arachsys.com> | 2025-06-16 12:35:51 +0100 |
|---|---|---|
| committer | Chris Webb <chris@arachsys.com> | 2025-06-16 12:35:51 +0100 |
| commit | 816246836e00b6c2af0ba26e8d16c234b43da4a0 (patch) | |
| tree | 1706098a3fcd17c880661de522abceb88472c689 | |
| parent | 8f85edad8601c87a107b51a1b417600fbb8d8087 (diff) | |
docs/rp2: Document the new rp2 Timer hard= option.
Signed-off-by: Chris Webb <chris@arachsys.com>
| -rw-r--r-- | docs/rp2/quickref.rst | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/docs/rp2/quickref.rst b/docs/rp2/quickref.rst index 23071d772..ec3144299 100644 --- a/docs/rp2/quickref.rst +++ b/docs/rp2/quickref.rst @@ -135,6 +135,12 @@ Use the :mod:`machine.Timer` class:: tim = Timer(period=5000, mode=Timer.ONE_SHOT, callback=lambda t:print(1)) tim.init(period=2000, mode=Timer.PERIODIC, callback=lambda t:print(2)) +By default, timer callbacks run as soft IRQs so they can allocate but +are prone to GC jitter and delays. Pass ``hard=True`` to the ``Timer()`` +constructor or ``init()`` method to run the callback in hard-IRQ context +instead. This reduces delay and jitter, but see :ref:`isr_rules` for the +restrictions that apply to hard-IRQ handlers. + .. _rp2_Pins_and_GPIO: |
