mirror of
https://github.com/lumapu/ahoy.git
synced 2025-05-21 21:06:10 +02:00
0.8.105
* cleanup of `defines.h`
This commit is contained in:
parent
5a32288536
commit
29adc76936
6 changed files with 68 additions and 62 deletions
|
@ -27,11 +27,22 @@ def getFlagsOfEnv(env):
|
|||
elif len(flags[i]) > 0:
|
||||
build_flags = build_flags + [flags[i]]
|
||||
|
||||
def parseDefinesH():
|
||||
global build_flags
|
||||
pattern = r'^\s*#\s*define\s+(\w+)'
|
||||
|
||||
with open("defines.h", "r") as f:
|
||||
for line in f:
|
||||
match = re.match(pattern, line)
|
||||
if match:
|
||||
build_flags += [match.group(1)]
|
||||
|
||||
|
||||
def get_build_flags():
|
||||
getFlagsOfEnv("env:" + env['PIOENV'])
|
||||
config = configparser.ConfigParser()
|
||||
config.read('platformio.ini')
|
||||
parseDefinesH()
|
||||
|
||||
# translate board
|
||||
board = config["env:" + env['PIOENV']]['board']
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue