File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,23 @@ Reset related functions
4848Interrupt related functions
4949---------------------------
5050
51+ The following functions allow control over interrupts. Some systems require
52+ interrupts to operate correctly so disabling them for long periods may
53+ compromise core functionality, for example watchdog timers may trigger
54+ unexpectedly. Interrupts should only be disabled for a minimum amount of time
55+ and then re-enabled to their previous state. For example::
56+
57+ import machine
58+
59+ # Disable interrupts
60+ state = machine.disable_irq()
61+
62+ # Do a small amount of time-critical work here
63+
64+ # Enable interrupts
65+ machine.enable_irq(state)
66+
67+
5168.. function :: disable_irq()
5269
5370 Disable interrupt requests.
You can’t perform that action at this time.
0 commit comments