beautypg.com

Wavetronix Click 500 (programmable controller) (CLK-500) - Developer Guide User Manual

Page 60

background image

CHAPTER 6 • TIMERS AND CLOCKS 59

of LEDs. The UpdateProgress function is called by the main idle loop to update the LEDs.

void UpdateProgress( void )
{
// Process update from the Timer ISR during idle time
if (

(ProgressStateRead == FALSE)

&& (PlayPauseState == PROGRESS_STATE_PLAY)
)
{
ClickLedOff(ALLYELLOW);
ClickLedOn(YELLOW1+ProgressState);
ProgressStateRead = TRUE;
}
}

In summary, the Click 500 OS consists of the operating modes and operating tasks that

execute in main idle loop as assisted by the interrupt timer.

ProgressState = 0;
ProgressCounter = 0;
ProgressStateRead = TRUE;
}

ProgressCounter++;
if ( (ProgressCounter >= 22)
&& (ProgressStateRead == TRUE)
)
{
ProgressCounter = 0;
ProgressState++;
if (ProgressState > 3)
{
ProgressState = 0;
}
ProgressStateRead = FALSE;
}
}