aboutsummaryrefslogtreecommitdiff
path: root/src
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
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) {
If you find this content useful please consider a small donation via bitcoin: bitcoin:1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2?amount=0.001&message=Donation Scraping git contents via cgit is very resource intensive. The continued hosting of these git repositories is entirely financed by your bitcoin contributions. For donations of a least 1 mBTC you include your IP address in the message of your bitcoin donation. This will remove this message in the future for requests from your IP, which will significantly reduce token usage. In any case, any contributions to bitcoin address 1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2 are very welcome. Thanks in advance for you contribution to a self-sustaining ecosystem.