Skip to content

Commit

Permalink
Add compatibility with PIO Core 6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ivankravets committed May 28, 2022
1 parent 9f46435 commit 99f9bc0
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 18 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/examples.yml
Expand Up @@ -8,7 +8,6 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: [3.7]
example:
- "examples/arduino-blink"
- "examples/arduino-external-libs"
Expand Down Expand Up @@ -59,18 +58,17 @@ jobs:
- "tests/arduino-blink-different-cores"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: "recursive"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
python-version: "3.9"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -U https://github.com/platformio/platformio/archive/develop.zip
pio pkg install --global --platform symlink://.
- name: Build examples
run: |
platformio run -d ${{ matrix.example }}
pio run -d ${{ matrix.example }}
4 changes: 2 additions & 2 deletions README.md
@@ -1,4 +1,4 @@
# ST STM32: development platform for [PlatformIO](http://platformio.org)
# ST STM32: development platform for [PlatformIO](https://platformio.org)

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

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

# Usage

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

## Stable version
Expand Down
2 changes: 1 addition & 1 deletion builder/frameworks/arduino/mbed-core
5 changes: 2 additions & 3 deletions builder/main.py
Expand Up @@ -20,7 +20,7 @@
from SCons.Script import (ARGUMENTS, COMMAND_LINE_TARGETS, AlwaysBuild,
Builder, Default, DefaultEnvironment)

from platformio.util import get_serial_ports
from platformio.public import list_serial_ports


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

before_ports = get_serial_ports()
before_ports = list_serial_ports()

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


env = DefaultEnvironment()
env.SConscript("compat.py", exports="env")
platform = env.PioPlatform()
board = env.BoardConfig()

Expand Down
10 changes: 5 additions & 5 deletions platform.py
Expand Up @@ -14,13 +14,13 @@

import json
import os

from platform import system
import sys

from platformio.managers.platform import PlatformBase
from platformio.util import get_systype


IS_WINDOWS = sys.platform.startswith("win")

class Ststm32Platform(PlatformBase):

def configure_default_packages(self, variables, targets):
Expand Down Expand Up @@ -90,7 +90,7 @@ def configure_default_packages(self, variables, targets):
if p in ("tool-cmake", "tool-dtc", "tool-ninja"):
self.packages[p]["optional"] = False
self.packages["toolchain-gccarmnoneeabi"]["version"] = "~1.80201.0"
if "windows" not in get_systype():
if not IS_WINDOWS:
self.packages["tool-gperf"]["optional"] = False

# configure J-LINK tool
Expand Down Expand Up @@ -151,7 +151,7 @@ def _add_default_debug_tools(self, board):
"-port", "2331"
],
"executable": ("JLinkGDBServerCL.exe"
if system() == "Windows" else
if IS_WINDOWS else
"JLinkGDBServer")
}
}
Expand Down

0 comments on commit 99f9bc0

Please sign in to comment.