Skip to content

Commit

Permalink
fix(PeriphDrivers): IBRO_CLK is connected to timers 4-5 (#1084)
Browse files Browse the repository at this point in the history
Co-authored-by: sihyung-maxim <sihyung-maxim@users.noreply.github.com>
  • Loading branch information
isztldav and sihyung-maxim authored Aug 7, 2024
1 parent 98e234e commit c320a28
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Libraries/PeriphDrivers/Source/TMR/tmr_ai87.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,12 @@ int MXC_TMR_Init(mxc_tmr_regs_t *tmr, mxc_tmr_cfg_t *cfg, bool init_pins)
break;

case MXC_TMR_IBRO_CLK:
if (tmr_id > 3) { // Timers 4-5 do not support this clock source
return E_NOT_SUPPORTED;
if (tmr_id <= 3) {
clockSource = MXC_TMR_CLK2;
} else {
clockSource = MXC_TMR_CLK0;
}

clockSource = MXC_TMR_CLK2;
MXC_SYS_ClockSourceEnable(MXC_SYS_CLOCK_IBRO);
MXC_TMR_RevB_SetClockSourceFreq((mxc_tmr_revb_regs_t *)tmr, IBRO_FREQ);
break;
Expand Down

0 comments on commit c320a28

Please sign in to comment.