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
48
48
Interrupt related functions
49
49
---------------------------
50
50
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
+
51
68
.. function :: disable_irq()
52
69
53
70
Disable interrupt requests.
You can’t perform that action at this time.
0 commit comments