##### Shinobi Library - Timer Function

# syTmrGenSetInt

Authorizes interrupts by a general-purpose timer

### FORMAT

`

  void syTmrGenSetInt( *func, *param )
  void *func
  void *param

`

### PARAMETER

  `*func` | Function that is called when the counter value reaches "0"
  `*param` | Pointer to parameter handed to function

### RETURN

  None

### DESCRIPTION

  The general-purpose timer is a subtraction-type timer that is designed to generate a timer interrupt once the timer count value reaches "0." This function registers the function that is called back when this timer interrupt is generated. Once the registered function is called, the function registration becomes invalid. Therefore, in order to consecutively call timer interrupts, it is necessary to register the callback function each time with this function. If NULL is specified in the parameter, wait until the counter reaches 0 to exit this function.

### EXAMPLE

      /* Callback function example */
        void IntFunc(void* param)
        {
           IntCount = param;                 /* Save the parameters     */
           syTmrGenSetInt(IntFunc, param+1); /* Continue interrupt generation */
           syTmrGenSetCount(0-10000);        /* Set the initial value in the counter*/
           syTmrGenStart();                  /* Restart the timer */
        }

### NOTE

  If this function is called when an interrupt callback function has already been registered, only the function that was registered last is valid. If the timer is stopped and this function is called with NULL specified for the callback function, start up the timer within this function.

syTmrGenSetInt

COPYRIGHT © SEGA ENTERPRISES, LTD., 1998,1999