Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: whitequark/glasgow
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3cfc95f1a8fc
Choose a base ref
...
head repository: whitequark/glasgow
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 390955a93c73
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Feb 25, 2019

  1. Copy the full SHA
    390955a View commit details
Showing with 5 additions and 1 deletion.
  1. +5 −1 software/glasgow/device/hardware.py
6 changes: 5 additions & 1 deletion software/glasgow/device/hardware.py
Original file line number Diff line number Diff line change
@@ -68,7 +68,11 @@ def _open_device(self, vendor_id, product_id):
pass

def _write_ram(self, addr, data):
self.usb.controlWrite(usb1.REQUEST_TYPE_VENDOR, REQ_RAM, addr, 0, data)
while len(data) > 0:
chunk_length = min(len(data), 4096)
self.usb.controlWrite(usb1.REQUEST_TYPE_VENDOR, REQ_RAM, addr, 0, data[:chunk_length])
addr += chunk_length
data = data[chunk_length:]

def _cpu_reset(self, is_reset):
self._write_ram(REG_CPUCS, [1 if is_reset else 0])