Skip to content

Instantly share code, notes, and snippets.

@kingcoyote
Last active August 29, 2015 13:56
Show Gist options
  • Save kingcoyote/8939904 to your computer and use it in GitHub Desktop.
Save kingcoyote/8939904 to your computer and use it in GitHub Desktop.
// interrupt service routine to handle all interrupts
void interrupt main_isr(void) {
// if Timer 0's interrupt flag has been raised
if (TMR0IF) {
// increment the millisecond counter
milliseconds++;
// set the Timer 0 value to 65536 - 2000 = 63536
TMR0 = 63536;
// lower the interrupt flag
TMR0IF = 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment