Skip to content

Commit

Permalink
src: lib: pwm: Change pwm_enable to use only OE pin
Browse files Browse the repository at this point in the history
  • Loading branch information
RaulTrombin authored and patrickelectric committed Sep 14, 2023
1 parent 2ded610 commit 4e154a7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ impl Navigator {
self.pwm.reset_internal_driver_state();
self.pwm.use_external_clock().unwrap();
self.pwm.set_prescale(100).unwrap();
self.pwm.enable().unwrap();

self.bmp.zero().unwrap();

Expand All @@ -404,10 +405,8 @@ impl Navigator {
/// Please check [`set_pwm_channel_value`](struct.Navigator.html#method.set_pwm_channel_value).
pub fn pwm_enable(&mut self, state: bool) {
if state {
self.pwm.enable().unwrap();
self.pwm.oe_pin.set_direction(Direction::Low).unwrap();
} else {
self.pwm.disable().unwrap();
self.pwm.oe_pin.set_direction(Direction::High).unwrap();
}
}
Expand Down

0 comments on commit 4e154a7

Please sign in to comment.