Private
Public Access
2
0

PWM: added workaround for Edison's problem with 0% duty

As described in issue #91, on Edison setting 0% duty doesn't
disable the PWM on a pin completely.

Therefore we add a couple of Edison-specific _pre functions
and an internal PWM state variable, which we use to toggle PWM
enabled/disabled based on what duty is set for the pin.

Closes #91.

Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Alex Tereschenko
2016-05-24 23:12:24 +02:00
committed by Brendan Le Foll
parent c413a43d5a
commit 8af6843566
3 changed files with 48 additions and 0 deletions

View File

@@ -87,7 +87,9 @@ typedef struct {
mraa_result_t (*pwm_period_replace) (mraa_pwm_context dev, int period);
float (*pwm_read_replace) (mraa_pwm_context dev);
mraa_result_t (*pwm_write_replace) (mraa_pwm_context dev, float duty);
mraa_result_t (*pwm_write_pre) (mraa_pwm_context dev, float percentage);
mraa_result_t (*pwm_enable_replace) (mraa_pwm_context dev, int enable);
mraa_result_t (*pwm_enable_pre) (mraa_pwm_context dev, int enable);
mraa_result_t (*spi_init_pre) (int bus);
mraa_result_t (*spi_init_post) (mraa_spi_context spi);