| .. | .. |
|---|
| 950 | 950 | |
|---|
| 951 | 951 | /** @brief Initialize a timer |
|---|
| 952 | 952 | * |
|---|
| 953 | | - * Allocates resources for a new timer, and initializes them. This does not |
|---|
| 954 | | - * start the timer. |
|---|
| 955 | | - * |
|---|
| 956 | | - * @return a pointer to the allocated timer object, or NULL on failure. |
|---|
| 953 | + * Initializes a given timer instance. |
|---|
| 954 | + * This does not start the timer. |
|---|
| 955 | + |
|---|
| 956 | + * @param tim the timer to init. |
|---|
| 957 | + * @param callback the callback that would be called when 'tim' times out. |
|---|
| 957 | 958 | */ |
|---|
| 958 | | -_mali_osk_timer_t *_mali_osk_timer_init(_mali_osk_timer_callback_t callback); |
|---|
| 959 | +void _mali_osk_timer_init(_mali_osk_timer_t *tim, _mali_osk_timer_callback_t callback); |
|---|
| 959 | 960 | |
|---|
| 960 | 961 | /** @brief Start a timer |
|---|
| 961 | 962 | * |
|---|
| 962 | 963 | * It is an error to start a timer without setting the callback via |
|---|
| 963 | | - * _mali_osk_timer_setcallback(). |
|---|
| 964 | + * _mali_osk_timer_init(). |
|---|
| 964 | 965 | * |
|---|
| 965 | 966 | * It is an error to use this to start an already started timer. |
|---|
| 966 | 967 | * |
|---|
| 967 | 968 | * The timer will expire in \a ticks_to_expire ticks, at which point, the |
|---|
| 968 | 969 | * callback function will be invoked with the callback-specific data, |
|---|
| 969 | | - * as registered by _mali_osk_timer_setcallback(). |
|---|
| 970 | + * as registered by _mali_osk_timer_init(). |
|---|
| 970 | 971 | * |
|---|
| 971 | 972 | * @param tim the timer to start |
|---|
| 972 | 973 | * @param ticks_to_expire the amount of time in ticks for the timer to run |
|---|
| .. | .. |
|---|
| 980 | 981 | * stopped. If \a ticks_to_expire 0 the timer fires immediately. |
|---|
| 981 | 982 | * |
|---|
| 982 | 983 | * It is an error to modify a timer without setting the callback via |
|---|
| 983 | | - * _mali_osk_timer_setcallback(). |
|---|
| 984 | + * _mali_osk_timer_init(). |
|---|
| 984 | 985 | * |
|---|
| 985 | 986 | * The timer will expire at \a ticks_to_expire from the time of the call, at |
|---|
| 986 | 987 | * which point, the callback function will be invoked with the |
|---|
| 987 | | - * callback-specific data, as set by _mali_osk_timer_setcallback(). |
|---|
| 988 | + * callback-specific data, as set by _mali_osk_timer_init(). |
|---|
| 988 | 989 | * |
|---|
| 989 | 990 | * @param tim the timer to modify, and start if necessary |
|---|
| 990 | 991 | * @param ticks_to_expire the \em absolute time in ticks at which this timer |
|---|
| .. | .. |
|---|
| 1033 | 1034 | * @return MALI_TRUE if time is active, MALI_FALSE if it is not active |
|---|
| 1034 | 1035 | */ |
|---|
| 1035 | 1036 | mali_bool _mali_osk_timer_pending(_mali_osk_timer_t *tim); |
|---|
| 1036 | | - |
|---|
| 1037 | | -/** @brief Set a timer's callback parameters. |
|---|
| 1038 | | - * |
|---|
| 1039 | | - * This must be called at least once before a timer is started/modified. |
|---|
| 1040 | | - * |
|---|
| 1041 | | - * After a timer has been stopped or expires, the callback remains set. This |
|---|
| 1042 | | - * means that restarting the timer will call the same function with the same |
|---|
| 1043 | | - * parameters on expiry. |
|---|
| 1044 | | - * |
|---|
| 1045 | | - * @param tim the timer to set callback on. |
|---|
| 1046 | | - * @param callback Function to call when timer expires |
|---|
| 1047 | | - * @param data Function-specific data to supply to the function on expiry. |
|---|
| 1048 | | - */ |
|---|
| 1049 | | -void _mali_osk_timer_setcallback(_mali_osk_timer_t *tim, _mali_osk_timer_callback_t callback, void *data); |
|---|
| 1050 | | - |
|---|
| 1051 | | -/** @brief Terminate a timer, and deallocate resources. |
|---|
| 1052 | | - * |
|---|
| 1053 | | - * The timer must first be stopped by calling _mali_osk_timer_del(). |
|---|
| 1054 | | - * |
|---|
| 1055 | | - * It is a programming error for _mali_osk_timer_term() to be called on: |
|---|
| 1056 | | - * - timer that is currently running |
|---|
| 1057 | | - * - a timer that is currently executing its callback. |
|---|
| 1058 | | - * |
|---|
| 1059 | | - * @param tim the timer to deallocate. |
|---|
| 1060 | | - */ |
|---|
| 1061 | | -void _mali_osk_timer_term(_mali_osk_timer_t *tim); |
|---|
| 1062 | | -/** @} */ /* end group _mali_osk_timer */ |
|---|
| 1063 | | - |
|---|
| 1064 | 1037 | |
|---|
| 1065 | 1038 | /** @defgroup _mali_osk_time OSK Time functions |
|---|
| 1066 | 1039 | * |
|---|