Clone of official tools
settings.py@47:21ae3e5a7128, 2021-02-04 (annotated)
- Committer:
- Anders Blomdell
- Date:
- Thu Feb 04 17:17:13 2021 +0100
- Revision:
- 47:21ae3e5a7128
- Parent:
- 43:2a7da56ebd24
Add a few normpath calls
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
screamer | 0:66f3b5499f7f | 1 | """ |
screamer | 0:66f3b5499f7f | 2 | mbed SDK |
screamer | 13:ab47a20b66f0 | 3 | Copyright (c) 2016 ARM Limited |
screamer | 13:ab47a20b66f0 | 4 | |
screamer | 0:66f3b5499f7f | 5 | Licensed under the Apache License, Version 2.0 (the "License"); |
screamer | 0:66f3b5499f7f | 6 | you may not use this file except in compliance with the License. |
screamer | 0:66f3b5499f7f | 7 | You may obtain a copy of the License at |
screamer | 13:ab47a20b66f0 | 8 | |
screamer | 13:ab47a20b66f0 | 9 | http://www.apache.org/licenses/LICENSE-2.0 |
screamer | 13:ab47a20b66f0 | 10 | |
screamer | 0:66f3b5499f7f | 11 | Unless required by applicable law or agreed to in writing, software |
screamer | 0:66f3b5499f7f | 12 | distributed under the License is distributed on an "AS IS" BASIS, |
screamer | 0:66f3b5499f7f | 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
screamer | 0:66f3b5499f7f | 14 | See the License for the specific language governing permissions and |
screamer | 0:66f3b5499f7f | 15 | limitations under the License. |
screamer | 0:66f3b5499f7f | 16 | """ |
theotherjimmy |
43:2a7da56ebd24 | 17 | from __future__ import print_function |
screamer | 13:ab47a20b66f0 | 18 | from os import getenv |
screamer | 13:ab47a20b66f0 | 19 | from os.path import join, abspath, dirname, exists |
screamer | 0:66f3b5499f7f | 20 | import logging |
screamer | 0:66f3b5499f7f | 21 | |
screamer | 0:66f3b5499f7f | 22 | ROOT = abspath(join(dirname(__file__), "..")) |
screamer | 0:66f3b5499f7f | 23 | |
screamer | 0:66f3b5499f7f | 24 | |
screamer | 0:66f3b5499f7f | 25 | ############################################################################## |
screamer | 13:ab47a20b66f0 | 26 | # Toolchains and Build System Settings |
screamer | 0:66f3b5499f7f | 27 | ############################################################################## |
The Other Jimmy |
31:8ea194f6145b | 28 | BUILD_DIR = abspath(join(ROOT, "BUILD")) |
screamer | 0:66f3b5499f7f | 29 | |
screamer | 13:ab47a20b66f0 | 30 | # ARM Compiler 5 |
The Other Jimmy |
35:da9c89f8be7d | 31 | ARM_PATH = "" |
screamer | 0:66f3b5499f7f | 32 | |
theotherjimmy |
40:7d3fa6b99b2b | 33 | # ARM Compiler 6 |
theotherjimmy |
40:7d3fa6b99b2b | 34 | ARMC6_PATH = "" |
theotherjimmy |
40:7d3fa6b99b2b | 35 | |
screamer | 0:66f3b5499f7f | 36 | # GCC ARM |
screamer | 0:66f3b5499f7f | 37 | GCC_ARM_PATH = "" |
screamer | 0:66f3b5499f7f | 38 | |
screamer | 0:66f3b5499f7f | 39 | # GCC CodeRed |
The Other Jimmy |
35:da9c89f8be7d | 40 | GCC_CR_PATH = "" |
screamer | 0:66f3b5499f7f | 41 | |
screamer | 0:66f3b5499f7f | 42 | # IAR |
The Other Jimmy |
35:da9c89f8be7d | 43 | IAR_PATH = "" |
screamer | 0:66f3b5499f7f | 44 | |
screamer | 13:ab47a20b66f0 | 45 | # Goanna static analyser. Please overload it in mbed_settings.py |
The Other Jimmy |
35:da9c89f8be7d | 46 | GOANNA_PATH = "" |
screamer | 0:66f3b5499f7f | 47 | |
theotherjimmy |
43:2a7da56ebd24 | 48 | |
screamer | 0:66f3b5499f7f | 49 | # cppcheck path (command) and output message format |
screamer | 0:66f3b5499f7f | 50 | CPPCHECK_CMD = ["cppcheck", "--enable=all"] |
screamer | 0:66f3b5499f7f | 51 | CPPCHECK_MSG_FORMAT = ["--template=[{severity}] {file}@{line}: {id}:{message}"] |
screamer | 0:66f3b5499f7f | 52 | |
screamer | 0:66f3b5499f7f | 53 | BUILD_OPTIONS = [] |
screamer | 0:66f3b5499f7f | 54 | |
screamer | 0:66f3b5499f7f | 55 | # mbed.org username |
screamer | 0:66f3b5499f7f | 56 | MBED_ORG_USER = "" |
screamer | 0:66f3b5499f7f | 57 | |
theotherjimmy |
43:2a7da56ebd24 | 58 | # Print compiler warnings and errors as link format |
theotherjimmy |
43:2a7da56ebd24 | 59 | PRINT_COMPILER_OUTPUT_AS_LINK = False |
theotherjimmy |
43:2a7da56ebd24 | 60 | |
theotherjimmy |
43:2a7da56ebd24 | 61 | # Compare against a fixed build of the project for space consumption |
theotherjimmy |
43:2a7da56ebd24 | 62 | COMPARE_FIXED = False |
theotherjimmy |
43:2a7da56ebd24 | 63 | |
theotherjimmy |
43:2a7da56ebd24 | 64 | # Print warnings/errors in color |
theotherjimmy |
43:2a7da56ebd24 | 65 | COLOR = False |
theotherjimmy |
43:2a7da56ebd24 | 66 | |
screamer | 22:9e85236d8716 | 67 | CLI_COLOR_MAP = { |
theotherjimmy |
43:2a7da56ebd24 | 68 | "Warning": "yellow", |
theotherjimmy |
43:2a7da56ebd24 | 69 | "Error" : "red" |
screamer | 22:9e85236d8716 | 70 | } |
screamer | 13:ab47a20b66f0 | 71 | |
screamer | 13:ab47a20b66f0 | 72 | ############################################################################## |
screamer | 13:ab47a20b66f0 | 73 | # User Settings (file) |
screamer | 13:ab47a20b66f0 | 74 | ############################################################################## |
screamer | 13:ab47a20b66f0 | 75 | try: |
screamer | 13:ab47a20b66f0 | 76 | # Allow to overwrite the default settings without the need to edit the |
screamer | 13:ab47a20b66f0 | 77 | # settings file stored in the repository |
screamer | 13:ab47a20b66f0 | 78 | from mbed_settings import * |
screamer | 13:ab47a20b66f0 | 79 | except ImportError: |
screamer | 13:ab47a20b66f0 | 80 | pass |
screamer | 13:ab47a20b66f0 | 81 | |
screamer | 13:ab47a20b66f0 | 82 | |
screamer | 13:ab47a20b66f0 | 83 | ############################################################################## |
screamer | 13:ab47a20b66f0 | 84 | # User Settings (env vars) |
screamer | 13:ab47a20b66f0 | 85 | ############################################################################## |
theotherjimmy |
40:7d3fa6b99b2b | 86 | _ENV_PATHS = ['ARM_PATH', 'GCC_ARM_PATH', 'GCC_CR_PATH', 'IAR_PATH', |
theotherjimmy |
40:7d3fa6b99b2b | 87 | 'ARMC6_PATH'] |
screamer | 13:ab47a20b66f0 | 88 | |
screamer | 13:ab47a20b66f0 | 89 | for _n in _ENV_PATHS: |
screamer | 13:ab47a20b66f0 | 90 | if getenv('MBED_'+_n): |
screamer | 13:ab47a20b66f0 | 91 | if exists(getenv('MBED_'+_n)): |
screamer | 13:ab47a20b66f0 | 92 | globals()[_n] = getenv('MBED_'+_n) |
screamer | 13:ab47a20b66f0 | 93 | else: |
theotherjimmy |
43:2a7da56ebd24 | 94 | print("WARNING: MBED_%s set as environment variable but doesn't" |
theotherjimmy |
43:2a7da56ebd24 | 95 | " exist" % _n) |
theotherjimmy |
43:2a7da56ebd24 | 96 | |
theotherjimmy |
43:2a7da56ebd24 | 97 | _ENV_VARS = ['PRINT_COMPILER_OUTPUT_AS_LINK', 'COLOR', 'COMPARE_FIXED'] |
theotherjimmy |
43:2a7da56ebd24 | 98 | for _n in _ENV_VARS: |
theotherjimmy |
43:2a7da56ebd24 | 99 | value = getenv('MBED_%s' % _n) |
theotherjimmy |
43:2a7da56ebd24 | 100 | if value: |
theotherjimmy |
43:2a7da56ebd24 | 101 | globals()[_n] = value |
screamer | 13:ab47a20b66f0 | 102 | |
screamer | 13:ab47a20b66f0 | 103 | |
screamer | 13:ab47a20b66f0 | 104 | ############################################################################## |
screamer | 0:66f3b5499f7f | 105 | # Test System Settings |
screamer | 0:66f3b5499f7f | 106 | ############################################################################## |
screamer | 0:66f3b5499f7f | 107 | SERVER_PORT = 59432 |
screamer | 0:66f3b5499f7f | 108 | SERVER_ADDRESS = "10.2.200.94" |
screamer | 0:66f3b5499f7f | 109 | LOCALHOST = "10.2.200.94" |
screamer | 0:66f3b5499f7f | 110 | |
screamer | 0:66f3b5499f7f | 111 | MUTs = { |
screamer | 0:66f3b5499f7f | 112 | "1" : {"mcu": "LPC1768", |
screamer | 0:66f3b5499f7f | 113 | "port":"COM41", "disk":'E:\\', |
screamer | 0:66f3b5499f7f | 114 | "peripherals": ["TMP102", "digital_loop", "port_loop", "analog_loop", "SD"] |
screamer | 0:66f3b5499f7f | 115 | }, |
screamer | 0:66f3b5499f7f | 116 | "2": {"mcu": "LPC11U24", |
screamer | 0:66f3b5499f7f | 117 | "port":"COM42", "disk":'F:\\', |
screamer | 0:66f3b5499f7f | 118 | "peripherals": ["TMP102", "digital_loop", "port_loop", "SD"] |
screamer | 0:66f3b5499f7f | 119 | }, |
screamer | 0:66f3b5499f7f | 120 | "3" : {"mcu": "KL25Z", |
screamer | 0:66f3b5499f7f | 121 | "port":"COM43", "disk":'G:\\', |
screamer | 0:66f3b5499f7f | 122 | "peripherals": ["TMP102", "digital_loop", "port_loop", "analog_loop", "SD"] |
screamer | 0:66f3b5499f7f | 123 | }, |
screamer | 0:66f3b5499f7f | 124 | } |