Created
April 20, 2014 07:33
-
-
Save yamamaya/11107646 to your computer and use it in GitHub Desktop.
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
// Timer1 interrupt handler | |
void __attribute__( ( interrupt ) ) _T1Interrupt( ) { | |
flag1 = 1; | |
flag2 = 1; | |
IFS0bits.T1IF = 0; | |
} | |
while ( 1 ) { | |
IEC0bits.T1IE = 0; // Disable Timer1 interrupt | |
f1 = flag1; | |
f2 = flag2; | |
flag1 = 0; | |
flag2 = 0; | |
IEC0bits.T1IE = 1; // Enable Timer1 interrupt | |
if ( ! f1 && f2 ) { | |
// what's up!? | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment