beautypg.com

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

Page 186

background image

APPENDIX

• CLICK 500 DEVELOPER GUIDE

185

ClickUtilConditionalPause

Waits for given number of milliseconds or for the PARAMETER “conditionFunc” to return

TRUE.

˽

LIBRARY – click500util.LIB

˽

SYNTAX –

bool ClickUtilConditionalPause( int milliseconds,
bool (*conditionFunc)() );

˽

PARAMETER1 – The time in milliseconds to delay.

˽

PARAMETER2 – The function that will be called to check if the delay should continue

or break.

˽

RETURN VALUE – FALSE – Waited for full number of milliseconds. TRUE - Stopped

early by condition.

˽

EXAMPLE –

// waits for 5.5 sec maximum but will terminate early if the but-

ton is pressed

void myFunc( void )
{
ClickUtilConditionalPause(5500, ClickBtnPressed);
}

˽

SEE ALSO – ClickUtilPause