docs/library/machine: Update description of disable/enable IRQ funcs.

hacking-on-plane
Damien George 2016-09-23 13:15:58 +10:00
parent 7df9291b6c
commit eeb9d99333
1 changed files with 7 additions and 9 deletions

View File

@ -24,17 +24,15 @@ Interrupt related functions
.. function:: disable_irq() .. function:: disable_irq()
Disable interrupt requests. Disable interrupt requests.
Returns the previous IRQ state: ``False``/``True`` for disabled/enabled IRQs Returns the previous IRQ state which should be considered an opaque value.
respectively. This return value can be passed to enable_irq to restore This return value should be passed to the ``enable_irq`` function to restore
the IRQ to its original state. interrupts to their original state, before ``disable_irq`` was called.
.. function:: enable_irq(state=True) .. function:: enable_irq(state)
Enable interrupt requests. Re-enable interrupt requests.
If ``state`` is ``True`` (the default value) then IRQs are enabled. The ``state`` parameter should be the value that was returned from the most
If ``state`` is ``False`` then IRQs are disabled. The most common use of recent call to the ``disable_irq`` function.
this function is to pass it the value returned by ``disable_irq`` to
exit a critical section.
Power related functions Power related functions
----------------------- -----------------------