Refactor MatrixScanner to use enhanced Pins abstraction; add DEBUG_ENABLED to SAMD51 boards

This commit is contained in:
Josh Klar
2018-10-11 00:29:59 -07:00
parent 70db4ae84d
commit 3b0cd6c421
10 changed files with 124 additions and 99 deletions

View File

@@ -5,9 +5,16 @@ class Anything:
def __init__(self, name):
self.name = name
def __call__(self, *args, **kwargs):
return self
def __repr__(self):
return 'Anything<{}>'.format(self.name)
@property
def value(self):
return None
class Passthrough:
def __getattr__(self, attr):
@@ -16,3 +23,9 @@ class Passthrough:
class Pin:
board = Passthrough()
def __call__(self, *args, **kwargs):
return self.board
def __getattr__(self, attr):
return getattr(self.board, attr)