Skip to content

Commit

Permalink
fix(PeriphDrivers): Don't cache TMR clock frequency if locked (#1188)
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Perkins <michael.perkins@analog.com>
  • Loading branch information
perkinsmg committed Sep 24, 2024
1 parent 67ed311 commit 822491e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Libraries/PeriphDrivers/Source/TMR/tmr_revb.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,11 @@ void MXC_TMR_RevB_SetClockSourceFreq(mxc_tmr_revb_regs_t *tmr, int clksrc_freq)
(void)tmr_id;
MXC_ASSERT(tmr_id >= 0);

// If the clock source is locked, don't update the frequency either, as we will
// have rejected the configuration update too in MXC_TMR_RevB_SetClockSource.
if (g_is_clock_locked[tmr_id])
return;

tmr_clksrc[tmr_id].configured = true;
tmr_clksrc[tmr_id].freq = clksrc_freq;
}
Expand Down

0 comments on commit 822491e

Please sign in to comment.