aboutsummaryrefslogtreecommitdiff
path: root/src/peripherals/gpio.ts
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/peripherals/gpio.ts2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/peripherals/gpio.ts b/src/peripherals/gpio.ts
index cb21669..e0861d7 100644
--- a/src/peripherals/gpio.ts
+++ b/src/peripherals/gpio.ts
@@ -110,8 +110,10 @@ export class AVRIOPort {
constructor(private cpu: CPU, private portConfig: AVRPortConfig) {
cpu.writeHooks[portConfig.DDR] = (value: u8) => {
const portValue = cpu.data[portConfig.PORT];
+ cpu.data[portConfig.DDR] = value;
this.updatePinRegister(portValue, value);
this.writeGpio(portValue, value);
+ return true;
};
cpu.writeHooks[portConfig.PORT] = (value: u8) => {
const ddrMask = cpu.data[portConfig.DDR];