From a889afebd9e584af449e27c573148e8aa257120e Mon Sep 17 00:00:00 2001 From: whitequark Date: Mon, 22 Jun 2020 15:07:54 +0000 Subject: [PATCH] resources: allow UARTResource without control signals to have no role. --- nmigen_boards/resources/interface.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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" -- 2.30.2