Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: mbed-TFT-example-NCS36510 mbed-Accelerometer-example-NCS36510 mbed-Accelerometer-example-NCS36510
atmelstudio.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 import uuid 00018 from exporters import Exporter 00019 from os.path import splitext, basename, dirname 00020 00021 00022 class AtmelStudio(Exporter): 00023 NAME = 'AtmelStudio' 00024 TOOLCHAIN = 'GCC_ARM' 00025 00026 TARGETS = [ 00027 'SAMD21J18A', 00028 'SAMR21G18A', 00029 'SAMD21G18A', 00030 'SAML21J18A', 00031 'SAMG55J19', 00032 ] 00033 00034 DOT_IN_RELATIVE_PATH = True 00035 00036 MBED_CONFIG_HEADER_SUPPORTED = True 00037 00038 def generate(self): 00039 00040 source_files = [] 00041 dirs = [] 00042 for r_type in ['s_sources', 'c_sources', 'cpp_sources']: 00043 r = getattr(self.resources, r_type) 00044 if r: 00045 for source in r: 00046 source_files.append(source[2:]) 00047 dirs.append(dirname(source[2:])) 00048 00049 source_folders = [] 00050 for e in dirs: 00051 if e and e not in source_folders: 00052 source_folders.append(e) 00053 00054 libraries = [] 00055 for lib in self.resources.libraries: 00056 l, _ = splitext(basename(lib)) 00057 libraries.append(l[3:]) 00058 00059 solution_uuid = '{' + str(uuid.uuid4()) + '}' 00060 project_uuid = '{' + str(uuid.uuid4()) + '}' 00061 00062 ctx = { 00063 'target': self.target, 00064 'name': self.project_name, 00065 'source_files': source_files, 00066 'source_folders': source_folders, 00067 'object_files': self.resources.objects, 00068 'include_paths': self.resources.inc_dirs, 00069 'library_paths': self.resources.lib_dirs, 00070 'linker_script': self.resources.linker_script, 00071 'libraries': libraries, 00072 'symbols': self.toolchain.get_symbols(), 00073 'solution_uuid': solution_uuid.upper(), 00074 'project_uuid': project_uuid.upper() 00075 } 00076 ctx.update(self.flags) 00077 target = self.target.lower() 00078 self.gen_file('atmelstudio6_2.atsln.tmpl', ctx, '%s.atsln' % self.project_name) 00079 self.gen_file('atmelstudio6_2.cppproj.tmpl', ctx, '%s.cppproj' % self.project_name)
Generated on Tue Jul 12 2022 11:02:33 by
