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