Resurrect the concept of pin level matching. Allows for easier device wiring.

Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
Adrian Conlon
2019-05-06 09:58:50 +01:00
parent 0340142282
commit efbd576624
3 changed files with 20 additions and 45 deletions
+15 -1
View File
@@ -13,5 +13,19 @@ namespace EightBit
public static void Raise(this ref PinLevel line) => line = PinLevel.High;
public static void Lower(this ref PinLevel line) => line = PinLevel.Low;
public static void Match(this ref PinLevel line, int condition) => Match(ref line, condition != 0);
public static void Match(this ref PinLevel line, bool condition)
{
if (condition)
{
line.Raise();
}
else
{
line.Lower();
}
}
}
}
}