mbed os with nrf51 internal bandgap enabled to read battery level

Dependents:   BLE_file_test BLE_Blink ExternalEncoder

Committer:
elessair
Date:
Sun Oct 23 15:10:02 2016 +0000
Revision:
0:f269e3021894
Initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
elessair 0:f269e3021894 1 ###########################################################################
elessair 0:f269e3021894 2 #
elessair 0:f269e3021894 3 # Copyright (c) 2016, ARM Limited, All Rights Reserved
elessair 0:f269e3021894 4 # SPDX-License-Identifier: Apache-2.0
elessair 0:f269e3021894 5 #
elessair 0:f269e3021894 6 # Licensed under the Apache License, Version 2.0 (the "License"); you may
elessair 0:f269e3021894 7 # not use this file except in compliance with the License.
elessair 0:f269e3021894 8 # You may obtain a copy of the License at
elessair 0:f269e3021894 9 #
elessair 0:f269e3021894 10 # http://www.apache.org/licenses/LICENSE-2.0
elessair 0:f269e3021894 11 #
elessair 0:f269e3021894 12 # Unless required by applicable law or agreed to in writing, software
elessair 0:f269e3021894 13 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
elessair 0:f269e3021894 14 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
elessair 0:f269e3021894 15 # See the License for the specific language governing permissions and
elessair 0:f269e3021894 16 # limitations under the License.
elessair 0:f269e3021894 17 #
elessair 0:f269e3021894 18 ###########################################################################
elessair 0:f269e3021894 19
elessair 0:f269e3021894 20 #
elessair 0:f269e3021894 21 # Use this file to import an mbed TLS release into mbed-OS as follows:
elessair 0:f269e3021894 22 #
elessair 0:f269e3021894 23 # 1) Set the MBED_TLS_RELEASE variable to the required mbed TLS release tag
elessair 0:f269e3021894 24 # 2) make update
elessair 0:f269e3021894 25 # 3) make
elessair 0:f269e3021894 26 # 4) commit and push changes via git
elessair 0:f269e3021894 27 #
elessair 0:f269e3021894 28
elessair 0:f269e3021894 29 # Set the mbed TLS release to import (this can/should be edited before import)
elessair 0:f269e3021894 30 MBED_TLS_RELEASE ?= mbedtls-2.4.0
elessair 0:f269e3021894 31
elessair 0:f269e3021894 32 # Translate between mbed TLS namespace and mbed namespace
elessair 0:f269e3021894 33 TARGET_PREFIX:=../
elessair 0:f269e3021894 34 TARGET_SRC:=$(TARGET_PREFIX)src
elessair 0:f269e3021894 35 TARGET_INC:=$(TARGET_PREFIX)inc
elessair 0:f269e3021894 36
elessair 0:f269e3021894 37 # mbed TLS source directory - hidden from mbed via TARGET_IGNORE
elessair 0:f269e3021894 38 MBED_TLS_URL:=https://github.com/ARMmbed/mbedtls-restricted.git
elessair 0:f269e3021894 39 MBED_TLS_DIR:=TARGET_IGNORE/mbedtls
elessair 0:f269e3021894 40 MBED_TLS_API:=$(MBED_TLS_DIR)/include/mbedtls
elessair 0:f269e3021894 41 MBED_TLS_GIT_CFG=$(MBED_TLS_DIR)/.git/config
elessair 0:f269e3021894 42
elessair 0:f269e3021894 43 .PHONY: all deploy rsync mbedtls clean update
elessair 0:f269e3021894 44
elessair 0:f269e3021894 45 all: mbedtls
elessair 0:f269e3021894 46
elessair 0:f269e3021894 47 mbedtls: deploy
elessair 0:f269e3021894 48
elessair 0:f269e3021894 49 rsync:
elessair 0:f269e3021894 50 #
elessair 0:f269e3021894 51 # Copying mbed TLS into mbed library...
elessair 0:f269e3021894 52 rm -rf $(TARGET_SRC)
elessair 0:f269e3021894 53 rsync -a --exclude='*.txt' $(MBED_TLS_DIR)/library/ $(TARGET_SRC)
elessair 0:f269e3021894 54 #
elessair 0:f269e3021894 55 # Copying mbed TLS headers to mbed includes...
elessair 0:f269e3021894 56 rm -rf $(TARGET_INC)
elessair 0:f269e3021894 57 mkdir -p $(TARGET_INC)
elessair 0:f269e3021894 58 rsync -a --delete $(MBED_TLS_API) $(TARGET_INC)
elessair 0:f269e3021894 59 #
elessair 0:f269e3021894 60 # Copying licenses
elessair 0:f269e3021894 61 cp $(MBED_TLS_DIR)/LICENSE $(TARGET_PREFIX)
elessair 0:f269e3021894 62 cp $(MBED_TLS_DIR)/apache-2.0.txt $(TARGET_PREFIX)
elessair 0:f269e3021894 63 #
elessair 0:f269e3021894 64
elessair 0:f269e3021894 65 deploy: rsync
elessair 0:f269e3021894 66 #
elessair 0:f269e3021894 67 # Adjusting the default mbed TLS config file to mbed purposes
elessair 0:f269e3021894 68 ./adjust-config.sh $(MBED_TLS_DIR)/scripts/config.pl $(TARGET_INC)/mbedtls/config.h
elessair 0:f269e3021894 69 #
elessair 0:f269e3021894 70 # Copy the trimmed config that does not require entropy source
elessair 0:f269e3021894 71 cp $(MBED_TLS_DIR)/configs/config-no-entropy.h $(TARGET_INC)/mbedtls/.
elessair 0:f269e3021894 72
elessair 0:f269e3021894 73 update: $(MBED_TLS_GIT_CFG) $(MBED_TLS_HA_GIT_CFG)
elessair 0:f269e3021894 74 #
elessair 0:f269e3021894 75 # Updating to the specified mbed TLS library version
elessair 0:f269e3021894 76 # (If it is not an initial checkout we will start with the repository
elessair 0:f269e3021894 77 # being in a detached head state)
elessair 0:f269e3021894 78 git -C $(MBED_TLS_DIR) checkout development
elessair 0:f269e3021894 79 git -C $(MBED_TLS_DIR) pull --rebase origin development
elessair 0:f269e3021894 80 #
elessair 0:f269e3021894 81 # Checking out the required release
elessair 0:f269e3021894 82 git -C $(MBED_TLS_DIR) checkout $(MBED_TLS_RELEASE)
elessair 0:f269e3021894 83 #
elessair 0:f269e3021894 84 # Updating checked out version tag
elessair 0:f269e3021894 85 echo $(MBED_TLS_RELEASE) > $(TARGET_PREFIX)VERSION.txt
elessair 0:f269e3021894 86
elessair 0:f269e3021894 87 $(MBED_TLS_GIT_CFG):
elessair 0:f269e3021894 88 rm -rf $(MBED_TLS_DIR)
elessair 0:f269e3021894 89 git clone $(MBED_TLS_URL) $(MBED_TLS_DIR)
elessair 0:f269e3021894 90
elessair 0:f269e3021894 91 clean:
elessair 0:f269e3021894 92 rm -f $(TARGET_PREFIX)LICENSE
elessair 0:f269e3021894 93 rm -f $(TARGET_PREFIX)apache-2.0.txt
elessair 0:f269e3021894 94 rm -f $(TARGET_PREFIX)VERSION.txt
elessair 0:f269e3021894 95 rm -f $(TARGET_PREFIX)AUTHORS.txt
elessair 0:f269e3021894 96 rm -rf $(TARGET_PREFIX)/targets
elessair 0:f269e3021894 97 rm -rf $(TARGET_SRC)
elessair 0:f269e3021894 98 rm -rf $(TARGET_INC)
elessair 0:f269e3021894 99 rm -rf $(MBED_TLS_DIR)
elessair 0:f269e3021894 100