delayedCallMsR — elayed function call for each specified number of milliseconds.

Description:

void delayedCallMsR(void *func, u16 time[,u32 data]);

Delayed func function call every time milliseconds.

List of parameters

func

Pointer to the function.

time

Time in milliseconds. Milliseconds can be specified only in multiples of 50. Max number of milliseconds which is possible to specify is 10000 units.

Example:

<item id="524" LAMP="524:19" name="Test for delayedCallMsR function" type="script">

void onOffLamp() 
{
	setStatus(LAMP, ![LAMP]);
}

V-ID/V-ADDR 
{
	if(opt0())
	{
		delayedCallMsR(onOffLamp, 500);
	}

	if(!opt0())
	{
		cancelDelayedCall(onOffLamp);
	}
}

</item>

The result of performing this example:

Every 500 milliseconds the element LAMP will change its status to the opposite one (if it is activated – it will be disactivated and vice a versa)

Note:

· Before the previous call is triggered the 2nd delayed call will be generated but not recorded over the previous one when assigning the delayed recall to one and the same function.

Use cancelDelayedCall for suspending the delayed function call.