diff --git a/examples/rtt/rtt.js b/examples/rtt/rtt.js index 4aaeccf..7950865 100644 --- a/examples/rtt/rtt.js +++ b/examples/rtt/rtt.js @@ -112,6 +112,7 @@ class RTT { async read (bufId) { var buf = this.bufUp[bufId]; + buf.RdOff = await this.processor.readMem32(buf.bufAddr + 16); buf.WrOff = await this.processor.readMem32(buf.bufAddr + 12); if (buf.WrOff > buf.RdOff) { @@ -136,6 +137,7 @@ class RTT { var buf = this.bufDown[bufId]; buf.RdOff = await this.processor.readMem32(buf.bufAddr + 16); + buf.WrOff = await this.processor.readMem32(buf.bufAddr + 12); if (buf.WrOff >= buf.RdOff) var num_avail = buf.SizeOfBuffer - (buf.WrOff - buf.RdOff);