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 tools.export.gnuarmeclipse import GNUARMEclipse
00018 
00019 class E2Studio(GNUARMEclipse):
00020     NAME = 'e2 studio'
00021     TOOLCHAIN = 'GCC_ARM'
00022 
00023     TARGETS = [
00024         'RZ_A1H',
00025         'VK_RZ_A1H',
00026     ]
00027 
00028     # override
00029     def generate(self):
00030 
00031         jinja_ctx = self.collect_tmpl_vars()
00032             
00033         print
00034         print 'Create a e2 studio C++ managed project'
00035         print 'Project name: {0}'.format(self.project_name)
00036         print 'Target: {0}'.format(self.toolchain.target.name)
00037         print 'Toolchain: {0}'.format(self.TOOLCHAIN)
00038 
00039         self.gen_file('e2studio/.cproject.tmpl', jinja_ctx, '.cproject', trim_blocks=True, lstrip_blocks=True)
00040         self.gen_file('e2studio/.gdbinit.tmpl', jinja_ctx, '.gdbinit')
00041         self.gen_file('e2studio/launch.tmpl', jinja_ctx, '%s OpenOCD.launch' % self.project_name, trim_blocks=True, lstrip_blocks=True)
00042 
00043         self.gen_file('gnuarmeclipse/.project.tmpl', jinja_ctx, '.project', trim_blocks=True, lstrip_blocks=True)
00044         self.gen_file('gnuarmeclipse/mbedignore.tmpl', jinja_ctx, '.mbedignore')
00045         self.gen_file('gnuarmeclipse/makefile.targets.tmpl', jinja_ctx, 'makefile.targets', trim_blocks=True, lstrip_blocks=True)
00046 
00047         print
00048         print 'Done. Import the project located at \'{0}\' in e2 studio.'.format(self.project_name)