KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches
Primary Timer

Primary timer used by the kernel. More...

Typedefs

typedef void(* timer_primary_callback_t) (irq_context_t *)
 Primary timer callback type.
 

Functions

timer_primary_callback_t timer_primary_set_callback (timer_primary_callback_t callback)
 Set the primary timer callback.
 
void timer_primary_wakeup (uint32_t millis)
 Request a primary timer wakeup.
 

Detailed Description

Primary timer used by the kernel.

This API provides a callback notification mechanism that can be hooked into the primary timer (TMU0). It is used by the KOS kernel for threading and scheduling.

Warning
This API and its underlying functionality are using TMU0, so any direct manipulation of it will interfere with the API's proper functioning.

Typedef Documentation

◆ timer_primary_callback_t

typedef void(* timer_primary_callback_t) (irq_context_t *)

Primary timer callback type.

This is the type of function which may be passed to timer_primary_set_callback() as the function that gets invoked upon interrupt.

Function Documentation

◆ timer_primary_set_callback()

timer_primary_callback_t timer_primary_set_callback ( timer_primary_callback_t  callback)

Set the primary timer callback.

This function sets the primary timer callback to the specified function pointer.

Warning
Generally, you should not do this, as the threading system relies on the primary timer to work.
Parameters
callbackThe new timer callback (set to NULL to disable).
Returns
The old timer callback.

◆ timer_primary_wakeup()

void timer_primary_wakeup ( uint32_t  millis)

Request a primary timer wakeup.

This function will wake the caller (by calling the primary timer callback) in approximately the number of milliseconds specified. You can only have one timer wakeup scheduled at a time. Any subsequently scheduled wakeups will replace any existing one.

Parameters
millisThe number of milliseconds to schedule for.