Skip to content

Commit ddbf6c3

Browse files
author
Matthew West
committed
Fix initialization weirdness with pwm_set_frequency
1 parent 99e27ad commit ddbf6c3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

source/c_pwm.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,8 @@ BBIO_err pwm_start(const char *key, float duty, float freq, int polarity)
505505
return err;
506506
}
507507

508+
// Initialize pwm->duty to avoid weirdness
509+
pwm->duty = duty;
508510
err = pwm_set_frequency(key, freq);
509511
if (err != BBIO_OK) {
510512
return err;

0 commit comments

Comments
 (0)