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

This commit is contained in:
Josh Klar committed 2018-10-11 13:38:31 -07:00
1 parent 70db4ae84d
commit 3b0cd6c421
10 files changed
+124 -99

No files matched your search

+13
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)