imxrt-rs / imxrt-hal

Rust for NXP i.MX RT
Apache License 2.0
133 stars 33 forks source link

Fix PWM driver #108

Closed mciantyre closed 3 years ago

mciantyre commented 3 years ago

This PR fixes a regression in the PWM driver, introduced in 0.4.0.

In the 0.3 HAL, we relied on the user to set the pin alternate settings. But after introducing the IOMUXC crate in 0.4, we made pin muxing part of the driver's responsibility, and added calls to prepare pins. We missed the requirement in the PWM driver. This commit corrects the PWM driver, which has been broken since the 0.4 release.

Tested in the teensy4-rs repo. Users who are not able to adopt the next patch release could add equivalent iomuxc calls before constructing their PWM driver.