mirror of
https://github.com/MoleskiCoder/EightBitNet.git
synced 2026-04-20 06:16:43 +00:00
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:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user