Last active
April 24, 2023 22:31
-
-
Save bradford-hamilton/657d188ed773a41e8fd0aaf9521efcd1 to your computer and use it in GitHub Desktop.
ATtiny85 - enabling global interrupts with the SREG register instead of assembly
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
// 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