@@ -57,7 +57,7 @@ def generate(self):
57
57
debug_flags = []
58
58
next_is_include = False
59
59
for f in self .flags ['c_flags' ] + self .flags ['cxx_flags' ] + self .flags ['common_flags' ]:
60
- f = f .strip ()
60
+ f = f .strip ()
61
61
if f == "-include" :
62
62
next_is_include = True
63
63
continue
@@ -68,15 +68,18 @@ def generate(self):
68
68
next_is_include = False
69
69
if f .startswith ('-O' ) or f .startswith ('-g' ):
70
70
debug_flags .append (f )
71
- continue
72
- comp_flags .append (f )
71
+ else :
72
+ comp_flags .append (f )
73
73
comp_flags = list (set (comp_flags ))
74
74
inc_dirs = [self .filter_dot (s ) for s in self .resources .inc_dirs ];
75
- inc_dirs = [x for x in inc_dirs if x is not None and x != '' and x != '.' and not x .startswith ('bin' ) and not x .startswith ('obj' )];
75
+ inc_dirs = [x for x in inc_dirs if (x is not None and
76
+ x != '' and x != '.' and
77
+ not x .startswith ('bin' ) and
78
+ not x .startswith ('obj' ))];
76
79
77
80
c_sources = [self .filter_dot (s ) for s in self .resources .c_sources ]
78
- targ = TARGET_MAP [ self .target ]
79
- ncs36510fib = hasattr ( targ , 'post_binary_hook' ) and targ . post_binary_hook ['function' ] == 'NCS36510TargetCode.ncs36510_addfib'
81
+ ncs36510fib = ( hasattr ( self .toolchain . target , 'post_binary_hook' ) and
82
+ self . toolchain . target . post_binary_hook ['function' ] == 'NCS36510TargetCode.ncs36510_addfib' )
80
83
if ncs36510fib :
81
84
c_sources .append ('ncs36510fib.c' )
82
85
c_sources .append ('ncs36510trim.c' )
@@ -129,13 +132,16 @@ def generate(self):
129
132
'rssi' : 0x3D ,
130
133
'txtune' : 0xFFFFFFFF
131
134
}
132
- if hasattr (targ , 'config' ):
133
- for an , cn in [ ['mac-addr-low' , 'mac_addr_low' ], ['mac-addr-high' , 'mac_addr_high' ],
134
- ['32KHz-clk-trim' , 'clk_32k_trim' ], ['32MHz-clk-trim' , 'clk_32m_trim' ],
135
- ['rssi-trim' , 'rssi' ], ['txtune-trim' , 'txtune' ] ]:
136
- if an in targ .config :
137
- if 'value' in targ .config [an ]:
138
- ctx [cn ] = int (targ .config [an ]['value' ], 0 )
135
+ if hasattr (self .toolchain .target , 'config' ):
136
+ for an , cn in [ ['mac-addr-low' , 'mac_addr_low' ],
137
+ ['mac-addr-high' , 'mac_addr_high' ],
138
+ ['32KHz-clk-trim' , 'clk_32k_trim' ],
139
+ ['32MHz-clk-trim' , 'clk_32m_trim' ],
140
+ ['rssi-trim' , 'rssi' ],
141
+ ['txtune-trim' , 'txtune' ] ]:
142
+ if an in self .toolchain .target .config :
143
+ if 'value' in self .toolchain .target .config [an ]:
144
+ ctx [cn ] = int (self .toolchain .target .config [an ]['value' ], 0 )
139
145
for f in [ 'ncs36510fib.c' , 'ncs36510trim.c' ]:
140
146
self .gen_file ("codeblocks/%s" % f , ctx , f )
141
147
0 commit comments