diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2020-07-19 23:59:44 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2020-07-20 22:18:28 -0400 |
commit | 5f2cb5436cf545c2d5efba7994f458b98644ef6f (patch) | |
tree | bd7d5d6413a0346ccc1e1b04b11efa5f25c354ff /src/linux/gpio.h | |
parent | bc488c2161147552fc33e3a4fb4ce40b12cbb9a4 (diff) | |
download | kutter-5f2cb5436cf545c2d5efba7994f458b98644ef6f.tar.gz kutter-5f2cb5436cf545c2d5efba7994f458b98644ef6f.tar.xz kutter-5f2cb5436cf545c2d5efba7994f458b98644ef6f.zip |
linux: Disable hardware pwm when it is set to zero
Only write "1" to the "enable" file when a non-zero pwm width is
requested. Write "0" to the "enable" file when a zero pwm width is
requested.
This fixes a problem on the replicape servo lines that prevented them
from being fully disabled.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/linux/gpio.h')
-rw-r--r-- | src/linux/gpio.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/linux/gpio.h b/src/linux/gpio.h index e6ef86bd..e2a39be0 100644 --- a/src/linux/gpio.h +++ b/src/linux/gpio.h @@ -37,7 +37,7 @@ void spi_transfer(struct spi_config config, uint8_t receive_data , uint8_t len, uint8_t *data); struct gpio_pwm { - int fd; + int duty_fd, enable_fd; uint32_t period; }; struct gpio_pwm gpio_pwm_setup(uint32_t pin, uint32_t cycle_time, uint16_t val); |