@@ -178,6 +178,16 @@ def format_src(self, srcs):
178
178
key = lambda (_ , __ , name ): name .lower ())
179
179
return grouped
180
180
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
+
181
191
def generate (self ):
182
192
"""Generate the .uvproj file"""
183
193
cache = Cache (True , False )
@@ -197,10 +207,11 @@ def generate(self):
197
207
'include_paths' : '; ' .join (self .resources .inc_dirs ).encode ('utf-8' ),
198
208
'device' : DeviceUvision (self .target ),
199
209
}
200
- ctx ['cputype' ] = ctx ['device' ].core .rstrip ("FD" )
210
+ core = ctx ['device' ].core
211
+ ctx ['cputype' ] = core .rstrip ("FD" )
201
212
# 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 )
204
215
ctx .update (self .format_flags ())
205
216
self .gen_file ('uvision/uvision.tmpl' , ctx , self .project_name + ".uvprojx" )
206
217
self .gen_file ('uvision/uvision_debug.tmpl' , ctx , self .project_name + ".uvoptx" )
0 commit comments