MCPcopy Create free account
hub / github.com/FastLED/FastLED / to_platformio_ini

Method to_platformio_ini

ci/boards.py:466–674  ·  view source on GitHub ↗

Return a `platformio.ini` snippet representing this board. The output is suitable for directly appending to a *platformio.ini* file and follows the same semantics used by the PlatformIO CLI. Only parameters understood by PlatformIO are emitted – internal helper fiel

(
        self,
        additional_defines: list[str] | None = None,
        additional_include_dirs: list[str] | None = None,
        additional_libs: list[str] | None = None,
        include_platformio_section: bool = False,
        core_dir: str | None = None,
        packages_dir: str | None = None,
        project_root: str | None = None,
        build_cache_dir: str | None = None,
        extra_scripts: list[str] | None = None,
    )

Source from the content-addressed store, hash-verified

464 return None
465
466 def to_platformio_ini(
467 self,
468 additional_defines: list[str] | None = None,
469 additional_include_dirs: list[str] | None = None,
470 additional_libs: list[str] | None = None,
471 include_platformio_section: bool = False,
472 core_dir: str | None = None,
473 packages_dir: str | None = None,
474 project_root: str | None = None,
475 build_cache_dir: str | None = None,
476 extra_scripts: list[str] | None = None,
477 ) -> str:
478 """Return a `platformio.ini` snippet representing this board.
479
480 The output is suitable for directly appending to a *platformio.ini* file
481 and follows the same semantics used by the PlatformIO CLI. Only
482 parameters understood by PlatformIO are emitted – internal helper
483 fields like ``platform_needs_install`` and ``use_pio_run`` are **not**
484 included because they are consumed exclusively by the build helpers in
485 the *ci/* folder and would be ignored (or flagged as errors) by
486 PlatformIO itself.
487
488 Args:
489 example: Example name for dynamic build flags (currently unused)
490 additional_defines: Additional defines to merge with board defines
491 additional_include_dirs: Additional include directories to merge with build flags
492 include_platformio_section: Whether to include [platformio] section with core_dir/packages_dir
493 core_dir: PlatformIO core directory path
494 packages_dir: PlatformIO packages directory path
495 project_root: FastLED project root for lib_deps symlink
496 """
497 lines: list[str] = []
498
499 # Optional [platformio] section
500 if include_platformio_section:
501 lines.append("[platformio]")
502 if build_cache_dir:
503 lines.append(f"build_cache_dir = {build_cache_dir}")
504 if core_dir:
505 lines.append(f"core_dir = {core_dir}")
506 if packages_dir:
507 lines.append(f"packages_dir = {packages_dir}")
508 lines.append("")
509
510 # Section header
511 lines.append(f"[env:{self.board_name}]")
512
513 # Merge board's extra_scripts with parameter extra_scripts
514 all_extra_scripts: list[str] = []
515 if self.extra_scripts:
516 all_extra_scripts.extend(self.extra_scripts)
517 if extra_scripts:
518 all_extra_scripts.extend(extra_scripts)
519 if all_extra_scripts:
520 lines.append(f"extra_scripts = {' '.join(all_extra_scripts)}")
521
522 # Board identifier (skip for platforms that don't need board specification)
523 if not self.no_board_spec:

Callers 4

test_basic_fieldsMethod · 0.95
test_real_board_nameMethod · 0.95
test_flagsMethod · 0.95

Calls 4

get_real_board_nameMethod · 0.95
listClass · 0.85
setClass · 0.50
appendMethod · 0.45

Tested by 3

test_basic_fieldsMethod · 0.76
test_real_board_nameMethod · 0.76
test_flagsMethod · 0.76