diff options
author | Devaev Maxim <[email protected]> | 2018-07-11 16:08:51 +0000 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2018-07-11 16:08:51 +0000 |
commit | 00097cbb98382cda2a902bae3e54cb8adc92f38e (patch) | |
tree | 8cdac1b099f4992cf892cadd6bee2311c4aeea21 /kvmd | |
parent | e3504ee69e8043847f6a6d9d834389ec8a01561f (diff) |
removed unused gpio init
Diffstat (limited to 'kvmd')
-rw-r--r-- | kvmd/kvmd/hid.py | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/kvmd/kvmd/hid.py b/kvmd/kvmd/hid.py index d600d438..6cab4e5f 100644 --- a/kvmd/kvmd/hid.py +++ b/kvmd/kvmd/hid.py @@ -13,8 +13,6 @@ import serial from .logging import get_logger -from . import gpio - # ===== def _get_keymap() -> Dict[str, int]: @@ -95,21 +93,20 @@ class Hid(multiprocessing.Process): get_logger().exception("Can't execute emergency clear events") def run(self) -> None: - with gpio.bcm(): - try: - with serial.Serial(self.__device_path, self.__speed) as tty: - while True: - try: - event = self.__queue.get(timeout=0.1) - except queue.Empty: - pass - else: - self.__send_key_event(tty, event) - if self.__stop_event.is_set() and self.__queue.qsize() == 0: - break - except Exception: - get_logger().exception("Unhandled exception") - raise + try: + with serial.Serial(self.__device_path, self.__speed) as tty: + while True: + try: + event = self.__queue.get(timeout=0.1) + except queue.Empty: + pass + else: + self.__send_key_event(tty, event) + if self.__stop_event.is_set() and self.__queue.qsize() == 0: + break + except Exception: + get_logger().exception("Unhandled exception") + raise def __send_key_event(self, tty: serial.Serial, event: _KeyEvent) -> None: key_bytes = _keymap(event.key) |