Make matrix scanner class configurable

This commit is contained in:
Elvis Pfützenreuter 2019-05-13 01:30:09 -03:00
parent d70c2ccc17
commit 41dc58e428

View File

@ -57,6 +57,7 @@ class Firmware:
row_pins = None row_pins = None
col_pins = None col_pins = None
diode_orientation = None diode_orientation = None
matrix_scanner = MatrixScanner
unicode_mode = UnicodeMode.NOOP unicode_mode = UnicodeMode.NOOP
tap_time = 300 tap_time = 300
@ -174,7 +175,7 @@ class Firmware:
if self.uart_pin is not None: if self.uart_pin is not None:
self.uart = self.init_uart(self.uart_pin) self.uart = self.init_uart(self.uart_pin)
self.matrix = MatrixScanner( self.matrix = self.matrix_scanner(
cols=self.col_pins, cols=self.col_pins,
rows=self.row_pins, rows=self.row_pins,
diode_orientation=self.diode_orientation, diode_orientation=self.diode_orientation,