Unbreak SAMD51 by deferring imports to runtime in the entrypoint (ref #52)
This commit is contained in:
parent
53d21b14de
commit
b14c56f708
@ -1,13 +1,13 @@
|
|||||||
import sys
|
|
||||||
|
|
||||||
from kmk.circuitpython.hid import HIDHelper
|
|
||||||
from kmk.consts import UnicodeModes
|
|
||||||
from kmk.firmware import Firmware
|
|
||||||
from kmk.matrix import MatrixScanner
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
import sys
|
||||||
|
|
||||||
|
from kmk.circuitpython.hid import HIDHelper
|
||||||
|
from kmk.consts import UnicodeModes
|
||||||
|
from kmk.firmware import Firmware
|
||||||
|
from kmk.matrix import MatrixScanner
|
||||||
|
|
||||||
import kmk_keyboard_user
|
import kmk_keyboard_user
|
||||||
|
|
||||||
cols = getattr(kmk_keyboard_user, 'cols')
|
cols = getattr(kmk_keyboard_user, 'cols')
|
||||||
diode_orientation = getattr(kmk_keyboard_user, 'diode_orientation')
|
diode_orientation = getattr(kmk_keyboard_user, 'diode_orientation')
|
||||||
keymap = getattr(kmk_keyboard_user, 'keymap')
|
keymap = getattr(kmk_keyboard_user, 'keymap')
|
@ -1,43 +0,0 @@
|
|||||||
import sys
|
|
||||||
|
|
||||||
from kmk.circuitpython.hid import HIDHelper
|
|
||||||
from kmk.consts import UnicodeModes
|
|
||||||
from kmk.firmware import Firmware
|
|
||||||
from kmk.matrix import MatrixScanner
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
|
||||||
import kmk_keyboard_user
|
|
||||||
cols = getattr(kmk_keyboard_user, 'cols')
|
|
||||||
diode_orientation = getattr(kmk_keyboard_user, 'diode_orientation')
|
|
||||||
keymap = getattr(kmk_keyboard_user, 'keymap')
|
|
||||||
rows = getattr(kmk_keyboard_user, 'rows')
|
|
||||||
|
|
||||||
DEBUG_ENABLE = getattr(kmk_keyboard_user, 'DEBUG_ENABLE', False)
|
|
||||||
|
|
||||||
if DEBUG_ENABLE:
|
|
||||||
from logging import DEBUG as log_level
|
|
||||||
else:
|
|
||||||
from logging import ERROR as log_level
|
|
||||||
|
|
||||||
try:
|
|
||||||
from kmk_keyboard_user import unicode_mode
|
|
||||||
except Exception:
|
|
||||||
unicode_mode = UnicodeModes.NOOP
|
|
||||||
|
|
||||||
try:
|
|
||||||
firmware = Firmware(
|
|
||||||
keymap=keymap,
|
|
||||||
row_pins=rows,
|
|
||||||
col_pins=cols,
|
|
||||||
diode_orientation=diode_orientation,
|
|
||||||
unicode_mode=unicode_mode,
|
|
||||||
log_level=log_level,
|
|
||||||
matrix_scanner=MatrixScanner,
|
|
||||||
hid=HIDHelper,
|
|
||||||
)
|
|
||||||
|
|
||||||
firmware.go()
|
|
||||||
except Exception as e:
|
|
||||||
sys.print_exception(e)
|
|
||||||
sys.exit(1)
|
|
@ -1,5 +1,5 @@
|
|||||||
from kmk.consts import DiodeOrientation, UnicodeModes
|
from kmk.consts import DiodeOrientation, UnicodeModes
|
||||||
from kmk.entrypoints.handwire.feather_m4_express import main
|
from kmk.entrypoints.handwire.circuitpython_samd51 import main
|
||||||
from kmk.keycodes import KC
|
from kmk.keycodes import KC
|
||||||
from kmk.macros.simple import send_string
|
from kmk.macros.simple import send_string
|
||||||
from kmk.macros.unicode import unicode_string_sequence
|
from kmk.macros.unicode import unicode_string_sequence
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
from kmk.consts import DiodeOrientation, UnicodeModes
|
from kmk.consts import DiodeOrientation, UnicodeModes
|
||||||
from kmk.entrypoints.handwire.feather_m4_express import main
|
from kmk.entrypoints.handwire.circuitpython_samd51 import main
|
||||||
from kmk.firmware import Firmware
|
from kmk.firmware import Firmware
|
||||||
from kmk.keycodes import KC
|
from kmk.keycodes import KC
|
||||||
from kmk.macros.simple import send_string, simple_key_sequence
|
from kmk.macros.simple import send_string, simple_key_sequence
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
from kmk.consts import DiodeOrientation, UnicodeModes
|
from kmk.consts import DiodeOrientation, UnicodeModes
|
||||||
from kmk.entrypoints.handwire.itsybitsy_m4_express import main
|
from kmk.entrypoints.handwire.circuitpython_samd51 import main
|
||||||
from kmk.firmware import Firmware
|
from kmk.firmware import Firmware
|
||||||
from kmk.keycodes import KC
|
from kmk.keycodes import KC
|
||||||
from kmk.macros.rotary_encoder import VolumeRotaryEncoder
|
from kmk.macros.rotary_encoder import VolumeRotaryEncoder
|
||||||
|
Loading…
x
Reference in New Issue
Block a user