/** * This is the timer interrupt which generates the output. */ void __ISR(_TIMER_5_VECTOR, ipl1) Timer5Handler(void) { /* Clear TMR5 interrupt flag. */ IFS0bits.T5IF = 0; column = wrapAround(increment(column), IMAGE_WIDTH); semaphore = 1; } int main() { /* (...) */ while (1) { if (semaphore != 0) { semaphore = 0; printout(column); } } return 0; }