From 581d8e269b385bdab651f65338f4d0a40d915b4a Mon Sep 17 00:00:00 2001 From: Kyle Brown Date: Wed, 2 Dec 2020 21:31:42 -0800 Subject: [PATCH] update kmkpython and hack fix bug --- boards/keebio/nyquist/kb_converter.py | 2 -- kmk/modules/split.py | 7 ++++--- kmkpython_ref.tsv | 2 +- user_keymaps/kdb424/corne.py | 14 ++++++++------ 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/boards/keebio/nyquist/kb_converter.py b/boards/keebio/nyquist/kb_converter.py index b3f90f0..8191886 100644 --- a/boards/keebio/nyquist/kb_converter.py +++ b/boards/keebio/nyquist/kb_converter.py @@ -9,8 +9,6 @@ class KMKKeyboard(_KMKKeyboard): row_pins = (board.D13, board.D11, board.D10, board.D9, board.D7) diode_orientation = DiodeOrientation.COLUMNS - split_type = 'UART' - split_flip = True data_pin = board.SCL rgb_num_pixels = 12 rgb_pixel_pin = board.TX diff --git a/kmk/modules/split.py b/kmk/modules/split.py index 976188a..8181263 100644 --- a/kmk/modules/split.py +++ b/kmk/modules/split.py @@ -62,6 +62,7 @@ class Split(Module): self.ProvideServicesAdvertisement = ProvideServicesAdvertisement self.UARTService = UARTService except ImportError: + print('BLE Import error') pass # BLE isn't supported on this platform self._ble = BLERadio() self._ble_last_scan = ticks_ms() - 5000 @@ -140,7 +141,7 @@ class Split(Module): def before_matrix_scan(self, keyboard): if self.split_type == SplitType.BLE: - self._check_all_connections(keyboard._hid_helper) + self._check_all_connections() self._receive_ble(keyboard) elif self.split_type == SplitType.UART: if self._is_target or self.data_pin2: @@ -178,10 +179,10 @@ class Split(Module): self._uart_connection.connection_interval = 11.25 self._psave_enable = False - def _check_all_connections(self, hid_type): + def _check_all_connections(self): '''Validates the correct number of BLE connections''' self._connection_count = len(self._ble.connections) - if self._is_target and hid_type == HIDModes.BLE and self._connection_count < 2: + if self._is_target and self._connection_count < 2: self._target_advertise() elif not self._is_target and self._connection_count < 1: self._initiator_scan() diff --git a/kmkpython_ref.tsv b/kmkpython_ref.tsv index 9fb27e7..87f0752 100644 --- a/kmkpython_ref.tsv +++ b/kmkpython_ref.tsv @@ -1 +1 @@ -https://github.com/kmkfw/kmkpython b55fe4abc344bf1f509e8ef036d2a4cf13d6be63 +https://github.com/kmkfw/kmkpython a71d40626d6324199b5d93f428e924cbe13b3245 diff --git a/user_keymaps/kdb424/corne.py b/user_keymaps/kdb424/corne.py index 185bc26..d83a05c 100644 --- a/user_keymaps/kdb424/corne.py +++ b/user_keymaps/kdb424/corne.py @@ -1,10 +1,10 @@ # OLED import board -import adafruit_displayio_ssd1306 -import displayio -import terminalio -from adafruit_display_text import label +#import adafruit_displayio_ssd1306 +#import displayio +#import terminalio +#from adafruit_display_text import label from kb import KMKKeyboard from kmk.extensions.rgb import RGB from kmk.hid import HIDModes @@ -19,7 +19,7 @@ keyboard = KMKKeyboard() keyboard.tap_time = 320 keyboard.debug_enabled = False -rgb_ext = RGB(pixel_pin=keyboard.rgb_pixel_pin, num_pixels=27, val_limit=100, hue_default=190, sat_default=100, val_default=5) +rgb_ext = RGB(pixel_pin=keyboard.rgb_pixel_pin, num_pixels=6, val_limit=100, hue_default=190, sat_default=100, val_default=5) split = Split(split_type=SplitType.BLE) power = Power(powersave_pin=keyboard.powersave_pin) @@ -30,6 +30,7 @@ keyboard.extensions = [rgb_ext] enable_oled = False +''' if enable_oled: displayio.release_displays() i2c = board.I2C() @@ -39,7 +40,8 @@ if enable_oled: display.show(splash) else: displayio.release_displays() - keyboard.i2c_deinit_count += 1 +''' +keyboard.i2c_deinit_count += 1 _______ = KC.TRNS XXXXXXX = KC.NO