@@ -38,9 +38,11 @@ class IAR(mbedToolchain):
38
38
# Pa093: Implicit conversion from float to integer (ie: wait_ms(85.4) -> wait_ms(85))
39
39
# Pa082: Operation involving two values from two registers (ie: (float)(*obj->MR)/(float)(LPC_PWM1->MR0))
40
40
"-e" , # Enable IAR language extension
41
- "--diag_suppress=Pa050,Pa084,Pa093,Pa082" ],
41
+ "--diag_suppress=Pa050,Pa084,Pa093,Pa082" ,
42
+ "--thumb" ,
43
+ "--dlib_config" , join (IAR_PATH , "inc" , "c" , "DLib_Config_Full.h" )],
42
44
'asm' : [],
43
- 'c' : ["--vla" ],
45
+ 'c' : [],
44
46
'cxx' : ["--c++" , "--no_rtti" , "--no_exceptions" , "--guard_calls" ],
45
47
'ld' : ["--skip_dynamic_initialization" , "--threaded_lib" ],
46
48
}
@@ -51,35 +53,31 @@ def __init__(self, target, options=None, notify=None, macros=None, silent=False,
51
53
cpuchoice = "Cortex-M7"
52
54
else :
53
55
cpuchoice = target .core
54
- self .flags ["common" ] += [
55
- "--cpu=%s" % cpuchoice , "--thumb" ,
56
- "--dlib_config" , join (IAR_PATH , "inc" , "c" , "DLib_Config_Full.h" ),
57
- ]
58
56
59
57
if target .core == "Cortex-M7F" :
60
58
self .flags ["common" ].append ("--fpu=VFPv5_sp" )
61
59
60
+ optimization = []
62
61
if "debug-info" in self .options :
63
- self . flags [ "common" ] .append ("-r" )
64
- self . flags [ "common" ] .append ("-On" )
62
+ optimization .append ("-r" )
63
+ optimization .append ("-On" )
65
64
else :
66
- self . flags [ "common" ] .append ("-Oh" )
65
+ optimization .append ("-Oh" )
67
66
68
67
IAR_BIN = join (IAR_PATH , "bin" )
69
68
main_cc = join (IAR_BIN , "iccarm" )
70
69
71
- self .flags ["asm" ] += ["--cpu" , cpuchoice ]
72
70
if target .core == "Cortex-M7F" :
73
71
self .flags ["asm" ] += ["--fpu" , "VFPv5_sp" ]
74
- self .asm = [join (IAR_BIN , "iasmarm" )] + self .flags ["asm" ]
72
+ self .asm = [join (IAR_BIN , "iasmarm" )] + self .flags ["asm" ] + [ "--cpu=%s" % cpuchoice ]
75
73
if not "analyze" in self .options :
76
74
self .cc = [main_cc ]
77
75
self .cppc = [main_cc ]
78
76
else :
79
77
self .cc = [join (GOANNA_PATH , "goannacc" ), '--with-cc="%s"' % main_cc .replace ('\\ ' , '/' ), "--dialect=iar-arm" , '--output-format="%s"' % self .GOANNA_FORMAT ]
80
78
self .cppc = [join (GOANNA_PATH , "goannac++" ), '--with-cxx="%s"' % main_cc .replace ('\\ ' , '/' ), "--dialect=iar-arm" , '--output-format="%s"' % self .GOANNA_FORMAT ]
81
- self .cc += self .flags ["common" ] + self .flags ["c" ]
82
- self .cppc += self .flags ["common" ] + self .flags ["cxx" ]
79
+ self .cc += self .flags ["common" ] + self .flags ["c" ] + [ "--cpu=%s" % cpuchoice ] + optimization
80
+ self .cppc += self .flags ["common" ] + self .flags ["cxx" ] + [ "--cpu=%s" % cpuchoice ] + optimization
83
81
self .ld = join (IAR_BIN , "ilinkarm" )
84
82
self .ar = join (IAR_BIN , "iarchive" )
85
83
self .elf2bin = join (IAR_BIN , "ielftool" )
0 commit comments