docs/library/machine: Add note on interrupts being critical to system.

This commit is contained in:
Patrick Joy 2022-04-13 21:32:13 +10:00 committed by Damien George
parent f12754af06
commit 3d58bb23c2
1 changed files with 17 additions and 0 deletions

View File

@ -48,6 +48,23 @@ Reset related functions
Interrupt related functions Interrupt related functions
--------------------------- ---------------------------
The following functions allow control over interrupts. Some systems require
interrupts to operate correctly so disabling them for long periods may
compromise core functionality, for example watchdog timers may trigger
unexpectedly. Interrupts should only be disabled for a minimum amount of time
and then re-enabled to their previous state. For example::
import machine
# Disable interrupts
state = machine.disable_irq()
# Do a small amount of time-critical work here
# Enable interrupts
machine.enable_irq(state)
.. function:: disable_irq() .. function:: disable_irq()
Disable interrupt requests. Disable interrupt requests.