Add support for Unsigned int
authorduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Thu, 5 Feb 2009 09:44:56 +0000 (09:44 +0000)
committerduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Thu, 5 Feb 2009 09:44:56 +0000 (09:44 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2263 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/BModulePage.py
wizard/bertos_utils.py

index deed395e9aec2c7a679e5ca8a7e53b8203b19749..71a2f2e60bf831f0c0ad4b53cec23d1dc94b1f49 100644 (file)
@@ -112,9 +112,15 @@ class BModulePage(BWizardPage):
                 else:
                     maximum = 32767
                 spinBox.setMaximum(maximum)
-                if "long" in configurations[property]["informations"].keys() and configurations[property]["informations"]["long"] == "True":
-                    spinBox.setSuffix("L")
-                spinBox.setValue(int(configurations[property]["value"].replace("L", "")))
+                if "unsigned" in configurations[property]["informations"].keys() and configurations[property]["informations"]["unsigned"]:
+                    suff = str(spinBox.suffix())
+                    suff += "U"
+                    spinBox.setSuffix(suff)
+                if "long" in configurations[property]["informations"].keys() and configurations[property]["informations"]["long"]:
+                    suff = str(spinBox.suffix())
+                    suff += "L"
+                    spinBox.setSuffix(suff)
+                spinBox.setValue(int(configurations[property]["value"].replace("L", "").replace("U", "")))
                 self._controlGroup.addControl(index, spinBox)
     
     def _currentModule(self):
index d405130fe3741f4319db2743435e05671906c1ff..5436a3b3bd5afb53e9bc88ac61ef1d791f6ec575 100644 (file)
@@ -55,6 +55,8 @@ def createBertosProject(projectInfos):
         string = open(sourcesDir + "/" + key, "r").read()
         for parameter, infos in value.items():
             value = infos["value"]
+            if "unsigned" in infos["informations"].keys() and infos["informations"]["unsigned"]:
+                value += "U"
             if "long" in infos["informations"].keys() and infos["informations"]["long"]:
                 value += "L"
             string = sub(string, parameter, value)