mbed-os for GR-LYCHEE
Dependents: mbed-os-example-blinky-gr-lychee GR-Boads_Camera_sample GR-Boards_Audio_Recoder GR-Boads_Camera_DisplayApp ... more
tools/export/kds/__init__.py@0:f782d9c66c49, 2018-02-02 (annotated)
- Committer:
- dkato
- Date:
- Fri Feb 02 05:42:23 2018 +0000
- Revision:
- 0:f782d9c66c49
mbed-os for GR-LYCHEE
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dkato | 0:f782d9c66c49 | 1 | """ |
dkato | 0:f782d9c66c49 | 2 | mbed SDK |
dkato | 0:f782d9c66c49 | 3 | Copyright (c) 2011-2016 ARM Limited |
dkato | 0:f782d9c66c49 | 4 | |
dkato | 0:f782d9c66c49 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); |
dkato | 0:f782d9c66c49 | 6 | you may not use this file except in compliance with the License. |
dkato | 0:f782d9c66c49 | 7 | You may obtain a copy of the License at |
dkato | 0:f782d9c66c49 | 8 | |
dkato | 0:f782d9c66c49 | 9 | http://www.apache.org/licenses/LICENSE-2.0 |
dkato | 0:f782d9c66c49 | 10 | |
dkato | 0:f782d9c66c49 | 11 | Unless required by applicable law or agreed to in writing, software |
dkato | 0:f782d9c66c49 | 12 | distributed under the License is distributed on an "AS IS" BASIS, |
dkato | 0:f782d9c66c49 | 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
dkato | 0:f782d9c66c49 | 14 | See the License for the specific language governing permissions and |
dkato | 0:f782d9c66c49 | 15 | limitations under the License. |
dkato | 0:f782d9c66c49 | 16 | """ |
dkato | 0:f782d9c66c49 | 17 | from os.path import splitext, basename |
dkato | 0:f782d9c66c49 | 18 | |
dkato | 0:f782d9c66c49 | 19 | from tools.export.exporters import Exporter |
dkato | 0:f782d9c66c49 | 20 | |
dkato | 0:f782d9c66c49 | 21 | |
dkato | 0:f782d9c66c49 | 22 | class KDS(Exporter): |
dkato | 0:f782d9c66c49 | 23 | NAME = 'Kinetis Design Studio' |
dkato | 0:f782d9c66c49 | 24 | TOOLCHAIN = 'GCC_ARM' |
dkato | 0:f782d9c66c49 | 25 | |
dkato | 0:f782d9c66c49 | 26 | TARGETS = [ |
dkato | 0:f782d9c66c49 | 27 | 'K64F', |
dkato | 0:f782d9c66c49 | 28 | 'HEXIWEAR', |
dkato | 0:f782d9c66c49 | 29 | 'K22F', |
dkato | 0:f782d9c66c49 | 30 | ] |
dkato | 0:f782d9c66c49 | 31 | |
dkato | 0:f782d9c66c49 | 32 | def generate(self): |
dkato | 0:f782d9c66c49 | 33 | libraries = [] |
dkato | 0:f782d9c66c49 | 34 | for lib in self.resources.libraries: |
dkato | 0:f782d9c66c49 | 35 | l, _ = splitext(basename(lib)) |
dkato | 0:f782d9c66c49 | 36 | libraries.append(l[3:]) |
dkato | 0:f782d9c66c49 | 37 | |
dkato | 0:f782d9c66c49 | 38 | ctx = { |
dkato | 0:f782d9c66c49 | 39 | 'name': self.project_name, |
dkato | 0:f782d9c66c49 | 40 | 'include_paths': self.resources.inc_dirs, |
dkato | 0:f782d9c66c49 | 41 | 'linker_script': self.resources.linker_script, |
dkato | 0:f782d9c66c49 | 42 | 'object_files': self.resources.objects, |
dkato | 0:f782d9c66c49 | 43 | 'libraries': libraries, |
dkato | 0:f782d9c66c49 | 44 | 'symbols': self.toolchain.get_symbols() |
dkato | 0:f782d9c66c49 | 45 | } |
dkato | 0:f782d9c66c49 | 46 | self.gen_file('kds/%s_project.tmpl' % self.target.lower(), ctx, '.project') |
dkato | 0:f782d9c66c49 | 47 | self.gen_file('kds/%s_cproject.tmpl' % self.target.lower(), ctx, '.cproject') |
dkato | 0:f782d9c66c49 | 48 | self.gen_file('kds/launch.tmpl', ctx, '%s.launch' % self.project_name) |