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>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user