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: GlasgowEmbedded/glasgow
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 08acfac305bc
Choose a base ref
...
head repository: GlasgowEmbedded/glasgow
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0630544df26c
Choose a head ref
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on Jun 16, 2019

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    0630544 View commit details
Showing with 8 additions and 3 deletions.
  1. +2 −1 software/glasgow/cli.py
  2. +6 −2 software/glasgow/device/hardware.py
3 changes: 2 additions & 1 deletion software/glasgow/cli.py
Original file line number Diff line number Diff line change
@@ -377,7 +377,8 @@ async def _main():
if args.action in ("build", "test", "tool"):
pass
elif args.action == "factory":
device = GlasgowHardwareDevice(firmware_file, VID_CYPRESS, PID_FX2)
device = GlasgowHardwareDevice(firmware_file, VID_CYPRESS, PID_FX2,
_revision_override=args.rev)
else:
device = GlasgowHardwareDevice(firmware_file)

8 changes: 6 additions & 2 deletions software/glasgow/device/hardware.py
Original file line number Diff line number Diff line change
@@ -85,15 +85,19 @@ def _download_firmware(self, chunks):
self._write_ram(address, data)
self._cpu_reset(False)

def __init__(self, firmware_file=None, vendor_id=VID_QIHW, product_id=PID_GLASGOW):
def __init__(self, firmware_file=None, vendor_id=VID_QIHW, product_id=PID_GLASGOW,
_revision_override=None):
self.usb_context = usb1.USBContext()
self.usb_poller = _PollerThread(self.usb_context)
self.usb_poller.start()

self._open_device(vendor_id, product_id)

device_id = self.usb.getDevice().getbcdDevice()
self.revision = GlasgowConfig.decode_revision(device_id & 0xFF)
if _revision_override is None:
self.revision = GlasgowConfig.decode_revision(device_id & 0xFF)
else:
self.revision = _revision_override

if device_id & 0xFF00 in (0x0000, 0xA000):
logger.debug("found rev%s device without firmware", self.revision)