aboutsummaryrefslogtreecommitdiff
path: root/src/peripherals/gpio.ts
diff options
context:
space:
mode:
authorUri Shaked2020-10-07 12:42:23 +0300
committerUri Shaked2020-10-07 12:42:23 +0300
commitcb71d87c2831b842e72bb6152ac5d8144b9bbd03 (patch)
treea879f8b2b2e34045fefea64d695e322e2c9d9d43 /src/peripherals/gpio.ts
parent0.11.3 (diff)
downloadavr8js-cb71d87c2831b842e72bb6152ac5d8144b9bbd03.tar.gz
avr8js-cb71d87c2831b842e72bb6152ac5d8144b9bbd03.tar.bz2
avr8js-cb71d87c2831b842e72bb6152ac5d8144b9bbd03.zip
fix(gpio): Changing pinMode from `INPUT` to `INPUT_PULLUP` doesn't trigger listeners
close #62
Diffstat (limited to '')
-rw-r--r--src/peripherals/gpio.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/peripherals/gpio.ts b/src/peripherals/gpio.ts
index e0861d7..4130c82 100644
--- a/src/peripherals/gpio.ts
+++ b/src/peripherals/gpio.ts
@@ -204,7 +204,7 @@ export class AVRIOPort {
}
private writeGpio(value: u8, ddr: u8) {
- const newValue = ((value & this.overrideMask) | this.overrideValue) & ddr;
+ const newValue = (((value & this.overrideMask) | this.overrideValue) & ddr) | (value & ~ddr);
const prevValue = this.lastValue;
if (newValue !== prevValue || ddr !== this.lastDdr) {
this.lastValue = newValue;