Adding Pimoroni Keybow and Keybow 2040

This commit is contained in:
Ellie T authored and Kyle Brown committed 2022-02-20 18:42:38 -08:00
1 parent ef7b29bd43
commit 2fce09986e
11 files changed
+254 -4

No files matched your search

+9 -3
View File
@@ -244,12 +244,15 @@ class KMKKeyboard:
Ensure the provided configuration is *probably* bootable
'''
assert self.keymap, 'must define a keymap with at least one row'
assert self.row_pins, 'no GPIO pins defined for matrix rows'
assert self.col_pins, 'no GPIO pins defined for matrix columns'
assert self.diode_orientation is not None, 'diode orientation must be defined'
assert (
self.hid_type in HIDModes.ALL_MODES
), 'hid_type must be a value from kmk.consts.HIDModes'
if not self.matrix:
assert self.row_pins, 'no GPIO pins defined for matrix rows'
assert self.col_pins, 'no GPIO pins defined for matrix columns'
assert (
self.diode_orientation is not None
), 'diode orientation must be defined'
return self
@@ -262,6 +265,9 @@ class KMKKeyboard:
To save RAM on boards that don't use Split, we don't import Split
and do an isinstance check, but instead do string detection
'''
if self.matrix and self.matrix.coord_mapping:
self.coord_mapping = self.matrix.coord_mapping
if any(x.__class__.__module__ == 'kmk.modules.split' for x in self.modules):
return
+3
View File
@@ -3,6 +3,9 @@ class Scanner:
Base class for scanners.
'''
def __init__(self):
self.coord_mapping = None
def scan_for_changes(self):
'''
Scan for key events and return a key report if an event exists.
-1
View File
@@ -15,7 +15,6 @@ class NativeKeypadScanner(Scanner):
def __init__(self, pin_map, kp):
self.pin_map = pin_map
self.keypad = kp
# self.coord_mapping = [ic(row, col) for (row, col) in self.pin_map]
self.coord_mapping = list(range(len(pin_map)))
self.curr_event = keypad.Event()