|
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | 14 |
|
15 | | -import copy |
16 | 15 | import json |
17 | 16 | import os |
18 | 17 |
|
|
21 | 20 | from platformio.managers.platform import PlatformBase |
22 | 21 | from platformio.util import get_systype |
23 | 22 |
|
| 23 | + |
24 | 24 | class Ststm32Platform(PlatformBase): |
25 | 25 |
|
26 | 26 | def configure_default_packages(self, variables, targets): |
@@ -185,19 +185,14 @@ def _add_default_debug_tools(self, board): |
185 | 185 | board.manifest["debug"] = debug |
186 | 186 | return board |
187 | 187 |
|
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() |
194 | 191 | 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] |
197 | 194 | ) |
198 | 195 | 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] |
201 | 198 | ) |
202 | | - |
203 | | - return debug_options |
0 commit comments