diff --git a/Libraries/PeriphDrivers/Source/TMR/tmr_reva.c b/Libraries/PeriphDrivers/Source/TMR/tmr_reva.c index 1d9e0476ba..12c45fa7d4 100644 --- a/Libraries/PeriphDrivers/Source/TMR/tmr_reva.c +++ b/Libraries/PeriphDrivers/Source/TMR/tmr_reva.c @@ -235,7 +235,7 @@ int MXC_TMR_RevA_GetTime(mxc_tmr_reva_regs_t *tmr, uint32_t ticks, uint32_t *tim ((tmr->cn & MXC_F_TMR_REVA_CN_PRES) >> MXC_F_TMR_REVA_CN_PRES_POS) | (((tmr->cn & MXC_F_TMR_REVA_CN_PRES3) >> (MXC_F_TMR_REVA_CN_PRES3_POS)) << 3); - temp_time = (uint64_t)ticks * 1000 * (1 << (prescale & 0xF)) / (timerClock / 1000000); + temp_time = (uint64_t)ticks * 1000000 * (1 << (prescale & 0xF)) / (timerClock / 1000); if (!(temp_time & 0xffffffff00000000)) { *time = temp_time; @@ -243,7 +243,7 @@ int MXC_TMR_RevA_GetTime(mxc_tmr_reva_regs_t *tmr, uint32_t ticks, uint32_t *tim return E_NO_ERROR; } - temp_time = (uint64_t)ticks * 1000 * (1 << (prescale & 0xF)) / (timerClock / 1000); + temp_time = (uint64_t)ticks * 1000000 * (1 << (prescale & 0xF)) / timerClock; if (!(temp_time & 0xffffffff00000000)) { *time = temp_time; diff --git a/Libraries/PeriphDrivers/Source/TMR/tmr_revb.c b/Libraries/PeriphDrivers/Source/TMR/tmr_revb.c index 3306d2b05f..14b45fd687 100644 --- a/Libraries/PeriphDrivers/Source/TMR/tmr_revb.c +++ b/Libraries/PeriphDrivers/Source/TMR/tmr_revb.c @@ -512,7 +512,7 @@ int MXC_TMR_RevB_GetTime(mxc_tmr_revb_regs_t *tmr, uint32_t ticks, uint32_t *tim return timerClock; } - temp_time = (uint64_t)ticks * 1000 * (1 << (prescale & 0xF)) / (timerClock / 1000000); + temp_time = (uint64_t)ticks * 1000000 * (1 << (prescale & 0xF)) / (timerClock / 1000); if (!(temp_time & 0xffffffff00000000)) { *time = temp_time; @@ -520,7 +520,7 @@ int MXC_TMR_RevB_GetTime(mxc_tmr_revb_regs_t *tmr, uint32_t ticks, uint32_t *tim return E_NO_ERROR; } - temp_time = (uint64_t)ticks * 1000 * (1 << (prescale & 0xF)) / (timerClock / 1000); + temp_time = (uint64_t)ticks * 1000000 * (1 << (prescale & 0xF)) / timerClock; if (!(temp_time & 0xffffffff00000000)) { *time = temp_time; diff --git a/Libraries/PeriphDrivers/Source/TMR/tmr_revc.c b/Libraries/PeriphDrivers/Source/TMR/tmr_revc.c index df1457b0f6..1a14293de7 100644 --- a/Libraries/PeriphDrivers/Source/TMR/tmr_revc.c +++ b/Libraries/PeriphDrivers/Source/TMR/tmr_revc.c @@ -293,7 +293,7 @@ int MXC_TMR_RevC_GetTime(mxc_tmr_regs_t *tmr, uint32_t ticks, uint32_t *time, mx uint32_t prescale = (((tmr->cn & MXC_F_TMR_CN_PRES) >> MXC_F_TMR_CN_PRES_POS) | ((((tmr->cn & MXC_F_TMR_CN_PRES3) >> (MXC_F_TMR_CN_PRES3_POS)) << 3))); - temp_time = (uint64_t)ticks * 1000 * (1 << (prescale & 0xF)) / (timerClock / 1000000); + temp_time = (uint64_t)ticks * 1000000 * (1 << (prescale & 0xF)) / (timerClock / 1000); if (!(temp_time & 0xffffffff00000000)) { *time = temp_time; @@ -301,7 +301,7 @@ int MXC_TMR_RevC_GetTime(mxc_tmr_regs_t *tmr, uint32_t ticks, uint32_t *time, mx return E_NO_ERROR; } - temp_time = (uint64_t)ticks * 1000 * (1 << (prescale & 0xF)) / (timerClock / 1000); + temp_time = (uint64_t)ticks * 1000000 * (1 << (prescale & 0xF)) / timerClock; if (!(temp_time & 0xffffffff00000000)) { *time = temp_time;