Skip to content

Commit 38ed9eb

Browse files
committed
Merge pull request #72 from jorisa/master
Split uVision project source files in groups mbed/hal/src
2 parents 81b372d + 979bba6 commit 38ed9eb

12 files changed

+826
-139
lines changed

libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11CXX/sleep.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@
1818
#include "mbed_interface.h"
1919

2020
void sleep(void) {
21+
#if DEVICE_SEMIHOST
2122
// ensure debug is disconnected
2223
mbed_interface_disconnect();
24+
#endif
2325

2426
// PCON[DPDEN] set to sleep
2527
LPC_PMU->PCON = 0x0;
@@ -58,8 +60,10 @@ void sleep(void) {
5860
*/
5961

6062
void deepsleep(void) {
63+
#if DEVICE_SEMIHOST
6164
// ensure debug is disconnected
6265
mbed_interface_disconnect();
66+
#endif
6367

6468
// PCON[DPDEN] set to deepsleep
6569
LPC_PMU->PCON = 0x2;

workspace_tools/export/uvision4.py

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
class Uvision4(Exporter):
2222
NAME = 'uVision4'
2323

24-
TARGETS = ['LPC1768', 'LPC11U24', 'KL25Z', 'LPC1347', 'LPC1114', 'LPC4088', 'LPC812']
24+
TARGETS = ['LPC1768', 'LPC11U24', 'KL25Z', 'LPC1347', 'LPC1114', 'LPC11C24', 'LPC4088', 'LPC812']
2525

26-
USING_MICROLIB = ['LPC11U24', 'LPC1114', 'LPC812']
26+
USING_MICROLIB = ['LPC11U24', 'LPC1114', 'LPC11C24', 'LPC812']
2727

2828
FILE_TYPES = {
2929
'c_sources':'1',
@@ -37,18 +37,27 @@ def get_toolchain(self):
3737
return 'uARM' if (self.target in self.USING_MICROLIB) else 'ARM'
3838

3939
def generate(self):
40-
source_files = []
40+
source_files = {
41+
'mbed': [],
42+
'hal': [],
43+
'src': []
44+
}
4145
for r_type, n in Uvision4.FILE_TYPES.iteritems():
4246
for file in getattr(self.resources, r_type):
43-
source_files.append({
44-
'name': basename(file), 'type': n, 'path': file
45-
})
47+
f = {'name': basename(file), 'type': n, 'path': file}
48+
if file.startswith("mbed\\common"):
49+
source_files['mbed'].append(f)
50+
elif file.startswith("mbed\\targets"):
51+
source_files['hal'].append(f)
52+
else:
53+
source_files['src'].append(f)
54+
source_files = dict( [(k,v) for k,v in source_files.items() if len(v)>0])
4655
ctx = {
4756
'name': self.program_name,
4857
'include_paths': self.resources.inc_dirs,
4958
'scatter_file': self.resources.linker_script,
5059
'object_files': self.resources.objects + self.resources.libraries,
51-
'source_files': source_files,
60+
'source_files': source_files.items(),
5261
'symbols': self.toolchain.get_symbols()
5362
}
5463
target = self.target.lower()

workspace_tools/export/uvision4_kl25z.uvproj.tmpl

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@
382382
<IncludeLibsPath></IncludeLibsPath>
383383
<Misc>
384384
{% for file in object_files %}
385-
{{file}}
385+
{{file}}
386386
{% endfor %}
387387
</Misc>
388388
<LinkerInputFile></LinkerInputFile>
@@ -391,30 +391,31 @@
391391
</TargetArmAds>
392392
</TargetOption>
393393
<Groups>
394+
{% for group,files in source_files %}
394395
<Group>
395-
<GroupName>src</GroupName>
396+
<GroupName>{{group}}</GroupName>
396397
<Files>
397-
{% for file in source_files %}
398-
<File>
399-
<FileName>{{file.name}}</FileName>
400-
<FileType>{{file.type}}</FileType>
401-
<FilePath>{{file.path}}</FilePath>
402-
{%if file.type == "1" %}
403-
<FileOption>
404-
<FileArmAds>
405-
<Cads>
406-
<VariousControls>
407-
<MiscControls>--c99</MiscControls>
408-
</VariousControls>
409-
</Cads>
410-
</FileArmAds>
411-
</FileOption>
412-
{% endif %}
413-
</File>
414-
{% endfor %}
415-
398+
{% for file in files %}
399+
<File>
400+
<FileName>{{file.name}}</FileName>
401+
<FileType>{{file.type}}</FileType>
402+
<FilePath>{{file.path}}</FilePath>
403+
{%if file.type == "1" %}
404+
<FileOption>
405+
<FileArmAds>
406+
<Cads>
407+
<VariousControls>
408+
<MiscControls>--c99</MiscControls>
409+
</VariousControls>
410+
</Cads>
411+
</FileArmAds>
412+
</FileOption>
413+
{% endif %}
414+
</File>
415+
{% endfor %}
416416
</Files>
417417
</Group>
418+
{% endfor %}
418419
</Groups>
419420
</Target>
420421
</Targets>

workspace_tools/export/uvision4_lpc1114.uvopt.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<PageWidth>79</PageWidth>
4444
<PageLength>66</PageLength>
4545
<TabStop>8</TabStop>
46-
<ListingPath>.\</ListingPath>
46+
<ListingPath>.\build\</ListingPath>
4747
</OPTLEX>
4848
<ListingPage>
4949
<CreateCListing>1</CreateCListing>

workspace_tools/export/uvision4_lpc1114.uvproj.tmpl

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@
4343
<NotGenerated>0</NotGenerated>
4444
<InvalidFlash>1</InvalidFlash>
4545
</TargetStatus>
46-
<OutputDirectory>.\</OutputDirectory>
47-
<OutputName>lpc1114_test</OutputName>
46+
<OutputDirectory>.\build\</OutputDirectory>
47+
<OutputName>{{name}}</OutputName>
4848
<CreateExecutable>1</CreateExecutable>
4949
<CreateLib>0</CreateLib>
5050
<CreateHexFile>0</CreateHexFile>
5151
<DebugInformation>1</DebugInformation>
5252
<BrowseInformation>1</BrowseInformation>
53-
<ListingPath>.\</ListingPath>
53+
<ListingPath>.\build\</ListingPath>
5454
<HexFormatSelection>1</HexFormatSelection>
5555
<Merge32K>0</Merge32K>
5656
<CreateBatchFile>0</CreateBatchFile>
@@ -383,39 +383,41 @@
383383
<IncludeLibs></IncludeLibs>
384384
<IncludeLibsPath></IncludeLibsPath>
385385
<Misc>
386-
{% for file in object_files %}
386+
{% for file in object_files %}
387387
{{file}}
388-
{% endfor %}
388+
{% endfor %}
389389
</Misc>
390390
<LinkerInputFile></LinkerInputFile>
391391
<DisabledWarnings></DisabledWarnings>
392392
</LDads>
393393
</TargetArmAds>
394394
</TargetOption>
395395
<Groups>
396+
{% for group,files in source_files %}
396397
<Group>
397-
<GroupName>src</GroupName>
398+
<GroupName>{{group}}</GroupName>
398399
<Files>
399-
{% for file in source_files %}
400+
{% for file in files %}
400401
<File>
401402
<FileName>{{file.name}}</FileName>
402403
<FileType>{{file.type}}</FileType>
403404
<FilePath>{{file.path}}</FilePath>
404405
{%if file.type == "1" %}
405406
<FileOption>
406-
<FileArmAds>
407-
<Cads>
408-
<VariousControls>
409-
<MiscControls>--c99</MiscControls>
410-
</VariousControls>
411-
</Cads>
412-
</FileArmAds>
407+
<FileArmAds>
408+
<Cads>
409+
<VariousControls>
410+
<MiscControls>--c99</MiscControls>
411+
</VariousControls>
412+
</Cads>
413+
</FileArmAds>
413414
</FileOption>
414415
{% endif %}
415416
</File>
416-
{% endfor %}
417+
{% endfor %}
417418
</Files>
418419
</Group>
420+
{% endfor %}
419421
</Groups>
420422
</Target>
421423
</Targets>

0 commit comments

Comments
 (0)