Skip to content

Commit 8162468

Browse files
committed
docs/rp2: Document the new rp2 Timer hard= option.
Signed-off-by: Chris Webb <[email protected]>
1 parent 8f85eda commit 8162468

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

docs/rp2/quickref.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,12 @@ Use the :mod:`machine.Timer` class::
135135
tim = Timer(period=5000, mode=Timer.ONE_SHOT, callback=lambda t:print(1))
136136
tim.init(period=2000, mode=Timer.PERIODIC, callback=lambda t:print(2))
137137

138+
By default, timer callbacks run as soft IRQs so they can allocate but
139+
are prone to GC jitter and delays. Pass ``hard=True`` to the ``Timer()``
140+
constructor or ``init()`` method to run the callback in hard-IRQ context
141+
instead. This reduces delay and jitter, but see :ref:`isr_rules` for the
142+
restrictions that apply to hard-IRQ handlers.
143+
138144

139145
.. _rp2_Pins_and_GPIO:
140146

0 commit comments

Comments
 (0)