1 /*******************************************************************************
2 ################################################################################
3 # Copyright (c) [2017-2019] [Radisys] #
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 #
9 # http://www.apache.org/licenses/LICENSE-2.0 #
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 *******************************************************************************/
19 #define DU_TIMER_RESOLUTION 1
23 * @def DU_TMR_CALCUATE_WAIT
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
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
35 #define DU_TMR_CALCUATE_WAIT(_wait, _tmrVal, _timerRes) \
37 (_wait) = ((_tmrVal) * SS_TICKS_SEC)/((_timerRes) * 1000); \
38 if((0 != (_tmrVal)) && (0 == (_wait))) \
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);
48 /**********************************************************************
50 **********************************************************************/