NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
ptim.h
1/******************************************************************************
2 *
3 * NOTICE OF CHANGES
4 * 2024/03/26:
5 * - Modify tPTIM_CB structure to match RVL target
6 *
7 * Compile with REVOLUTION defined to include these changes.
8 *
9 ******************************************************************************/
10
11
12
13/******************************************************************************
14 *
15 * Copyright (C) 2003-2012 Broadcom Corporation
16 *
17 * Licensed under the Apache License, Version 2.0 (the "License");
18 * you may not use this file except in compliance with the License.
19 * You may obtain a copy of the License at:
20 *
21 * http://www.apache.org/licenses/LICENSE-2.0
22 *
23 * Unless required by applicable law or agreed to in writing, software
24 * distributed under the License is distributed on an "AS IS" BASIS,
25 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26 * See the License for the specific language governing permissions and
27 * limitations under the License.
28 *
29 ******************************************************************************/
30
31/******************************************************************************
32 *
33 * Protocol timer services.
34 *
35 ******************************************************************************/
36#ifndef PTIM_H
37#define PTIM_H
38
39#include "gki.h"
40
41/*****************************************************************************
42** Constants and data types
43*****************************************************************************/
44
45typedef struct
46{
47 TIMER_LIST_Q timer_queue; /* GKI timer queue */
48 INT32 period; /* Timer period in milliseconds */
49#ifndef REVOLUTION
50 UINT32 last_gki_ticks; /* GKI ticks since last time update called */
51#endif
52 UINT8 timer_id; /* GKI timer id */
53} tPTIM_CB;
54
55#ifdef __cplusplus
56extern "C"
57{
58#endif
59
60/*****************************************************************************
61** Function Declarations
62*****************************************************************************/
63
64/*******************************************************************************
65**
66** Function ptim_init
67**
68** Description Initialize a protocol timer service control block.
69**
70** Returns void
71**
72*******************************************************************************/
73extern void ptim_init(tPTIM_CB *p_cb, UINT16 period, UINT8 timer_id);
74
75/*******************************************************************************
76**
77** Function ptim_timer_update
78**
79** Description Update the protocol timer list and handle expired timers.
80**
81** Returns void
82**
83*******************************************************************************/
84extern void ptim_timer_update(tPTIM_CB *p_cb);
85
86/*******************************************************************************
87**
88** Function ptim_start_timer
89**
90** Description Start a protocol timer for the specified amount
91** of time in milliseconds.
92**
93** Returns void
94**
95*******************************************************************************/
96extern void ptim_start_timer(tPTIM_CB *p_cb, TIMER_LIST_ENT *p_tle, UINT16 type, INT32 timeout);
97
98/*******************************************************************************
99**
100** Function ptim_stop_timer
101**
102** Description Stop a protocol timer.
103**
104** Returns void
105**
106*******************************************************************************/
107extern void ptim_stop_timer(tPTIM_CB *p_cb, TIMER_LIST_ENT *p_tle);
108
109#ifdef __cplusplus
110}
111#endif
112
113#endif /* PTIM_H */