update kmkpython and hack fix bug

This commit is contained in:
Kyle Brown 2020-12-02 21:31:42 -08:00 committed by Josh Klar
parent 9b5e35a5a8
commit 581d8e269b
No known key found for this signature in database
GPG Key ID: A4A0C7B4E8EEE222
4 changed files with 13 additions and 12 deletions

View File

@ -9,8 +9,6 @@ class KMKKeyboard(_KMKKeyboard):
row_pins = (board.D13, board.D11, board.D10, board.D9, board.D7) row_pins = (board.D13, board.D11, board.D10, board.D9, board.D7)
diode_orientation = DiodeOrientation.COLUMNS diode_orientation = DiodeOrientation.COLUMNS
split_type = 'UART'
split_flip = True
data_pin = board.SCL data_pin = board.SCL
rgb_num_pixels = 12 rgb_num_pixels = 12
rgb_pixel_pin = board.TX rgb_pixel_pin = board.TX

View File

@ -62,6 +62,7 @@ class Split(Module):
self.ProvideServicesAdvertisement = ProvideServicesAdvertisement self.ProvideServicesAdvertisement = ProvideServicesAdvertisement
self.UARTService = UARTService self.UARTService = UARTService
except ImportError: except ImportError:
print('BLE Import error')
pass # BLE isn't supported on this platform pass # BLE isn't supported on this platform
self._ble = BLERadio() self._ble = BLERadio()
self._ble_last_scan = ticks_ms() - 5000 self._ble_last_scan = ticks_ms() - 5000
@ -140,7 +141,7 @@ class Split(Module):
def before_matrix_scan(self, keyboard): def before_matrix_scan(self, keyboard):
if self.split_type == SplitType.BLE: if self.split_type == SplitType.BLE:
self._check_all_connections(keyboard._hid_helper) self._check_all_connections()
self._receive_ble(keyboard) self._receive_ble(keyboard)
elif self.split_type == SplitType.UART: elif self.split_type == SplitType.UART:
if self._is_target or self.data_pin2: if self._is_target or self.data_pin2:
@ -178,10 +179,10 @@ class Split(Module):
self._uart_connection.connection_interval = 11.25 self._uart_connection.connection_interval = 11.25
self._psave_enable = False self._psave_enable = False
def _check_all_connections(self, hid_type): def _check_all_connections(self):
'''Validates the correct number of BLE connections''' '''Validates the correct number of BLE connections'''
self._connection_count = len(self._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() self._target_advertise()
elif not self._is_target and self._connection_count < 1: elif not self._is_target and self._connection_count < 1:
self._initiator_scan() self._initiator_scan()

View File

@ -1 +1 @@
https://github.com/kmkfw/kmkpython b55fe4abc344bf1f509e8ef036d2a4cf13d6be63 https://github.com/kmkfw/kmkpython a71d40626d6324199b5d93f428e924cbe13b3245

1 https://github.com/kmkfw/kmkpython b55fe4abc344bf1f509e8ef036d2a4cf13d6be63 a71d40626d6324199b5d93f428e924cbe13b3245

View File

@ -1,10 +1,10 @@
# OLED # OLED
import board import board
import adafruit_displayio_ssd1306 #import adafruit_displayio_ssd1306
import displayio #import displayio
import terminalio #import terminalio
from adafruit_display_text import label #from adafruit_display_text import label
from kb import KMKKeyboard from kb import KMKKeyboard
from kmk.extensions.rgb import RGB from kmk.extensions.rgb import RGB
from kmk.hid import HIDModes from kmk.hid import HIDModes
@ -19,7 +19,7 @@ keyboard = KMKKeyboard()
keyboard.tap_time = 320 keyboard.tap_time = 320
keyboard.debug_enabled = False 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) split = Split(split_type=SplitType.BLE)
power = Power(powersave_pin=keyboard.powersave_pin) power = Power(powersave_pin=keyboard.powersave_pin)
@ -30,6 +30,7 @@ keyboard.extensions = [rgb_ext]
enable_oled = False enable_oled = False
'''
if enable_oled: if enable_oled:
displayio.release_displays() displayio.release_displays()
i2c = board.I2C() i2c = board.I2C()
@ -39,6 +40,7 @@ if enable_oled:
display.show(splash) display.show(splash)
else: else:
displayio.release_displays() displayio.release_displays()
'''
keyboard.i2c_deinit_count += 1 keyboard.i2c_deinit_count += 1
_______ = KC.TRNS _______ = KC.TRNS