Skip to content

Commit 20fbc36

Browse files
author
MicroBahner
committed
donot disable Timer in pinMode
1 parent e3753df commit 20fbc36

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

STM32F1/cores/maple/stm32f1/wirish_digital_f1.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,10 @@ void pinMode(uint8 pin, WiringPinMode mode) {
7979

8080
gpio_set_mode(PIN_MAP[pin].gpio_device, PIN_MAP[pin].gpio_bit, outputMode);
8181

82-
if (PIN_MAP[pin].timer_device != NULL) {
83-
/* Enable/disable timer channels if we're switching into or
84-
* out of PWM. */
82+
if (pwm && PIN_MAP[pin].timer_device != NULL) {
83+
/* Enable/disable timer channels if we're switching into PWM. */
8584
timer_set_mode(PIN_MAP[pin].timer_device,
8685
PIN_MAP[pin].timer_channel,
87-
pwm ? TIMER_PWM : TIMER_DISABLED);
86+
TIMER_PWM );
8887
}
8988
}

0 commit comments

Comments
 (0)