From a882ef2c3896588fc807acf3bf8bf51b258ccf96 Mon Sep 17 00:00:00 2001 From: Kyle Brown Date: Sat, 2 Mar 2019 13:49:25 -0800 Subject: [PATCH] Quick patch unrealistic face roll keyboard corruption --- kmk/firmware.py | 11 ++++++++--- .../Default/{nyquist_converter.py => nyquist_r2.py} | 0 .../kdb424/{levinson_m4.py => levinson_r2.py} | 0 .../kdb424/{nyquist_converter.py => nyquist_r2.py} | 2 +- .../klardotsh/{kitsym4_iris.py => iris_r2.py} | 0 5 files changed, 9 insertions(+), 4 deletions(-) rename user_keymaps/Default/{nyquist_converter.py => nyquist_r2.py} (100%) rename user_keymaps/kdb424/{levinson_m4.py => levinson_r2.py} (100%) rename user_keymaps/kdb424/{nyquist_converter.py => nyquist_r2.py} (99%) rename user_keymaps/klardotsh/{kitsym4_iris.py => iris_r2.py} (100%) diff --git a/kmk/firmware.py b/kmk/firmware.py index 685be68..390fbba 100644 --- a/kmk/firmware.py +++ b/kmk/firmware.py @@ -163,9 +163,14 @@ class Firmware: update[1], update[2], ) - except Exception as e: - print(e) - print(update) + except IndexError: + # If buffer get's corrupted, reset the master half. + # Alternative would be flush the contents and release all keys + import microcontroller + microcontroller.reset() + + def _flush_buffer(self): + self.uart.read() def _send_to_master(self, update): if self.split_master_left: diff --git a/user_keymaps/Default/nyquist_converter.py b/user_keymaps/Default/nyquist_r2.py similarity index 100% rename from user_keymaps/Default/nyquist_converter.py rename to user_keymaps/Default/nyquist_r2.py diff --git a/user_keymaps/kdb424/levinson_m4.py b/user_keymaps/kdb424/levinson_r2.py similarity index 100% rename from user_keymaps/kdb424/levinson_m4.py rename to user_keymaps/kdb424/levinson_r2.py diff --git a/user_keymaps/kdb424/nyquist_converter.py b/user_keymaps/kdb424/nyquist_r2.py similarity index 99% rename from user_keymaps/kdb424/nyquist_converter.py rename to user_keymaps/kdb424/nyquist_r2.py index 3bc36fd..d05aabd 100644 --- a/user_keymaps/kdb424/nyquist_converter.py +++ b/user_keymaps/kdb424/nyquist_r2.py @@ -10,7 +10,7 @@ keyboard.leader_mode = LeaderMode.TIMEOUT keyboard.unicode_mode = UnicodeMode.LINUX keyboard.tap_time = 150 keyboard.leader_timeout = 2000 -keyboard.debug_enabled = True +keyboard.debug_enabled = False # RGB Config (underglow) keyboard.rgb_num_pixels = 12 diff --git a/user_keymaps/klardotsh/kitsym4_iris.py b/user_keymaps/klardotsh/iris_r2.py similarity index 100% rename from user_keymaps/klardotsh/kitsym4_iris.py rename to user_keymaps/klardotsh/iris_r2.py