Rtos API example

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers __init__.py Source File

__init__.py

00001 """
00002 mbed SDK
00003 Copyright (c) 2011-2016 ARM Limited
00004 
00005 Licensed under the Apache License, Version 2.0 (the "License");
00006 you may not use this file except in compliance with the License.
00007 You may obtain a copy of the License at
00008 
00009 http://www.apache.org/licenses/LICENSE-2.0
00010 
00011 Unless required by applicable law or agreed to in writing, software
00012 distributed under the License is distributed on an "AS IS" BASIS,
00013 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014 See the License for the specific language governing permissions and
00015 limitations under the License.
00016 """
00017 from os.path import splitext, basename
00018 
00019 from tools.export.exporters import Exporter, deprecated_exporter
00020 
00021 @deprecated_exporter
00022 class LPCXpresso(Exporter ):
00023     NAME = 'LPCXpresso'
00024     TOOLCHAIN = 'GCC_ARM'
00025 
00026     MBED_CONFIG_HEADER_SUPPORTED = True
00027 
00028     TARGETS = [
00029         'LPC1768',
00030         'LPC4088',
00031         'LPC4088_DM',
00032         'LPC4330_M4',
00033         'LPC1114',
00034         'LPC11U35_401',
00035         'LPC11U35_501',
00036         'UBLOX_C027',
00037         'ARCH_PRO',
00038         'LPC1549',
00039         'LPC11U68',
00040         'LPCCAPPUCCINO',
00041         'LPC824',
00042         'LPC11U37H_401',
00043     ]
00044 
00045     def generate(self):
00046         libraries = []
00047         for lib in self.resources.libraries:
00048             l, _ = splitext(basename(lib))
00049             libraries.append(l[3:])
00050 
00051         ctx = {
00052             'name': self.project_name,
00053             'include_paths': self.resources.inc_dirs,
00054             'linker_script': self.resources.linker_script,
00055             'object_files': self.resources.objects,
00056             'libraries': libraries,
00057             'symbols': self.toolchain.get_symbols()
00058         }
00059         ctx.update(self.flags)
00060         self.gen_file('lpcxpresso/%s_project.tmpl' % self.target.lower(), ctx, '.project')
00061         self.gen_file('lpcxpresso/%s_cproject.tmpl' % self.target.lower(), ctx, '.cproject')