adafruit / seesaw

I2C friend to expand capabilities of other chips.
Other
76 stars 34 forks source link

Do not re-enable the timer when the user request a PWM frequency of 0. #56

Open mkende opened 2 years ago

mkende commented 2 years ago

This is a tentative fix for for issue #55. I tested that this fix it on a SAMD10 chip (that, setting the PWM freq to 0 will now fully stop the PWM output). I did not test it on SAMD09 or SAMD21 chips (as I don’t have compatible hardware to test).

I’m not entirely convinced by this PR, because it might be more logical to stop the output with a call to setting the PMW value rather than the frequency. However, the current PWMWrite method in the firmware does not disable the PMW output (as opposed to the setFreq method that I’m changing), so this PR is a smaller change.