From: whitequark Date: Mon, 22 Jun 2020 15:07:54 +0000 (+0000) Subject: resources: allow UARTResource without control signals to have no role. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a889afebd9e584af449e27c573148e8aa257120e;p=nmigen-boards.git resources: allow UARTResource without control signals to have no role. --- diff --git a/nmigen_boards/resources/interface.py b/nmigen_boards/resources/interface.py index 97489e2..848e1b8 100644 --- a/nmigen_boards/resources/interface.py +++ b/nmigen_boards/resources/interface.py @@ -6,7 +6,8 @@ __all__ = ["UARTResource", "IrDAResource", "SPIResource"] def UARTResource(*args, rx, tx, rts=None, cts=None, dtr=None, dsr=None, dcd=None, ri=None, conn=None, attrs=None, role=None): - assert role in ("dce", "dte") + if any(line is not None for line in (rts, cts, dtr, dsr, dcd, ri)): + assert role in ("dce", "dte") if role == "dte": dce_to_dte = "i" dte_to_dce = "o"