beautypg.com

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

Page 67

background image

66

CHAPTER 6 • TIMERS AND CLOCKS

ClickTimerRegisterCallback(ProgressTimerISR);
PlayPauseState = PROGRESS_STATE_PLAY;
Startup = TRUE;
WaitTimer.active = FALSE;
}

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;
}
}

void PlayPauseBtnCheck( void )
{
if (ClickBtnPressed())
{
switch (PlayPauseState)
{
case PROGRESS_STATE_PLAY:
{
PlayPauseState = PROGRESS_STATE_PAUSE;
ClickLedOn(RED1);
}
break;

case PROGRESS_STATE_PAUSE:
{
PlayPauseState = PROGRESS_STATE_PLAY;
ClickLedOff(RED1);
}
break;

default: