Massive update for all boards

This commit is contained in:
Kyle Brown
2020-11-06 18:33:15 -08:00
parent dea771fd7f
commit d2407e9bd8
85 changed files with 1601 additions and 714 deletions

View File

@@ -1,3 +1,5 @@
import gc
from kmk.consts import UnicodeMode
from kmk.handlers.stock import passthrough
from kmk.keys import KC, make_key
@@ -59,10 +61,23 @@ RALT_UP_NO_PRESS = simple_key_sequence((KC.RALT(no_press=True),))
def compile_unicode_string_sequences(string_table):
for k, v in string_table.items():
string_table[k] = unicode_string_sequence(v)
'''
Destructively convert ("compile") unicode strings into key sequences. This
will, for RAM saving reasons, empty the input dictionary and trigger
garbage collection.
'''
target = AttrDict()
return AttrDict(string_table)
for k, v in string_table.items():
target[k] = unicode_string_sequence(v)
# now loop through and kill the input dictionary to save RAM
for k in target.keys():
del string_table[k]
gc.collect()
return target
def unicode_string_sequence(unistring):

View File

@@ -55,14 +55,14 @@ class KMKKeyboard:
_tap_dance_counts = {}
_tap_side_effects = {}
# on some M4 setups (such as klardotsh/klarank_feather_m4, CircuitPython
# 6.0rc1) this runs out of RAM every cycle and takes down the board. no
# real known fix yet other than turning off debug, but M4s have always been
# tight on RAM so....
def __repr__(self):
return (
'KMKKeyboard('
'debug_enabled={} '
'keymap=truncated '
'coord_mapping=truncated '
'row_pins=truncated '
'col_pins=truncated '
'diode_orientation={} '
'matrix_scanner={} '
'unicode_mode={} '
@@ -79,10 +79,6 @@ class KMKKeyboard:
')'
).format(
self.debug_enabled,
# self.keymap,
# self.coord_mapping,
# self.row_pins,
# self.col_pins,
self.diode_orientation,
self.matrix_scanner,
self.unicode_mode,
@@ -103,6 +99,7 @@ class KMKKeyboard:
if self.debug_enabled:
if init:
print('KMKInit(release={})'.format(KMK_RELEASE))
gc.collect()
print(self)