Detect the target platform from toolchain paths. Returns: str: Platform name (esp32, avr, arm, etc.)
(as_path: Path, ld_path: Path)
| 43 | |
| 44 | |
| 45 | def _detect_platform_from_paths(as_path: Path, ld_path: Path): |
| 46 | """ |
| 47 | Detect the target platform from toolchain paths. |
| 48 | |
| 49 | Returns: |
| 50 | str: Platform name (esp32, avr, arm, etc.) |
| 51 | """ |
| 52 | path_str = str(as_path).lower() |
| 53 | |
| 54 | if "xtensa-esp32" in path_str or "esp32" in path_str: |
| 55 | return "esp32" |
| 56 | elif "avr" in path_str: |
| 57 | return "avr" |
| 58 | elif "arm" in path_str: |
| 59 | return "arm" |
| 60 | else: |
| 61 | return "unknown" |
| 62 | |
| 63 | |
| 64 | @dataclass(slots=True) |