[Epic-ID: ODUHIGH-510][Task-ID: ODUHIGH-512] Implementation of E2 setup failure
[o-du/l2.git] / src / du_app / du_tmr.h
1 /*******************************************************************************
2 ################################################################################
3 #   Copyright (c) [2017-2019] [Radisys]                                        #
4 #                                                                              #
5 #   Licensed under the Apache License, Version 2.0 (the "License");            #
6 #   you may not use this file except in compliance with the License.           #
7 #   You may obtain a copy of the License at                                    #
8 #                                                                              #
9 #       http://www.apache.org/licenses/LICENSE-2.0                             #
10 #                                                                              #
11 #   Unless required by applicable law or agreed to in writing, software        #
12 #   distributed under the License is distributed on an "AS IS" BASIS,          #
13 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
14 #   See the License for the specific language governing permissions and        #
15 #   limitations under the License.                                             #
16 ################################################################################
17 *******************************************************************************/
18
19 #define DU_TIMER_RESOLUTION 1
20 #define DU_TQ_SIZE 2
21
22 /**
23  * @def DU_TMR_CALCUATE_WAIT
24  *
25  *    This macro calculates and assigns wait time based on the value of the
26  *    timer and the timer resolution. Timer value of 0 signifies that the
27  *    timer is not configured
28  *
29  * @param[out] _wait   Time for which to arm the timer changed to proper
30  *                     value according to the resolution
31  * @param[in] _tmrVal   Value of the timer
32  * @param[in] _timerRes   Resolution of the timer
33  *
34 */
35 #define DU_TMR_CALCUATE_WAIT(_wait, _tmrVal, _timerRes)       \
36 {                                                             \
37    (_wait) = ((_tmrVal) * SS_TICKS_SEC)/((_timerRes) * 1000); \
38    if((0 != (_tmrVal)) && (0 == (_wait)))                     \
39    {                                                          \
40       (_wait) = 1;                                            \
41    }                                                          \
42 }
43
44 short int duActvTmr(Ent ent,Inst inst); 
45 bool duChkTmr(PTR cb, int16_t tmrEvnt);
46 void duStartTmr(PTR cb, int16_t tmrEvnt, uint8_t timerValue);
47
48 /**********************************************************************
49   End of file
50  **********************************************************************/