Skip to content

Commit a8e75ba

Browse files
nzkurtzNathan Kurtz
authored andcommitted
pwm: fix always false condition in pwm_get_bb_sleep_mask()
1 parent f6620a8 commit a8e75ba

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

chip/mchp/pwm.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,10 @@ static uint32_t pwm_get_bb_sleep_mask(int id)
101101
{
102102
uint32_t bitpos = 32;
103103

104-
if (id >= MCHP_PWM_ID_MAX && id < MCHP_PWM_ID_MAX)
104+
if (id >= MCHP_PWM_ID_MAX &&
105+
id < (MCHP_PWM_ID_MAX + MCHP_BBLEN_INSTANCES))
105106
bitpos = (uint32_t)pwm_slp_bitpos[id];
107+
106108
return (1ul << bitpos);
107109
}
108110

0 commit comments

Comments
 (0)