EmbeddedController icon indicating copy to clipboard operation
EmbeddedController copied to clipboard

pwm: fix always false condition in pwm_get_bb_sleep_mask()

Open nzkurtz opened this issue 2 months ago • 4 comments

Fix incorrect range check for BBLED PWM IDs.

The original condition:

id >= MCHP_PWM_ID_MAX && id < MCHP_PWM_ID_MAX

can never be true. Updated the check to:

id >= MCHP_PWM_ID_MAX &&
id < (MCHP_PWM_ID_MAX + MCHP_BBLEN_INSTANCES)

This correctly validates BBLED instances and aligns with the size of pwm_slp_bitpos[].

Fixes #31

nzkurtz avatar Nov 19 '25 07:11 nzkurtz