beautypg.com

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

Page 65

background image

64

CHAPTER 6 • TIMERS AND CLOCKS

char Startup;

void main( void )
{
ClickMenuAddMode( Mode1, Setup, BLUE, 0, 0 );
ClickMenuAddMode( Mode2, Setup, GREEN, 0, 0 );
ClickMenuStart();
}

void Mode1( void )
{
if (Startup == TRUE)
{
// Non-blocking wait
if (WaitTimer.active == FALSE)
{
ClickLedOn(ALLRED);
ClickUtilTimerSet(&WaitTimer, 10000);
}
if (ClickUtilTimerExpired(&WaitTimer))
{
Startup = FALSE;
ClickLedOff(ALLRED);
}
}
else
{
PlayPauseBtnCheck();
}
UpdateProgress();
}

void Mode2( void )
{
if (Startup == TRUE)
{
// Blocking wait
ClickLedOn(ALLRED);
ClickUtilPause(10000);
ClickUtilUserWatchDogHit();