Skip to content

Commit

Permalink
gateware.applets.analyzer: Fixed an exception getting thrown when a p…
Browse files Browse the repository at this point in the history
…latform doesn't support the `power_a_port` and `pass_through_vbus` signals
  • Loading branch information
dragonmux committed Mar 14, 2024
1 parent 2d174f5 commit 5739595
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions sol_usb/gateware/applets/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from typing import Optional

from torii import Elaboratable, Module, Signal
from torii.build.res import ResourceError
from torii.hdl.dsl import Operator

from usb_construct.emitters import DeviceDescriptorCollection
Expand Down Expand Up @@ -198,10 +199,13 @@ def elaborate(self, platform):

# Strap our power controls to be in VBUS passthrough by default,
# on the target port.
m.d.comb += [
platform.request('power_a_port').o.eq(0),
platform.request('pass_through_vbus').o.eq(1),
]
try:
m.d.comb += [
platform.request('power_a_port').o.eq(0),
platform.request('pass_through_vbus').o.eq(1),
]
except ResourceError:
pass

# Set up our parameters.
m.d.comb += [
Expand Down

0 comments on commit 5739595

Please sign in to comment.