Simplify LeaderHelper stuff, unbreak my own boards

This commit is contained in:
Josh Klar 2018-10-08 02:41:43 -07:00
parent 8c9fc9db95
commit c6d8e5b406
No known key found for this signature in database
GPG Key ID: 220F99BD7DB7A99E
2 changed files with 3 additions and 4 deletions

View File

@ -2,7 +2,6 @@ import sys
import gc import gc
from kmk.common.leader_mode import LeaderHelper
from kmk.firmware import Firmware from kmk.firmware import Firmware
from kmk.micropython.matrix import MatrixScanner from kmk.micropython.matrix import MatrixScanner
from kmk.micropython.pyb_hid import HIDHelper from kmk.micropython.pyb_hid import HIDHelper
@ -32,7 +31,6 @@ def main():
col_pins=cols, col_pins=cols,
diode_orientation=diode_orientation, diode_orientation=diode_orientation,
hid=HIDHelper, hid=HIDHelper,
leader_helper=LeaderHelper,
log_level=DEBUG, log_level=DEBUG,
matrix_scanner=MatrixScanner, matrix_scanner=MatrixScanner,
) )

View File

@ -2,13 +2,14 @@ import logging
from kmk.common.event_defs import init_firmware from kmk.common.event_defs import init_firmware
from kmk.common.internal_state import Store, kmk_reducer from kmk.common.internal_state import Store, kmk_reducer
from kmk.common.leader_mode import LeaderHelper
class Firmware: class Firmware:
def __init__( def __init__(
self, keymap, row_pins, col_pins, self, keymap, row_pins, col_pins,
diode_orientation, unicode_mode=None, diode_orientation, unicode_mode=None,
hid=None, leader_helper=None, hid=None,
log_level=logging.NOTSET, log_level=logging.NOTSET,
matrix_scanner=None, matrix_scanner=None,
): ):
@ -33,7 +34,7 @@ class Firmware:
"Board will run in debug mode", "Board will run in debug mode",
) )
self.leader_helper = leader_helper(store=self.store, log_level=log_level) self.leader_helper = LeaderHelper(store=self.store, log_level=log_level)
self.store.dispatch(init_firmware( self.store.dispatch(init_firmware(
keymap=keymap, keymap=keymap,