summaryrefslogtreecommitdiff
path: root/docs/library/machine.TimerWiPy.rst
diff options
context:
space:
mode:
authorAngus Gratton <angus@redyak.com.au>2025-11-05 11:22:18 +1100
committerDamien George <damien@micropython.org>2025-12-03 15:16:58 +1100
commit0b1a6bebae857053a0c6cc865e3ca38a8f5f28df (patch)
treecfe027d9ba13093732802098cb2531d0012c8eb7 /docs/library/machine.TimerWiPy.rst
parent5ea9a2662d9f530f88d566aec76cfaef5f6d392d (diff)
docs/library/machine.Timer: Explain the id parameter in more detail.
As noted in discussion on PR #18263, the id parameter is optional on ports that support virtual timers. Add some more general explanation of hardware vs virtual timers, and remove redundant documentation about timer callbacks in favour of the isr_rules page. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
Diffstat (limited to 'docs/library/machine.TimerWiPy.rst')
-rw-r--r--docs/library/machine.TimerWiPy.rst13
1 files changed, 3 insertions, 10 deletions
diff --git a/docs/library/machine.TimerWiPy.rst b/docs/library/machine.TimerWiPy.rst
index 54280a599..17215d502 100644
--- a/docs/library/machine.TimerWiPy.rst
+++ b/docs/library/machine.TimerWiPy.rst
@@ -18,16 +18,6 @@ defines a baseline operation of executing a callback with a given period
(or once after some delay), and allow specific boards to define more
non-standard behaviour (which thus won't be portable to other boards).
-See discussion of :ref:`important constraints <machine_callbacks>` on
-Timer callbacks.
-
-.. note::
-
- Memory can't be allocated inside irq handlers (an interrupt) and so
- exceptions raised within a handler don't give much information. See
- :func:`micropython.alloc_emergency_exception_buf` for how to get around this
- limitation.
-
Constructors
------------
@@ -134,6 +124,9 @@ Methods
``TimerWiPy.ONE_SHOT``. In the case that mode is ``TimerWiPy.PWM`` then trigger must be equal to
``TimerWiPy.MATCH``.
+ Note that callback handlers are hard interrupts, and the constraints described in :ref:`isr_rules`
+ apply when they are executed.
+
Returns a callback object.
.. method:: timerchannel.freq([value])