20 lines
566 B
Python
20 lines
566 B
Python
# build/platform/rp2040.py
|
|
from .base import Platform
|
|
from ..compiler.gcc import GCCCompiler
|
|
from ..config import COMMON_FLAGS, TEST_FLAGS, PICO_SDK_PATH
|
|
from pathlib import Path
|
|
import shutil
|
|
|
|
class RP2040Platform(Platform):
|
|
name = "rp2040"
|
|
|
|
def compiler(self):
|
|
return GCCCompiler("arm-none-eabi-gcc")
|
|
|
|
def cflags(self, test: bool = False):
|
|
return TEST_FLAGS if test else COMMON_FLAGS
|
|
|
|
def supports_rp2040(self) -> bool:
|
|
sdk = Path(PICO_SDK_PATH)
|
|
return sdk.exists() and shutil.which("arm-none-eabi-gcc") is not None
|