Knight KE / Mbed OS Game_Master
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 # Print warnings/errors in color
00062 COLOR = False
00063 
00064 CLI_COLOR_MAP = {
00065     "Warning": "yellow",
00066     "Error"  : "red"
00067 }
00068 
00069 ##############################################################################
00070 # User Settings (file)
00071 ##############################################################################
00072 try:
00073     # Allow to overwrite the default settings without the need to edit the
00074     # settings file stored in the repository
00075     from mbed_settings import *
00076 except ImportError:
00077     pass
00078 
00079 
00080 ##############################################################################
00081 # User Settings (env vars)
00082 ##############################################################################
00083 _ENV_PATHS = ['ARM_PATH', 'GCC_ARM_PATH', 'GCC_CR_PATH', 'IAR_PATH',
00084               'ARMC6_PATH']
00085 
00086 for _n in _ENV_PATHS:
00087     if getenv('MBED_'+_n):
00088         if exists(getenv('MBED_'+_n)):
00089             globals()[_n] = getenv('MBED_'+_n)
00090         else:
00091             print("WARNING: MBED_%s set as environment variable but doesn't"
00092                   " exist" % _n)
00093 
00094 _ENV_VARS = ['PRINT_COMPILER_OUTPUT_AS_LINK', 'COLOR']
00095 for _n in _ENV_VARS:
00096     value = getenv('MBED_%s' % _n)
00097     if value:
00098         globals()[_n] = value
00099 
00100 
00101 ##############################################################################
00102 # Test System Settings
00103 ##############################################################################
00104 SERVER_PORT = 59432
00105 SERVER_ADDRESS = "10.2.200.94"
00106 LOCALHOST = "10.2.200.94"
00107 
00108 MUTs = {
00109     "1" : {"mcu": "LPC1768",
00110         "port":"COM41", "disk":'E:\\',
00111         "peripherals": ["TMP102", "digital_loop", "port_loop", "analog_loop", "SD"]
00112     },
00113     "2": {"mcu": "LPC11U24",
00114         "port":"COM42", "disk":'F:\\',
00115         "peripherals":  ["TMP102", "digital_loop", "port_loop", "SD"]
00116     },
00117     "3" : {"mcu": "KL25Z",
00118         "port":"COM43", "disk":'G:\\',
00119         "peripherals":  ["TMP102", "digital_loop", "port_loop", "analog_loop", "SD"]
00120     },
00121 }