PtTimerArm()

Arm a timer event on a widget

Synopsis:

int PtTimerArm( PtWidget_t *widget, 
                unsigned msec );

Library:

ph

Description:

This function arms a timer event to be trigger after msec milliseconds. When the timer event is triggered, it's sent to the widget specified by widget. For this widget to receive the event, it must provide a raw callback of type Ph_EV_TIMER.


Note: Any pending timers for a widget are removed automatically when the widget is unrealized.

You typically use this routine when you're building custom widgets. Some widgets (such as PtTerminal) already use this type of timer, so calling PtTimerArm() may have unexpected results.


To disarm any timers that might be pending for the widget, call PtTimerArm() with msec set to 0.

Returns:

0
Successful completion.
-1
An error occurred.

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PhTimerArm(), RtTimerCreate(), RtTimerDelete(), RtTimerGetTime(), RtTimerSetTime()

Timers in the Working with Code chapter of the Photon Programmer's Guide