Fix compiling problem for OBP40

This commit is contained in:
norbert-walter 2025-03-05 09:48:45 +01:00
parent 98c8d44d2f
commit 293b362ee4
1 changed files with 13 additions and 3 deletions

View File

@ -10,7 +10,7 @@ from datetime import datetime
import re import re
import pprint import pprint
from platformio.project.config import ProjectConfig from platformio.project.config import ProjectConfig
from platformio.project.exception import InvalidProjectConfError
Import("env") Import("env")
#print(env.Dump()) #print(env.Dump())
@ -104,7 +104,17 @@ def writeFileIfChanged(fileName,data):
return True return True
def mergeConfig(base,other): def mergeConfig(base,other):
try:
customconfig = env.GetProjectOption("custom_config")
except InvalidProjectConfError:
customconfig = None
for bdir in other: for bdir in other:
if customconfig and os.path.exists(os.path.join(bdir,customconfig)):
cname=os.path.join(bdir,customconfig)
print("merge custom config {}".format(cname))
with open(cname,'rb') as ah:
base += json.load(ah)
continue
cname=os.path.join(bdir,"config.json") cname=os.path.join(bdir,"config.json")
if os.path.exists(cname): if os.path.exists(cname):
print("merge config %s"%cname) print("merge config %s"%cname)
@ -274,9 +284,9 @@ class Grove:
def _ss(self,z=False): def _ss(self,z=False):
if z: if z:
return self.name return self.name
return self.name if self.name is not 'Z' else '' return self.name if self.name != 'Z' else ''
def _suffix(self): def _suffix(self):
return '_'+self.name if self.name is not 'Z' else '' return '_'+self.name if self.name != 'Z' else ''
def replace(self,line): def replace(self,line):
if line is None: if line is None:
return line return line