OSA : OS_DI

char OS_DI ()

Not allowed in interrupt

Disable interrupts. Current value of GIEx is stored.

Call allowed:

Not in interrupt

Parameters:

None

Returns:

char value of GIEx flags before disabling

Example:

void Task (void)
{
    char temp;
    for (;;) {
        /*...*/
        temp = OS_DI();  // Disable interrupts and store previous GIEx value
        /*...*/
        OS_RI(temp);     // Restore previously saved value of GIEx
        /*...*/
    }
}

See also