mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2025-02-05 13:29:59 +00:00
Add a "flip" method to device to allow tone sequence generation.
Signed-off-by: Adrian Conlon <adrian.conlon@gmail.com>
This commit is contained in:
parent
9ea21e786f
commit
bf1c7d0e37
@ -104,6 +104,8 @@ namespace EightBit {
|
||||
static constexpr void match(PinLevel& line, bool condition) noexcept { condition ? raise(line) : lower(line); }
|
||||
static constexpr void match(PinLevel& out, PinLevel in) noexcept { out = in; }
|
||||
|
||||
static constexpr void flip(PinLevel& out) noexcept { out = out == PinLevel::Low ? PinLevel::High : PinLevel::Low; }
|
||||
|
||||
virtual ~Device() noexcept {};
|
||||
|
||||
[[nodiscard]] constexpr bool powered() const noexcept { return raised(POWER()); }
|
||||
|
Loading…
x
Reference in New Issue
Block a user