Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split uVision project source files in groups mbed/hal/src #72

Merged
merged 6 commits into from
Sep 19, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11CXX/sleep.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@
#include "mbed_interface.h"

void sleep(void) {
#if DEVICE_SEMIHOST
// ensure debug is disconnected
mbed_interface_disconnect();
#endif

// PCON[DPDEN] set to sleep
LPC_PMU->PCON = 0x0;
Expand Down Expand Up @@ -58,8 +60,10 @@ void sleep(void) {
*/

void deepsleep(void) {
#if DEVICE_SEMIHOST
// ensure debug is disconnected
mbed_interface_disconnect();
#endif

// PCON[DPDEN] set to deepsleep
LPC_PMU->PCON = 0x2;
Expand Down
23 changes: 16 additions & 7 deletions workspace_tools/export/uvision4.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
class Uvision4(Exporter):
NAME = 'uVision4'

TARGETS = ['LPC1768', 'LPC11U24', 'KL25Z', 'LPC1347', 'LPC1114', 'LPC4088', 'LPC812']
TARGETS = ['LPC1768', 'LPC11U24', 'KL25Z', 'LPC1347', 'LPC1114', 'LPC11C24', 'LPC4088', 'LPC812']

USING_MICROLIB = ['LPC11U24', 'LPC1114', 'LPC812']
USING_MICROLIB = ['LPC11U24', 'LPC1114', 'LPC11C24', 'LPC812']

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

def generate(self):
source_files = []
source_files = {
'mbed': [],
'hal': [],
'src': []
}
for r_type, n in Uvision4.FILE_TYPES.iteritems():
for file in getattr(self.resources, r_type):
source_files.append({
'name': basename(file), 'type': n, 'path': file
})
f = {'name': basename(file), 'type': n, 'path': file}
if file.startswith("mbed\\common"):
source_files['mbed'].append(f)
elif file.startswith("mbed\\targets"):
source_files['hal'].append(f)
else:
source_files['src'].append(f)
source_files = dict( [(k,v) for k,v in source_files.items() if len(v)>0])
ctx = {
'name': self.program_name,
'include_paths': self.resources.inc_dirs,
'scatter_file': self.resources.linker_script,
'object_files': self.resources.objects + self.resources.libraries,
'source_files': source_files,
'source_files': source_files.items(),
'symbols': self.toolchain.get_symbols()
}
target = self.target.lower()
Expand Down
43 changes: 22 additions & 21 deletions workspace_tools/export/uvision4_kl25z.uvproj.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@
<IncludeLibsPath></IncludeLibsPath>
<Misc>
{% for file in object_files %}
{{file}}
{{file}}
{% endfor %}
</Misc>
<LinkerInputFile></LinkerInputFile>
Expand All @@ -391,30 +391,31 @@
</TargetArmAds>
</TargetOption>
<Groups>
{% for group,files in source_files %}
<Group>
<GroupName>src</GroupName>
<GroupName>{{group}}</GroupName>
<Files>
{% for file in source_files %}
<File>
<FileName>{{file.name}}</FileName>
<FileType>{{file.type}}</FileType>
<FilePath>{{file.path}}</FilePath>
{%if file.type == "1" %}
<FileOption>
<FileArmAds>
<Cads>
<VariousControls>
<MiscControls>--c99</MiscControls>
</VariousControls>
</Cads>
</FileArmAds>
</FileOption>
{% endif %}
</File>
{% endfor %}

{% for file in files %}
<File>
<FileName>{{file.name}}</FileName>
<FileType>{{file.type}}</FileType>
<FilePath>{{file.path}}</FilePath>
{%if file.type == "1" %}
<FileOption>
<FileArmAds>
<Cads>
<VariousControls>
<MiscControls>--c99</MiscControls>
</VariousControls>
</Cads>
</FileArmAds>
</FileOption>
{% endif %}
</File>
{% endfor %}
</Files>
</Group>
{% endfor %}
</Groups>
</Target>
</Targets>
Expand Down
2 changes: 1 addition & 1 deletion workspace_tools/export/uvision4_lpc1114.uvopt.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<PageWidth>79</PageWidth>
<PageLength>66</PageLength>
<TabStop>8</TabStop>
<ListingPath>.\</ListingPath>
<ListingPath>.\build\</ListingPath>
</OPTLEX>
<ListingPage>
<CreateCListing>1</CreateCListing>
Expand Down
32 changes: 17 additions & 15 deletions workspace_tools/export/uvision4_lpc1114.uvproj.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@
<NotGenerated>0</NotGenerated>
<InvalidFlash>1</InvalidFlash>
</TargetStatus>
<OutputDirectory>.\</OutputDirectory>
<OutputName>lpc1114_test</OutputName>
<OutputDirectory>.\build\</OutputDirectory>
<OutputName>{{name}}</OutputName>
<CreateExecutable>1</CreateExecutable>
<CreateLib>0</CreateLib>
<CreateHexFile>0</CreateHexFile>
<DebugInformation>1</DebugInformation>
<BrowseInformation>1</BrowseInformation>
<ListingPath>.\</ListingPath>
<ListingPath>.\build\</ListingPath>
<HexFormatSelection>1</HexFormatSelection>
<Merge32K>0</Merge32K>
<CreateBatchFile>0</CreateBatchFile>
Expand Down Expand Up @@ -383,39 +383,41 @@
<IncludeLibs></IncludeLibs>
<IncludeLibsPath></IncludeLibsPath>
<Misc>
{% for file in object_files %}
{% for file in object_files %}
{{file}}
{% endfor %}
{% endfor %}
</Misc>
<LinkerInputFile></LinkerInputFile>
<DisabledWarnings></DisabledWarnings>
</LDads>
</TargetArmAds>
</TargetOption>
<Groups>
{% for group,files in source_files %}
<Group>
<GroupName>src</GroupName>
<GroupName>{{group}}</GroupName>
<Files>
{% for file in source_files %}
{% for file in files %}
<File>
<FileName>{{file.name}}</FileName>
<FileType>{{file.type}}</FileType>
<FilePath>{{file.path}}</FilePath>
{%if file.type == "1" %}
<FileOption>
<FileArmAds>
<Cads>
<VariousControls>
<MiscControls>--c99</MiscControls>
</VariousControls>
</Cads>
</FileArmAds>
<FileArmAds>
<Cads>
<VariousControls>
<MiscControls>--c99</MiscControls>
</VariousControls>
</Cads>
</FileArmAds>
</FileOption>
{% endif %}
</File>
{% endfor %}
{% endfor %}
</Files>
</Group>
{% endfor %}
</Groups>
</Target>
</Targets>
Expand Down
Loading