Refs #104: Keyboard can work without REPL connected on >=4.0.0-alpha3 (tested only against single-piece boards so far)
This commit is contained in:
parent
cf5ee5d4b2
commit
7fcd36f2fb
@ -139,7 +139,14 @@ class Firmware:
|
|||||||
if self.is_master is not None:
|
if self.is_master is not None:
|
||||||
return self.is_master
|
return self.is_master
|
||||||
|
|
||||||
return supervisor.runtime.serial_connected
|
# Working around https://github.com/adafruit/circuitpython/issues/1769
|
||||||
|
try:
|
||||||
|
self._hid_helper_inst.create_report([]).send()
|
||||||
|
self.is_master = True
|
||||||
|
except OSError:
|
||||||
|
self.is_master = False
|
||||||
|
|
||||||
|
return self.is_master
|
||||||
|
|
||||||
def init_uart(self, pin, timeout=20):
|
def init_uart(self, pin, timeout=20):
|
||||||
if self._master_half():
|
if self._master_half():
|
||||||
@ -153,6 +160,8 @@ class Firmware:
|
|||||||
assert self.col_pins, 'no GPIO pins defined for matrix columns'
|
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.diode_orientation is not None, 'diode orientation must be defined'
|
||||||
|
|
||||||
|
self._hid_helper_inst = self.hid_helper()
|
||||||
|
|
||||||
# Split keyboard Init
|
# Split keyboard Init
|
||||||
if self.split_flip and not self._master_half():
|
if self.split_flip and not self._master_half():
|
||||||
self.col_pins = list(reversed(self.col_pins))
|
self.col_pins = list(reversed(self.col_pins))
|
||||||
@ -173,8 +182,6 @@ class Firmware:
|
|||||||
swap_indicies=getattr(self, 'swap_indicies', None),
|
swap_indicies=getattr(self, 'swap_indicies', None),
|
||||||
)
|
)
|
||||||
|
|
||||||
self._hid_helper_inst = self.hid_helper()
|
|
||||||
|
|
||||||
# Compile string leader sequences
|
# Compile string leader sequences
|
||||||
for k, v in self.leader_dictionary.items():
|
for k, v in self.leader_dictionary.items():
|
||||||
if not isinstance(k, tuple):
|
if not isinstance(k, tuple):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user