Skip to content

Commit

Permalink
Update Zephyr MSDK Hal based on MSDK PR: analogdevicesinc/msdk#1187
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Sep 24, 2024
1 parent 3562db5 commit 3a2135e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions MAX/Libraries/PeriphDrivers/Source/TMR/tmr_reva.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,15 +235,15 @@ 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;
*units = MXC_TMR_UNIT_NANOSEC;
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;
Expand Down
4 changes: 2 additions & 2 deletions MAX/Libraries/PeriphDrivers/Source/TMR/tmr_revb.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,15 +512,15 @@ 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;
*units = MXC_TMR_UNIT_NANOSEC;
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;
Expand Down
4 changes: 2 additions & 2 deletions MAX/Libraries/PeriphDrivers/Source/TMR/tmr_revc.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,15 +293,15 @@ 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;
*units = MXC_TMR_UNIT_NANOSEC;
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;
Expand Down
2 changes: 1 addition & 1 deletion MAX/msdk_sha
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ace41b22aeb1f5152c4ce3c1e35e618d8fb11309
c8cd2cb0290469d7c45c98bfa2af6f5477030622

0 comments on commit 3a2135e

Please sign in to comment.