-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlibrary_platform.py
More file actions
38 lines (34 loc) · 989 Bytes
/
library_platform.py
File metadata and controls
38 lines (34 loc) · 989 Bytes
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
31
32
33
34
35
36
37
38
Import("env")
from os.path import join, realpath
platform = env['PIOFRAMEWORK'][0]
board = env['PIOENV']
print("hello world")
print("platform: ", platform)
print("board: ", board)
platform_dir = realpath(join("platform", platform))
boards_dir = realpath(join(platform_dir, "boards"))
board_dir = realpath(join(boards_dir, board))
# Specify platform/board includes
env.Append(
CPPPATH=[
realpath(join("platform", platform, "include")),
realpath(join("platform", platform, "boards", board, "include")),
]
)
# Specify common and platform source directories
env.Replace(
SRC_FILTER=[
"-<*>",
"+<src>",
"+<%s>" % realpath(join("platform", platform, "src")),
"+<%s>" % realpath(join("platform", platform, "boards", board, "src")),
]
)
# Platform defines
env.Append(
CPPDEFINES=[
# This will be needed if we ever have a 64-bit timer platform,
# to set PLATFORM_TIMER64; e.g.:
# "PLATFORM_TIMER64",
]
)