@@ -178,6 +178,16 @@ def format_src(self, srcs):
178178 key = lambda (_ , __ , name ): name .lower ())
179179 return grouped
180180
181+ @staticmethod
182+ def format_fpu (core ):
183+ """Generate a core's FPU string"""
184+ if core .endswith ("FD" ):
185+ return "FPU3(DFPU)"
186+ elif core .endswith ("F" ):
187+ return "FPU2"
188+ else :
189+ return ""
190+
181191 def generate (self ):
182192 """Generate the .uvproj file"""
183193 cache = Cache (True , False )
@@ -197,10 +207,11 @@ def generate(self):
197207 'include_paths' : '; ' .join (self .resources .inc_dirs ).encode ('utf-8' ),
198208 'device' : DeviceUvision (self .target ),
199209 }
200- ctx ['cputype' ] = ctx ['device' ].core .rstrip ("FD" )
210+ core = ctx ['device' ].core
211+ ctx ['cputype' ] = core .rstrip ("FD" )
201212 # Turn on FPU optimizations if the core has an FPU
202- ctx ['fpu_setting' ] = 1 if 'f ' not in ctx [ 'device' ]. core . lower () \
203- or 'd' in ctx ['device' ]. core . lower () else 2
213+ ctx ['fpu_setting' ] = 1 if 'F ' not in core or 'D' in core else 2
214+ ctx ['fputype' ] = self . format_fpu ( core )
204215 ctx .update (self .format_flags ())
205216 self .gen_file ('uvision/uvision.tmpl' , ctx , self .project_name + ".uvprojx" )
206217 self .gen_file ('uvision/uvision_debug.tmpl' , ctx , self .project_name + ".uvoptx" )
0 commit comments