Refactor MatrixScanner to use enhanced Pins abstraction; add DEBUG_ENABLED to SAMD51 boards
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user