mbed-os
Dependents: cobaLCDJoyMotor_Thread odometry_omni_3roda_v3 odometry_omni_3roda_v1 odometry_omni_3roda_v2 ... more
tools/export/lpcxpresso/__init__.py@0:b74591d5ab33, 2017-12-11 (annotated)
- Committer:
- be_bryan
- Date:
- Mon Dec 11 17:54:04 2017 +0000
- Revision:
- 0:b74591d5ab33
motor ++
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
be_bryan | 0:b74591d5ab33 | 1 | """ |
be_bryan | 0:b74591d5ab33 | 2 | mbed SDK |
be_bryan | 0:b74591d5ab33 | 3 | Copyright (c) 2011-2016 ARM Limited |
be_bryan | 0:b74591d5ab33 | 4 | |
be_bryan | 0:b74591d5ab33 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); |
be_bryan | 0:b74591d5ab33 | 6 | you may not use this file except in compliance with the License. |
be_bryan | 0:b74591d5ab33 | 7 | You may obtain a copy of the License at |
be_bryan | 0:b74591d5ab33 | 8 | |
be_bryan | 0:b74591d5ab33 | 9 | http://www.apache.org/licenses/LICENSE-2.0 |
be_bryan | 0:b74591d5ab33 | 10 | |
be_bryan | 0:b74591d5ab33 | 11 | Unless required by applicable law or agreed to in writing, software |
be_bryan | 0:b74591d5ab33 | 12 | distributed under the License is distributed on an "AS IS" BASIS, |
be_bryan | 0:b74591d5ab33 | 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
be_bryan | 0:b74591d5ab33 | 14 | See the License for the specific language governing permissions and |
be_bryan | 0:b74591d5ab33 | 15 | limitations under the License. |
be_bryan | 0:b74591d5ab33 | 16 | """ |
be_bryan | 0:b74591d5ab33 | 17 | from os.path import splitext, basename |
be_bryan | 0:b74591d5ab33 | 18 | |
be_bryan | 0:b74591d5ab33 | 19 | from tools.export.exporters import Exporter, deprecated_exporter |
be_bryan | 0:b74591d5ab33 | 20 | |
be_bryan | 0:b74591d5ab33 | 21 | @deprecated_exporter |
be_bryan | 0:b74591d5ab33 | 22 | class LPCXpresso(Exporter): |
be_bryan | 0:b74591d5ab33 | 23 | NAME = 'LPCXpresso' |
be_bryan | 0:b74591d5ab33 | 24 | TOOLCHAIN = 'GCC_ARM' |
be_bryan | 0:b74591d5ab33 | 25 | |
be_bryan | 0:b74591d5ab33 | 26 | MBED_CONFIG_HEADER_SUPPORTED = True |
be_bryan | 0:b74591d5ab33 | 27 | |
be_bryan | 0:b74591d5ab33 | 28 | TARGETS = [ |
be_bryan | 0:b74591d5ab33 | 29 | 'LPC1768', |
be_bryan | 0:b74591d5ab33 | 30 | 'LPC4088', |
be_bryan | 0:b74591d5ab33 | 31 | 'LPC4088_DM', |
be_bryan | 0:b74591d5ab33 | 32 | 'LPC4330_M4', |
be_bryan | 0:b74591d5ab33 | 33 | 'LPC1114', |
be_bryan | 0:b74591d5ab33 | 34 | 'LPC11U35_401', |
be_bryan | 0:b74591d5ab33 | 35 | 'LPC11U35_501', |
be_bryan | 0:b74591d5ab33 | 36 | 'UBLOX_C027', |
be_bryan | 0:b74591d5ab33 | 37 | 'ARCH_PRO', |
be_bryan | 0:b74591d5ab33 | 38 | 'LPC1549', |
be_bryan | 0:b74591d5ab33 | 39 | 'LPC11U68', |
be_bryan | 0:b74591d5ab33 | 40 | 'LPCCAPPUCCINO', |
be_bryan | 0:b74591d5ab33 | 41 | 'LPC824', |
be_bryan | 0:b74591d5ab33 | 42 | 'LPC11U37H_401', |
be_bryan | 0:b74591d5ab33 | 43 | ] |
be_bryan | 0:b74591d5ab33 | 44 | |
be_bryan | 0:b74591d5ab33 | 45 | def generate(self): |
be_bryan | 0:b74591d5ab33 | 46 | libraries = [] |
be_bryan | 0:b74591d5ab33 | 47 | for lib in self.resources.libraries: |
be_bryan | 0:b74591d5ab33 | 48 | l, _ = splitext(basename(lib)) |
be_bryan | 0:b74591d5ab33 | 49 | libraries.append(l[3:]) |
be_bryan | 0:b74591d5ab33 | 50 | |
be_bryan | 0:b74591d5ab33 | 51 | ctx = { |
be_bryan | 0:b74591d5ab33 | 52 | 'name': self.project_name, |
be_bryan | 0:b74591d5ab33 | 53 | 'include_paths': self.resources.inc_dirs, |
be_bryan | 0:b74591d5ab33 | 54 | 'linker_script': self.resources.linker_script, |
be_bryan | 0:b74591d5ab33 | 55 | 'object_files': self.resources.objects, |
be_bryan | 0:b74591d5ab33 | 56 | 'libraries': libraries, |
be_bryan | 0:b74591d5ab33 | 57 | 'symbols': self.toolchain.get_symbols() |
be_bryan | 0:b74591d5ab33 | 58 | } |
be_bryan | 0:b74591d5ab33 | 59 | ctx.update(self.flags) |
be_bryan | 0:b74591d5ab33 | 60 | self.gen_file('lpcxpresso/%s_project.tmpl' % self.target.lower(), ctx, '.project') |
be_bryan | 0:b74591d5ab33 | 61 | self.gen_file('lpcxpresso/%s_cproject.tmpl' % self.target.lower(), ctx, '.cproject') |