Skip to content

Instantly share code, notes, and snippets.

@bradford-hamilton
Last active April 24, 2023 22:31
Show Gist options
  • Save bradford-hamilton/657d188ed773a41e8fd0aaf9521efcd1 to your computer and use it in GitHub Desktop.
Save bradford-hamilton/657d188ed773a41e8fd0aaf9521efcd1 to your computer and use it in GitHub Desktop.
ATtiny85 - enabling global interrupts with the SREG register instead of assembly
...
// Add the SREG register
#define SREG REG(0x3F)
...
int main()
{
...
// Write 1 to bit 7 (I-bit) for Global Interrupt Enable
SREG |= BV_MASK(7);
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment