aboutsummaryrefslogtreecommitdiff
path: root/src/peripherals/gpio.ts
diff options
context:
space:
mode:
authorUri Shaked2021-08-09 23:31:55 +0300
committerUri Shaked2021-08-09 23:31:55 +0300
commita843df1829e4d5a06bb6000007c2e930e29327e6 (patch)
tree01c8c0aac9205a52645ea4bdd116519700770f3e /src/peripherals/gpio.ts
parentstyle(spi): remove redundant whitespace from comments (diff)
downloadavr8js-a843df1829e4d5a06bb6000007c2e930e29327e6.tar.gz
avr8js-a843df1829e4d5a06bb6000007c2e930e29327e6.tar.bz2
avr8js-a843df1829e4d5a06bb6000007c2e930e29327e6.zip
fix(gpio): PWM may leaves pins in high state
Disabling PWM when a GPIO pin is high will cause the pin to get stuck in high state.
Diffstat (limited to '')
-rw-r--r--src/peripherals/gpio.ts1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/peripherals/gpio.ts b/src/peripherals/gpio.ts
index 01d7da3..f787c23 100644
--- a/src/peripherals/gpio.ts
+++ b/src/peripherals/gpio.ts
@@ -239,6 +239,7 @@ export class AVRIOPort {
const pinMask = 1 << pin;
if (mode === PinOverrideMode.None) {
this.overrideMask |= pinMask;
+ this.overrideValue &= ~pinMask;
} else {
this.overrideMask &= ~pinMask;
switch (mode) {