Skip to content

Commit 031e616

Browse files
committed
Properly configure custom debug speed
1 parent b04fc4b commit 031e616

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

platform.py

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
import copy
1615
import json
1716
import os
1817

@@ -21,6 +20,7 @@
2120
from platformio.managers.platform import PlatformBase
2221
from platformio.util import get_systype
2322

23+
2424
class Ststm32Platform(PlatformBase):
2525

2626
def configure_default_packages(self, variables, targets):
@@ -185,19 +185,14 @@ def _add_default_debug_tools(self, board):
185185
board.manifest["debug"] = debug
186186
return board
187187

188-
def configure_debug_options(self, initial_debug_options, ide_data):
189-
debug_options = copy.deepcopy(initial_debug_options)
190-
adapter_speed = initial_debug_options.get("speed")
191-
if adapter_speed:
192-
server_options = debug_options.get("server") or {}
193-
server_executable = server_options.get("executable", "").lower()
188+
def configure_debug_session(self, debug_config):
189+
if debug_config.speed:
190+
server_executable = (debug_config.server or {}).get("executable", "").lower()
194191
if "openocd" in server_executable:
195-
debug_options["server"]["arguments"].extend(
196-
["-c", "adapter speed %s" % adapter_speed]
192+
debug_config.server["arguments"].extend(
193+
["-c", "adapter speed %s" % debug_config.speed]
197194
)
198195
elif "jlink" in server_executable:
199-
debug_options["server"]["arguments"].extend(
200-
["-speed", adapter_speed]
196+
debug_config.server["arguments"].extend(
197+
["-speed", debug_config.speed]
201198
)
202-
203-
return debug_options

0 commit comments

Comments
 (0)