Anders Blomdell / mbed-sdk-tools
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers settings.py Source File

settings.py

00001 """
00002 mbed SDK
00003 Copyright (c) 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 __future__ import print_function
00018 from os import getenv
00019 from os.path import join, abspath, dirname, exists
00020 import logging
00021 
00022 ROOT = abspath(join(dirname(__file__), ".."))
00023 
00024 
00025 ##############################################################################
00026 # Toolchains and Build System Settings
00027 ##############################################################################
00028 BUILD_DIR = abspath(join(ROOT, "BUILD"))
00029 
00030 # ARM Compiler 5
00031 ARM_PATH = ""
00032 
00033 # ARM Compiler 6
00034 ARMC6_PATH = ""
00035 
00036 # GCC ARM
00037 GCC_ARM_PATH = ""
00038 
00039 # GCC CodeRed
00040 GCC_CR_PATH = ""
00041 
00042 # IAR
00043 IAR_PATH = ""
00044 
00045 # Goanna static analyser. Please overload it in mbed_settings.py
00046 GOANNA_PATH = ""
00047 
00048 
00049 # cppcheck path (command) and output message format
00050 CPPCHECK_CMD = ["cppcheck", "--enable=all"]
00051 CPPCHECK_MSG_FORMAT = ["--template=[{severity}] {file}@{line}: {id}:{message}"]
00052 
00053 BUILD_OPTIONS = []
00054 
00055 # mbed.org username
00056 MBED_ORG_USER = ""
00057 
00058 # Print compiler warnings and errors as link format
00059 PRINT_COMPILER_OUTPUT_AS_LINK = False
00060 
00061 # Compare against a fixed build of the project for space consumption
00062 COMPARE_FIXED = False
00063 
00064 # Print warnings/errors in color
00065 COLOR = False
00066 
00067 CLI_COLOR_MAP = {
00068     "Warning": "yellow",
00069     "Error"  : "red"
00070 }
00071 
00072 ##############################################################################
00073 # User Settings (file)
00074 ##############################################################################
00075 try:
00076     # Allow to overwrite the default settings without the need to edit the
00077     # settings file stored in the repository
00078     from mbed_settings import *
00079 except ImportError:
00080     pass
00081 
00082 
00083 ##############################################################################
00084 # User Settings (env vars)
00085 ##############################################################################
00086 _ENV_PATHS = ['ARM_PATH', 'GCC_ARM_PATH', 'GCC_CR_PATH', 'IAR_PATH',
00087               'ARMC6_PATH']
00088 
00089 for _n in _ENV_PATHS:
00090     if getenv('MBED_'+_n):
00091         if exists(getenv('MBED_'+_n)):
00092             globals()[_n] = getenv('MBED_'+_n)
00093         else:
00094             print("WARNING: MBED_%s set as environment variable but doesn't"
00095                   " exist" % _n)
00096 
00097 _ENV_VARS = ['PRINT_COMPILER_OUTPUT_AS_LINK', 'COLOR', 'COMPARE_FIXED']
00098 for _n in _ENV_VARS:
00099     value = getenv('MBED_%s' % _n)
00100     if value:
00101         globals()[_n] = value
00102 
00103 
00104 ##############################################################################
00105 # Test System Settings
00106 ##############################################################################
00107 SERVER_PORT = 59432
00108 SERVER_ADDRESS = "10.2.200.94"
00109 LOCALHOST = "10.2.200.94"
00110 
00111 MUTs = {
00112     "1" : {"mcu": "LPC1768",
00113         "port":"COM41", "disk":'E:\\',
00114         "peripherals": ["TMP102", "digital_loop", "port_loop", "analog_loop", "SD"]
00115     },
00116     "2": {"mcu": "LPC11U24",
00117         "port":"COM42", "disk":'F:\\',
00118         "peripherals":  ["TMP102", "digital_loop", "port_loop", "SD"]
00119     },
00120     "3" : {"mcu": "KL25Z",
00121         "port":"COM43", "disk":'G:\\',
00122         "peripherals":  ["TMP102", "digital_loop", "port_loop", "analog_loop", "SD"]
00123     },
00124 }