From c8e5c47d63a9712bd796513105a162496988a512 Mon Sep 17 00:00:00 2001 From: duplo Date: Fri, 28 Aug 2009 13:49:02 +0000 Subject: [PATCH] Add support for cpu parameter to be added in the mk file git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2811 38d2e660-2303-0410-9eaa-f027e97ec537 --- wizard/BCpuPage.py | 14 ++++++++------ wizard/bertos_utils.py | 3 ++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/wizard/BCpuPage.py b/wizard/BCpuPage.py index 463e333f..d5ef0b50 100644 --- a/wizard/BCpuPage.py +++ b/wizard/BCpuPage.py @@ -61,12 +61,14 @@ class BCpuPage(BWizardPage): self.pageContent.frequencySpinBox.setVisible(True) infos = qvariant_converter.getDict(self.pageContent.cpuList.currentItem().data(Qt.UserRole)) for key, value in infos.items(): - if key in CPU_DEF: - if type(CPU_DEF[key]) == list: - infos[key] = qvariant_converter.getStringList(value) - if type(CPU_DEF[key]) == str or type(CPU_DEF) == unicode: - infos[key] = qvariant_converter.getString(value) - else: + if key in CPU_DEF: + if type(CPU_DEF[key]) == list: + infos[key] = qvariant_converter.getStringList(value) + if type(CPU_DEF[key]) == str or type(CPU_DEF) == unicode: + infos[key] = qvariant_converter.getString(value) + elif key.startswith("MK_"): + pass + else: del infos[key] self.setProjectInfo("CPU_INFOS", infos) self.setProjectInfo("CPU_NAME", unicode(self.pageContent.cpuList.currentItem().text())) diff --git a/wizard/bertos_utils.py b/wizard/bertos_utils.py index fcfa3da7..812b7286 100644 --- a/wizard/bertos_utils.py +++ b/wizard/bertos_utils.py @@ -219,7 +219,8 @@ def mkGenerator(project_info, makefile): cpu_mk_parameters = [] for key, value in project_info.info("CPU_INFOS").items(): if key.startswith("MK_"): - cpu_mk_parameters.append("%s = %s" %(key.replace("MK_", mk_data["$pname"]), value)) + cpu_mk_parameters.append("%s = %s" %(key.replace("MK", mk_data["$pname"]), value)) + print project_info.info("CPU_INFOS") mk_data["$cpuparameters"] = "\n".join(cpu_mk_parameters) mk_data["$csrc"], mk_data["$pcsrc"], mk_data["$cppasrc"], mk_data["$cxxsrc"], mk_data["$asrc"], mk_data["$constants"] = csrcGenerator(project_info) mk_data["$prefix"] = replaceSeparators(project_info.info("TOOLCHAIN")["path"].split("gcc")[0]) -- 2.25.1