Skip to content

Commit

Permalink
Force cmsis-dap v1 on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Feinman committed May 14, 2023
1 parent e148a3a commit 4bbf816
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pyocd/probe/pydapaccess/dap_access_cmsis_dap.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import logging
import collections
import threading
import platform
from typing import (Any, Dict, Optional, Tuple, Union)

from .dap_settings import DAPSettings
Expand Down Expand Up @@ -74,7 +75,7 @@ def _get_interfaces():
v2_interfaces = INTERFACE[USB_BACKEND_V2].get_all_connected_interfaces()

# Prefer v2 over v1 if a device provides both, unless the 'cmsis_dap.prefer_v1' option is set.
prefer_v1 = session.Session.get_current().options.get('cmsis_dap.prefer_v1')
prefer_v1 = session.Session.get_current().options.get('cmsis_dap.prefer_v1') or platform.system() == 'Windows'
if prefer_v1:
devices_in_both = [v2 for v2 in v2_interfaces for v1 in v1_interfaces
if _get_unique_id(v1) == _get_unique_id(v2)]
Expand Down

0 comments on commit 4bbf816

Please sign in to comment.