/* Gets current timer count. 
This function returns the current timer value */
uint32_t tmrHw_GetCurrentCount(tmrHw_ID_t timerId)
/* Gets current timer count. 
This function returns the current timer value */
uint32_t tmrHw_GetCurrentCount(tmrHw_ID_t timerId)
{
	switch (pTmrHw[timerId].Control & tmrHw_CONTROL_MODE_MASK) {
	case tmrHw_CONTROL_FREE_RUNNING:
		if (pTmrHw[timerId].CurrentValue) {
			return tmrHw_MAX_COUNT - pTmrHw[timerId].CurrentValue;
		}
		break;
	case tmrHw_CONTROL_PERIODIC:
	case tmrHw_CONTROL_ONESHOT:
		return pTmrHw[timerId].BackgroundLoad -
		    pTmrHw[timerId].CurrentValue;
	}
	return 0;
}