Skip to content

Commit 54b247d

Browse files
committed
docs/rp2: Document the new rp2 Timer hard= option.
Signed-off-by: Chris Webb <chris@arachsys.com>
1 parent 3e8026d commit 54b247d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

docs/rp2/quickref.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,11 @@ 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.
142+
138143

139144
.. _rp2_Pins_and_GPIO:
140145

0 commit comments

Comments
 (0)