Skip to content

Commit 99f9bc0

Browse files
committed
Add compatibility with PIO Core 6.0
1 parent 9f46435 commit 99f9bc0

File tree

5 files changed

+15
-18
lines changed

5 files changed

+15
-18
lines changed

.github/workflows/examples.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ jobs:
88
fail-fast: false
99
matrix:
1010
os: [ubuntu-latest, windows-latest, macos-latest]
11-
python-version: [3.7]
1211
example:
1312
- "examples/arduino-blink"
1413
- "examples/arduino-external-libs"
@@ -59,18 +58,17 @@ jobs:
5958
- "tests/arduino-blink-different-cores"
6059
runs-on: ${{ matrix.os }}
6160
steps:
62-
- uses: actions/checkout@v2
61+
- uses: actions/checkout@v3
6362
with:
6463
submodules: "recursive"
65-
- name: Set up Python ${{ matrix.python-version }}
66-
uses: actions/setup-python@v1
64+
- name: Set up Python
65+
uses: actions/setup-python@v3
6766
with:
68-
python-version: ${{ matrix.python-version }}
67+
python-version: "3.9"
6968
- name: Install dependencies
7069
run: |
71-
python -m pip install --upgrade pip
7270
pip install -U https://github.com/platformio/platformio/archive/develop.zip
7371
pio pkg install --global --platform symlink://.
7472
- name: Build examples
7573
run: |
76-
platformio run -d ${{ matrix.example }}
74+
pio run -d ${{ matrix.example }}

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# ST STM32: development platform for [PlatformIO](http://platformio.org)
1+
# ST STM32: development platform for [PlatformIO](https://platformio.org)
22

33
[![Build Status](https://github.com/platformio/platform-ststm32/workflows/Examples/badge.svg)](https://github.com/platformio/platform-ststm32/actions)
44

@@ -9,7 +9,7 @@ The STM32 family of 32-bit Flash MCUs based on the ARM Cortex-M processor is des
99

1010
# Usage
1111

12-
1. [Install PlatformIO](http://platformio.org)
12+
1. [Install PlatformIO](https://platformio.org)
1313
2. Create PlatformIO project and configure a platform option in [platformio.ini](https://docs.platformio.org/page/projectconf.html) file:
1414

1515
## Stable version

builder/main.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from SCons.Script import (ARGUMENTS, COMMAND_LINE_TARGETS, AlwaysBuild,
2121
Builder, Default, DefaultEnvironment)
2222

23-
from platformio.util import get_serial_ports
23+
from platformio.public import list_serial_ports
2424

2525

2626
def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621
@@ -33,7 +33,7 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621
3333
if not bool(upload_options.get("disable_flushing", False)):
3434
env.FlushSerialBuffer("$UPLOAD_PORT")
3535

36-
before_ports = get_serial_ports()
36+
before_ports = list_serial_ports()
3737

3838
if bool(upload_options.get("use_1200bps_touch", False)):
3939
env.TouchSerialPort("$UPLOAD_PORT", 1200)
@@ -43,7 +43,6 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621
4343

4444

4545
env = DefaultEnvironment()
46-
env.SConscript("compat.py", exports="env")
4746
platform = env.PioPlatform()
4847
board = env.BoardConfig()
4948

platform.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414

1515
import json
1616
import os
17-
18-
from platform import system
17+
import sys
1918

2019
from platformio.managers.platform import PlatformBase
21-
from platformio.util import get_systype
2220

2321

22+
IS_WINDOWS = sys.platform.startswith("win")
23+
2424
class Ststm32Platform(PlatformBase):
2525

2626
def configure_default_packages(self, variables, targets):
@@ -90,7 +90,7 @@ def configure_default_packages(self, variables, targets):
9090
if p in ("tool-cmake", "tool-dtc", "tool-ninja"):
9191
self.packages[p]["optional"] = False
9292
self.packages["toolchain-gccarmnoneeabi"]["version"] = "~1.80201.0"
93-
if "windows" not in get_systype():
93+
if not IS_WINDOWS:
9494
self.packages["tool-gperf"]["optional"] = False
9595

9696
# configure J-LINK tool
@@ -151,7 +151,7 @@ def _add_default_debug_tools(self, board):
151151
"-port", "2331"
152152
],
153153
"executable": ("JLinkGDBServerCL.exe"
154-
if system() == "Windows" else
154+
if IS_WINDOWS else
155155
"JLinkGDBServer")
156156
}
157157
}

0 commit comments

Comments
 (0)