mirror of https://github.com/ARMmbed/mbed-os.git
some modifications from review
parent
da353a6adb
commit
ff488cf6fb
|
@ -147,13 +147,13 @@ void fClockInit()
|
||||||
for(Timer = 0; Timer < 10; Timer++);
|
for(Timer = 0; Timer < 10; Timer++);
|
||||||
|
|
||||||
/** - Enable calibration */
|
/** - Enable calibration */
|
||||||
CLOCKREG->CCR.BITS.CAL32M = True;
|
//CLOCKREG->CCR.BITS.CAL32M = True;
|
||||||
|
|
||||||
/** - Wait calibration to be completed */
|
/** - Wait calibration to be completed */
|
||||||
while(CLOCKREG->CSR.BITS.CAL32MDONE == False); /* If you stuck here, issue with internal 32M calibration */
|
//while(CLOCKREG->CSR.BITS.CAL32MDONE == False); /* If you stuck here, issue with internal 32M calibration */
|
||||||
|
|
||||||
/** - Check calibration status */
|
/** - Check calibration status */
|
||||||
while(CLOCKREG->CSR.BITS.CAL32MFAIL == True); /* If you stuck here, issue with internal 32M calibration */
|
//while(CLOCKREG->CSR.BITS.CAL32MFAIL == True); /* If you stuck here, issue with internal 32M calibration */
|
||||||
|
|
||||||
/** - Power down internal 32MHz osc */
|
/** - Power down internal 32MHz osc */
|
||||||
PMUREG->CONTROL.BITS.INT32M = 1;
|
PMUREG->CONTROL.BITS.INT32M = 1;
|
||||||
|
|
|
@ -57,7 +57,7 @@ class CodeBlocks(GccArm):
|
||||||
debug_flags = []
|
debug_flags = []
|
||||||
next_is_include = False
|
next_is_include = False
|
||||||
for f in self.flags['c_flags'] + self.flags['cxx_flags'] + self.flags['common_flags']:
|
for f in self.flags['c_flags'] + self.flags['cxx_flags'] + self.flags['common_flags']:
|
||||||
f=f.strip()
|
f = f.strip()
|
||||||
if f == "-include":
|
if f == "-include":
|
||||||
next_is_include = True
|
next_is_include = True
|
||||||
continue
|
continue
|
||||||
|
@ -68,15 +68,18 @@ class CodeBlocks(GccArm):
|
||||||
next_is_include = False
|
next_is_include = False
|
||||||
if f.startswith('-O') or f.startswith('-g'):
|
if f.startswith('-O') or f.startswith('-g'):
|
||||||
debug_flags.append(f)
|
debug_flags.append(f)
|
||||||
continue
|
else:
|
||||||
comp_flags.append(f)
|
comp_flags.append(f)
|
||||||
comp_flags = list(set(comp_flags))
|
comp_flags = list(set(comp_flags))
|
||||||
inc_dirs = [self.filter_dot(s) for s in self.resources.inc_dirs];
|
inc_dirs = [self.filter_dot(s) for s in self.resources.inc_dirs];
|
||||||
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')];
|
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'))];
|
||||||
|
|
||||||
c_sources = [self.filter_dot(s) for s in self.resources.c_sources]
|
c_sources = [self.filter_dot(s) for s in self.resources.c_sources]
|
||||||
targ = TARGET_MAP[self.target]
|
ncs36510fib = (hasattr(self.toolchain.target, 'post_binary_hook') and
|
||||||
ncs36510fib = hasattr(targ, 'post_binary_hook') and targ.post_binary_hook['function'] == 'NCS36510TargetCode.ncs36510_addfib'
|
self.toolchain.target.post_binary_hook['function'] == 'NCS36510TargetCode.ncs36510_addfib')
|
||||||
if ncs36510fib:
|
if ncs36510fib:
|
||||||
c_sources.append('ncs36510fib.c')
|
c_sources.append('ncs36510fib.c')
|
||||||
c_sources.append('ncs36510trim.c')
|
c_sources.append('ncs36510trim.c')
|
||||||
|
@ -129,13 +132,16 @@ class CodeBlocks(GccArm):
|
||||||
'rssi': 0x3D,
|
'rssi': 0x3D,
|
||||||
'txtune': 0xFFFFFFFF
|
'txtune': 0xFFFFFFFF
|
||||||
}
|
}
|
||||||
if hasattr(targ, 'config'):
|
if hasattr(self.toolchain.target, 'config'):
|
||||||
for an, cn in [ ['mac-addr-low', 'mac_addr_low'], ['mac-addr-high', 'mac_addr_high'],
|
for an, cn in [ ['mac-addr-low', 'mac_addr_low'],
|
||||||
['32KHz-clk-trim', 'clk_32k_trim'], ['32MHz-clk-trim', 'clk_32m_trim'],
|
['mac-addr-high', 'mac_addr_high'],
|
||||||
['rssi-trim', 'rssi'], ['txtune-trim', 'txtune'] ]:
|
['32KHz-clk-trim', 'clk_32k_trim'],
|
||||||
if an in targ.config:
|
['32MHz-clk-trim', 'clk_32m_trim'],
|
||||||
if 'value' in targ.config[an]:
|
['rssi-trim', 'rssi'],
|
||||||
ctx[cn] = int(targ.config[an]['value'], 0)
|
['txtune-trim', 'txtune'] ]:
|
||||||
|
if an in self.toolchain.target.config:
|
||||||
|
if 'value' in self.toolchain.target.config[an]:
|
||||||
|
ctx[cn] = int(self.toolchain.target.config[an]['value'], 0)
|
||||||
for f in [ 'ncs36510fib.c', 'ncs36510trim.c' ]:
|
for f in [ 'ncs36510fib.c', 'ncs36510trim.c' ]:
|
||||||
self.gen_file("codeblocks/%s" % f, ctx, f)
|
self.gen_file("codeblocks/%s" % f, ctx, f)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue