-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
platform.py
30 lines (25 loc) · 1.3 KB
/
platform.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Copyright 2024 Waybyte Solutions
#
# SPDX-License-Identifier: MIT
#
from platformio.public import PlatformBase
from platformio.util import get_systype
class LogicromPlatform(PlatformBase):
def configure_default_packages(self, variables, target):
# configure script based on MCU type
board_config = self.board_config(variables.get("board"))
mcu = variables.get("board_build.mcu",
board_config.get("build.mcu", "MT2503"))
if mcu in ("ASR1601", "ASR1603"):
self.frameworks["logicromsdk"]["script"] = "builder/framework/asr160x/logicromsdk.py"
self.frameworks["arduino"]["script"] = "builder/framework/asr160x/arduino.py"
elif mcu not in ("MT2503", "MT6261", "MT2625"):
self.frameworks["logicromsdk"]["script"] = "builder/framework/%s/logicromsdk.py" % (
mcu.lower())
self.frameworks["arduino"]["script"] = "builder/framework/%s/arduino.py" % (
mcu.lower())
if mcu == "RDA8955":
self.packages["toolchain-gccarmnoneeabi"]["optional"] = True
self.packages["toolchain-gccmipselfrda8955"]["optional"] = False
return PlatformBase.configure_default_packages(self, variables,
target)