How to use the platformio.util.get_systype function in platformio

To help you get started, we’ve selected a few platformio examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github platformio / platformio-core / platformio / builder / tools / piosize.py View on Github external
if s.name.startswith("_Z"):
            mangled_names.append(s.name)

        symbol_addrs.append(hex(symbol_addr))
        symbols.append(symbol)

    symbol_locations = _get_symbol_locations(env, elf_path, symbol_addrs)
    demangled_names = _get_demangled_names(env, mangled_names)
    for symbol in symbols:
        if symbol["name"].startswith("_Z"):
            symbol["demangled_name"] = demangled_names.get(symbol["name"])
        location = symbol_locations.get(hex(symbol["addr"]))
        if not location or "?" in location:
            continue
        if "windows" in get_systype():
            drive, tail = splitdrive(location)
            location = join(drive.upper(), tail)
        symbol["file"] = location
        symbol["line"] = 0
        if ":" in location:
            file_, line = location.rsplit(":", 1)
            if line.isdigit():
                symbol["file"] = file_
                symbol["line"] = int(line)
    return symbols
github platformio / platformio-core / platformio / commands / debug / client.py View on Github external
def _kill_previous_session(self):
        assert self._session_id
        pid = None
        with app.ContentCache() as cc:
            pid = cc.get(self._session_id)
            cc.delete(self._session_id)
        if not pid:
            return
        if "windows" in util.get_systype():
            kill = ["Taskkill", "/PID", pid, "/F"]
        else:
            kill = ["kill", pid]
        try:
            proc.exec_command(kill)
        except:  # pylint: disable=bare-except
            pass
github platformio / platformio-core / platformio / platforms / linux_i686.py View on Github external
def __init__(self):
        if get_systype() == "linux_i686":
            del self.PACKAGES['toolchain-gcclinux32']
        BasePlatform.__init__(self)
github platformio / platform-ststm32 / platform.py View on Github external
self.packages["tool-dfuutil"]["optional"] = False

        if board == "mxchip_az3166":
            self.frameworks['arduino'][
                'package'] = "framework-arduinostm32mxchip"
            self.frameworks['arduino'][
                'script'] = "builder/frameworks/arduino/mxchip.py"
            self.packages['toolchain-gccarmnoneeabi']['version'] = "~1.60301.0"

        if "zephyr" in variables.get("pioframework", []):
            for p in self.packages:
                if p.startswith("framework-zephyr-") or 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():
                self.packages['tool-gperf']['optional'] = False

        # configure J-LINK tool
        jlink_conds = [
            "jlink" in variables.get(option, "")
            for option in ("upload_protocol", "debug_tool")
        ]
        if variables.get("board"):
            board_config = self.board_config(variables.get("board"))
            jlink_conds.extend([
                "jlink" in board_config.get(key, "")
                for key in ("debug.default_tools", "upload.protocol")
            ])
        jlink_pkgname = "tool-jlink"
        if not any(jlink_conds) and jlink_pkgname in self.packages:
            del self.packages[jlink_pkgname]
github bq / bitbloq-offline / app / res / web2board / darwin / Web2Board.app / Contents / Resources / platformio / platforms / linux_arm.py View on Github external
def configure_default_packages(self, envoptions, targets):
        if (envoptions.get("framework") == "wiringpi" and
                "linux_arm" not in util.get_systype()):
            raise exception.PlatformioException(
                "PlatformIO does not support temporary cross-compilation "
                "for WiringPi framework. Please run PlatformIO directly on "
                "Raspberry Pi"
            )

        return BasePlatform.configure_default_packages(
            self, envoptions, targets)
github platformio / platformio-core / platformio / managers / package.py View on Github external
click.secho(
                        "{name} @ {version} is already installed".format(
                            **self.load_manifest(package_dir)
                        ),
                        fg="yellow",
                    )
                return package_dir

            if url:
                pkg_dir = self._install_from_url(name, url, requirements, track=True)
            else:
                pkg_dir = self._install_from_piorepo(name, requirements)

            if not pkg_dir or not self.manifest_exists(pkg_dir):
                raise exception.PackageInstallError(
                    name, requirements or "*", util.get_systype()
                )

            manifest = self.load_manifest(pkg_dir)
            assert manifest

            click.secho(
                "{name} @ {version} has been successfully installed!".format(
                    **manifest
                ),
                fg="green",
            )

        return pkg_dir
github WallaceWilliam / framework-esp8266-rtos-sdk-idf-platformio / builder / frameworks / esp8266-rtos-sdk.py View on Github external
def build_sc_idf():

    if "windows" not in get_systype():
        return
    additional_packages = [
        join(platform.get_package_dir("toolchain-xtensa-lx106-elf"), "bin"),
        platform.get_package_dir("tool-ninja"),
        join(platform.get_package_dir("tool-cmake"), "bin"),
    ]
    if "windows" in get_systype():
        additional_packages.append(platform.get_package_dir("tool-mconf"))

    payload = """@rem This file was automatically generated
@set IDF_PATH={0}
@set PATH={1};%PATH%
@set CMAKE_ADD_SRC=1
python %IDF_PATH%/tools/idf.py build
@set CMAKE_ADD_SRC=
""".format(env.subst("$FRAMEWORK_DIR"),";".join([l for l in additional_packages]))
github platformio / platformio-core / platformio / commands / check / tools / pvsstudio.py View on Github external
def _demangle_report(self, output_file):
        converter_tool = os.path.join(
            get_core_package_dir("tool-pvs-studio"),
            "HtmlGenerator"
            if "windows" in util.get_systype()
            else os.path.join("bin", "plog-converter"),
        )

        cmd = (
            converter_tool,
            "-t",
            "xml",
            output_file,
            "-m",
            "cwe",
            "-m",
            "misra",
            "--cerr",
        )

        result = proc.exec_command(cmd)
github platformio / platform-nordicnrf51 / platform.py View on Github external
def configure_default_packages(self, variables, targets):
        if "erase" in targets:
            self.packages["tool-nrfjprog"]["optional"] = False
        if "zephyr" in variables.get("pioframework", []):
            for p in self.packages:
                if p.startswith("framework-zephyr-") or 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():
                self.packages['tool-gperf']['optional'] = False

        # configure J-LINK tool
        jlink_conds = [
            "jlink" in variables.get(option, "")
            for option in ("upload_protocol", "debug_tool")
        ]
        if variables.get("board"):
            board_config = self.board_config(variables.get("board"))
            jlink_conds.extend([
                "jlink" in board_config.get(key, "")
                for key in ("debug.default_tools", "upload.protocol")
            ])
        jlink_pkgname = "tool-jlink"
        if not any(jlink_conds) and jlink_pkgname in self.packages:
            del self.packages[jlink_pkgname]