Skip to main content

Interrupt Class

NuGet: GHIElectronics.TinyCLR.Native
Assembly: GHIElectronics.TinyCLR.Native
Namespace: GHIElectronics.TinyCLR.Native

CPU interrupt mask. Wrap a tight critical section in Disable/Enable to prevent context switches and hardware interrupts from running during it. Keep the disabled window short — while interrupts are off, RTOS threads cannot preempt and ISR latencies grow.

public static class Interrupt

Methods​

Enable()​

public static extern void Enable()

Re-enables interrupts after a matching Disable.

Disable()​

public static extern void Disable()

Disables interrupts on the current core. Always pair with Enable.

IsDisabled()​

public static extern bool IsDisabled()

True when interrupts are currently masked.

Returns bool