Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion debugboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from time import sleep
from types import MethodType

import hid
import pyudev
import serial
import usb
Expand All @@ -18,6 +17,13 @@

logger = logging.getLogger()

try:
import hid
except ImportError as e:
# ignore importing hid. It's only required for bughopper v2.
logger.error(e)
pass

# wait time for other GPIOs to be truly set before touching the reset GPIO
PRE_RESET_DELAY = 0.1

Expand Down Expand Up @@ -72,6 +78,12 @@ def create_board(cls, serial, tac_config_path):
and device.idProduct == Board.ID_PRODUCT_BUGHOPPER_V2
):
logger.debug("Found Bughopper V2")
if "hid" not in sys.modules:
logger.error(
"hid module not loaded. Check if the required packages are installed"
)
sys.exit(1)

return BughopperV2Board(device)

def __init__(self):
Expand Down
Loading