Difference between revisions of "Timer Install"

From WikiPrizm
Jump to navigationJump to search
(Created page with "{{syscall | name = Timer_Install | header = fxcg/system.h | index = 0x08D9 | signature = int Timer_Install(int InternalTimerID, void (*handler)(void), int elapse) | synopsis =...")
 
Line 6: Line 6:
 
| synopsis = Installs a [[Timers|timer]], optionally at a specific slot, which will run periodically at a given frequency.
 
| synopsis = Installs a [[Timers|timer]], optionally at a specific slot, which will run periodically at a given frequency.
 
| parameters = * '''InternalTimerID''' - slot to install the timer on. If 0, the system will automatically choose a free user timer slot - this is the recommended operation mode. For more information on the slots see [[Timers]].
 
| parameters = * '''InternalTimerID''' - slot to install the timer on. If 0, the system will automatically choose a free user timer slot - this is the recommended operation mode. For more information on the slots see [[Timers]].
* '''handler''' - pointer to function that will run periodically. This function must not call any direct-display (DD) syscall, as these are not reentrant.
+
* '''handler''' - pointer to function that will run periodically. This function should not take a long time to return, and must not call any direct-display (DD) syscall, as these are not reentrant.
 
* '''elapse''' - time, in milliseconds, between each call to '''handler'''.
 
* '''elapse''' - time, in milliseconds, between each call to '''handler'''.
 
| returns = The number of the slot where the timer is installed. This is the number that should be used as parameter to other timer syscalls.
 
| returns = The number of the slot where the timer is installed. This is the number that should be used as parameter to other timer syscalls.
 
}}
 
}}
 
[[Category:Syscalls:Timers]]
 
[[Category:Syscalls:Timers]]

Revision as of 17:32, 1 August 2014


Synopsis

Header: fxcg/system.h
Syscall index: 0x08D9
Function signature: int Timer_Install(int InternalTimerID, void (*handler)(void), int elapse)

Installs a timer, optionally at a specific slot, which will run periodically at a given frequency.

Parameters

  • InternalTimerID - slot to install the timer on. If 0, the system will automatically choose a free user timer slot - this is the recommended operation mode. For more information on the slots see Timers.
  • handler - pointer to function that will run periodically. This function should not take a long time to return, and must not call any direct-display (DD) syscall, as these are not reentrant.
  • elapse - time, in milliseconds, between each call to handler.

Returns

The number of the slot where the timer is installed. This is the number that should be used as parameter to other timer syscalls.