Commit f6452c04 authored by Thanassis Tsiodras's avatar Thanassis Tsiodras
Browse files

Merge branch 'revert-71d8553f' into 'master'

Revert "Merge branch 'fix_rpi' into 'master'"

See merge request !42
parents 453fe69e e5892f41
Pipeline #4188 canceled with stage
in 11 seconds
# image: $CI_REGISTRY_IMAGE/taste:latest
image: taste-buster:latest
image: taste:latest
variables:
GIT_SUBMODULE_STRATEGY: normal
......@@ -15,6 +15,6 @@ build:
artifacts:
paths:
- 'kazoo/test/logs/*.err.txt'
- 'opengeode/tests/testsuite/logs/*.err.txt'
- 'opengeode/tests/regression/logs/*.err.txt'
when: on_failure
expire_in: 2 weeks
......@@ -7,9 +7,9 @@
#
# ./Docker-run.sh
#
FROM debian:buster
FROM debian:stretch
RUN apt-get update
RUN apt-get -y install netcat net-tools wget lsb-release
RUN apt-get -y install netcat net-tools wget
# There is immense waste of re-downloading the .deb files
# in every attempt to setup the Docker image.
# The following uses a locally-provided proxy
......@@ -22,7 +22,6 @@ RUN echo "HEAD /" | nc `cat /tmp/host_ip.txt` 8000 | grep squid-deb-proxy \
|| echo "No squid-deb-proxy detected on docker host"
RUN bash -c 'export DEBIAN_FRONTEND=noninteractive ; apt-get -y install git sudo'
RUN bash -c 'cd /root ; git clone https://gitrepos.estec.esa.int/taste/taste-setup.git tool-src'
RUN bash -c 'cd /root/tool-src ; git checkout -f feature_buster'
# The following pieces correspond to the execution of Update-TASTE.sh ;
# but the execution has to be broken down into steps, so that Docker
......@@ -35,13 +34,11 @@ RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISAB
RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/06_stlink.sh'
RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/10_dmt.sh'
RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/15_asn1scc.sh'
RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/16_cleanup-old-mscc.sh'
RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/20_msc.sh'
RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/30_qemu.sh'
RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/39_tasteconfig.sh'
RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/40_ocarina.sh'
RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/45_pohi.sh'
RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/46_aadlib.sh'
RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/50_opengeode.sh'
RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/53_pymsc.sh'
RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/54_speedometer.sh'
......@@ -54,9 +51,6 @@ RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISAB
RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/80_build-scripts.sh'
# Those that need RTEMS can set it up themselves (avoid creating huge Docker image)
RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/85_rtems.sh'
RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/86_air.sh'
RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/87_kazoo.sh'
RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/88_spaceCreator.sh'
RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/90_misc.sh'
RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/91_env.sh'
RUN bash -c 'cd /root/tool-src ; PATH=/root/tool-inst/bin:$PATH HOME=/root DISABLE_TASTE_BANNER=1 install/95_components_library.sh'
......
......@@ -17,24 +17,18 @@ function banner()
echo -e "${COLOROFF}"
}
if [ -z "$GITLAB_CI" ] ; then
git pull || exit 1
if [ -z "$1" -o "$1" == "--stable" ] ; then
git submodule init || exit 1
git submodule update || exit 1
else
git submodule | awk '{print $2}' | while read FOLDER ; do
cd "$FOLDER" || exit 1
git fetch || exit 1
git checkout master || exit 1
git pull || exit 1
cd ..
done
fi
git pull || exit 1
if [ -z "$1" -o "$1" == "--stable" ] ; then
git submodule init || exit 1
git submodule update || exit 1
else
echo 'Updating TASTE in the CI container'
#git submodule init || exit 1
#git submodule update || exit 1
git submodule | awk '{print $2}' | while read FOLDER ; do
cd "$FOLDER" || exit 1
git fetch || exit 1
git checkout master || exit 1
git pull || exit 1
cd ..
done
fi
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export DISABLE_TASTE_BANNER=1
......@@ -46,10 +40,6 @@ for INSTALL_SCRIPT in install/[0-9]*sh ; do
continue
fi
fi
if [ "${INSTALL_SCRIPT}" == "install/92_Brave.sh" ] ; then
echo Skipping over Brave installation.
continue
fi
MSG="executing: ${INSTALL_SCRIPT}"
banner "$MSG"
echo -n "Calling ${INSTALL_SCRIPT} took: " >> timings.log
......@@ -69,9 +59,3 @@ echo "Please close this terminal and open a new one"
echo "(to make sure the environment variables are updated)."
echo "====================================================="
echo -e "${COLOROFF}"
if [ ! -f $HOME/.taste.shell.config.warning ] ; then
touch $HOME/.taste.shell.config.warning
echo -e "POST INSTALL: You must source ~/.bashrc.taste before you can start"
echo -e " using TASTE and modify your shell's configuration"
echo -e " (e.g. .bashrc) to always source it"
fi
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.
# Every Vagrant development environment requires a box. You can search for
# boxes at https://vagrantcloud.com/search.
config.vm.box = "debian/buster64"
# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
# `vagrant box outdated`. This is not recommended.
# config.vm.box_check_update = false
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# NOTE: This will enable public access to the opened port
# config.vm.network "forwarded_port", guest: 80, host: 8080
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine and only allow access
# via 127.0.0.1 to disable public access
# config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1"
# Create a private network, which allows host-only access to the machine
# using a specific IP.
# config.vm.network "private_network", ip: "192.168.33.10"
# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# config.vm.network "public_network"
# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# config.vm.synced_folder "../data", "/vagrant_data"
# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
# Example for VirtualBox:
#
# config.vm.provider "virtualbox" do |vb|
# # Display the VirtualBox GUI when booting the machine
# vb.gui = true
#
# # Customize the amount of memory on the VM:
# vb.memory = "1024"
# end
#
# View the documentation for the provider you are using for more
# information on available options.
# Enable provisioning with a shell script. Additional provisioners such as
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
# documentation for more information about their specific syntax and use.
config.vm.provision "shell", inline: <<-SHELL
echo -e "Acquire::http::Pipeline-Depth 0;\nAcquire::http::No-Cache true;\nAcquire::BrokenProxy true;" | sudo tee /etc/apt/apt.conf.d/99BadESAProxy
echo "deb http://deb.debian.org/debian stretch main" >> /etc/apt/sources.list
apt-get update
apt-get install -y sudo git
SHELL
end
diff -ruN FreeRTOS.orig/Source/portable/GCC/MSP430FR5969/port.c FreeRTOS/Source/portable/GCC/MSP430FR5969/port.c
--- FreeRTOS.orig/Source/portable/GCC/MSP430FR5969/port.c 1970-01-01 01:00:00.000000000 +0100
+++ FreeRTOS/Source/portable/GCC/MSP430FR5969/port.c 2020-06-02 12:48:12.044000000 +0100
@@ -0,0 +1,318 @@
+/*
+ * FreeRTOS Kernel V10.3.1
+ * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * http://www.FreeRTOS.org
+ * http://aws.amazon.com/freertos
+ *
+ * 1 tab == 4 spaces!
+ */
+
+/* Standard includes. */
+#include <stdlib.h>
+#include <signal.h>
+
+#include <msp430.h>
+
+/* Scheduler includes. */
+#include "FreeRTOS.h"
+#include "task.h"
+
+/*-----------------------------------------------------------
+ * Implementation of functions defined in portable.h for the MSP430 port.
+ *----------------------------------------------------------*/
+
+/* Constants required for hardware setup. The tick ISR runs off the ACLK,
+not the MCLK. */
+#define portACLK_FREQUENCY_HZ ( ( TickType_t ) 32768 )
+#define portINITIAL_CRITICAL_NESTING ( ( uint16_t ) 10 )
+#define portFLAGS_INT_ENABLED ( ( StackType_t ) 0x08 )
+
+/* We require the address of the pxCurrentTCB variable, but don't want to know
+any details of its type. */
+typedef void TCB_t;
+extern volatile TCB_t * volatile pxCurrentTCB;
+
+/* Most ports implement critical sections by placing the interrupt flags on
+the stack before disabling interrupts. Exiting the critical section is then
+simply a case of popping the flags from the stack. As mspgcc does not use
+a frame pointer this cannot be done as modifying the stack will clobber all
+the stack variables. Instead each task maintains a count of the critical
+section nesting depth. Each time a critical section is entered the count is
+incremented. Each time a critical section is left the count is decremented -
+with interrupts only being re-enabled if the count is zero.
+
+usCriticalNesting will get set to zero when the scheduler starts, but must
+not be initialised to zero as this will cause problems during the startup
+sequence. */
+volatile uint16_t usCriticalNesting = portINITIAL_CRITICAL_NESTING;
+/*-----------------------------------------------------------*/
+
+/*
+ * Macro to save a task context to the task stack. This simply pushes all the
+ * general purpose msp430 registers onto the stack, followed by the
+ * usCriticalNesting value used by the task. Finally the resultant stack
+ * pointer value is saved into the task control block so it can be retrieved
+ * the next time the task executes.
+ */
+#ifdef __LARGE_DATA_MODEL__
+#define portSAVE_CONTEXT() \
+ asm volatile ( "pushm.a #12, r15 \n\t" \
+ "movx.w &usCriticalNesting, r14 \n\t" \
+ "pushm.a #1, r14 \n\t" \
+ "movx.a &pxCurrentTCB, r12 \n\t" \
+ "movx.a sp, 0(r12) \n\t" \
+ );
+#else
+#define portSAVE_CONTEXT() \
+ asm volatile ( "pushm.w #12, r15 \n\t" \
+ "mov.w &usCriticalNesting, r14 \n\t" \
+ "push.w r14 \n\t" \
+ "mov.w &pxCurrentTCB, r12 \n\t" \
+ "mov.w sp, 0(r12) \r\t" \
+ );
+#endif
+
+/*
+ * Macro to restore a task context from the task stack. This is effectively
+ * the reverse of portSAVE_CONTEXT(). First the stack pointer value is
+ * loaded from the task control block. Next the value for usCriticalNesting
+ * used by the task is retrieved from the stack - followed by the value of all
+ * the general purpose msp430 registers.
+ *
+ */
+#ifdef __LARGE_DATA_MODEL__
+#define portRESTORE_CONTEXT() \
+ asm volatile ( "movx.a &pxCurrentTCB, r12 \n\t" \
+ "movx.a @r12, sp \n\t" \
+ "popm.a #1, r15 \n\t" \
+ "movx.w r15, &usCriticalNesting \n\t" \
+ "popm.a #12, r15 \n\t" \
+ "nop \n\t" \
+ "pop.w sr \n\t" \
+ "nop \n\t" \
+ "reta \n\t" \
+ );
+#else
+#define portRESTORE_CONTEXT() \
+ asm volatile ( "mov.w &pxCurrentTCB, r12 \n\t" \
+ "mov.w @r12, sp \n\t" \
+ "pop.w r15 \n\t" \
+ "mov.w r15, &usCriticalNesting \n\t" \
+ "popm.w #12, r15 \n\t" \
+ "nop \n\t" \
+ "pop.w sr \n\t" \
+ "nop \n\t" \
+ "ret \n\t" \
+ );
+#endif
+/*-----------------------------------------------------------*/
+
+/*
+ * Sets up the periodic ISR used for the RTOS tick. This uses timer 0, but
+ * could have alternatively used the watchdog timer or timer 1.
+ */
+static void prvSetupTimerInterrupt( void );
+/*-----------------------------------------------------------*/
+
+/*
+ * Initialise the stack of a task to look exactly as if a call to
+ * portSAVE_CONTEXT had been called.
+ *
+ * See the header file portable.h.
+ */
+
+StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
+{
+ uint16_t *pusTopOfStack;
+ uint32_t *pulTopOfStack, ulTemp;
+
+ /*
+ Place a few bytes of known values on the bottom of the stack.
+ This is just useful for debugging and can be included if required.
+
+ *pxTopOfStack = ( StackType_t ) 0x1111;
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0x2222;
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0x3333;
+ pxTopOfStack--;
+ */
+
+ /* Data types are need either 16 bits or 32 bits depending on the data
+ and code model used. */
+ if( sizeof( pxCode ) == sizeof( uint16_t ) )
+ {
+ pusTopOfStack = ( uint16_t * ) pxTopOfStack;
+ ulTemp = ( uint32_t ) pxCode;
+ *pusTopOfStack = ( uint16_t ) ulTemp;
+ }
+ else
+ {
+ /* Make room for a 20 bit value stored as a 32 bit value. */
+ pusTopOfStack = ( uint16_t * ) pxTopOfStack;
+ pusTopOfStack--;
+ pulTopOfStack = ( uint32_t * ) pusTopOfStack;
+ *pulTopOfStack = ( uint32_t ) pxCode;
+ }
+
+ pusTopOfStack--;
+ *pusTopOfStack = portFLAGS_INT_ENABLED;
+ pusTopOfStack -= ( sizeof( StackType_t ) / 2 );
+
+ /* From here on the size of stacked items depends on the memory model. */
+ pxTopOfStack = ( StackType_t * ) pusTopOfStack;
+
+ /* Next the general purpose registers. */
+ #ifdef PRELOAD_REGISTER_VALUES
+ *pxTopOfStack = ( StackType_t ) 0xffff;
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0xeeee;
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0xdddd;
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) pvParameters;
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0xbbbb;
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0xaaaa;
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0x9999;
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0x8888;
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0x7777;
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0x6666;
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0x5555;
+ pxTopOfStack--;
+ *pxTopOfStack = ( StackType_t ) 0x4444;
+ pxTopOfStack--;
+ #else
+ pxTopOfStack -= 3;
+ *pxTopOfStack = ( StackType_t ) pvParameters;
+ pxTopOfStack -= 9;
+ #endif
+
+ /* A variable is used to keep track of the critical section nesting.
+ This variable has to be stored as part of the task context and is
+ initially set to zero. */
+ *pxTopOfStack = ( StackType_t ) portNO_CRITICAL_SECTION_NESTING;
+
+ /* Return a pointer to the top of the stack we have generated so this can
+ be stored in the task control block for the task. */
+ return pxTopOfStack;
+}
+/*-----------------------------------------------------------*/
+
+BaseType_t xPortStartScheduler( void )
+{
+ /* Setup the hardware to generate the tick. Interrupts are disabled when
+ this function is called. */
+ prvSetupTimerInterrupt();
+
+ /* Restore the context of the first task that is going to run. */
+ portRESTORE_CONTEXT();
+
+ /* Should not get here as the tasks are now running! */
+ return pdTRUE;
+}
+/*-----------------------------------------------------------*/
+
+void vPortEndScheduler( void )
+{
+ /* It is unlikely that the MSP430 port will get stopped. If required simply
+ disable the tick interrupt here. */
+}
+/*-----------------------------------------------------------*/
+
+/*
+ * Manual context switch called by portYIELD or taskYIELD.
+ *
+ * The first thing we do is save the registers so we can use a naked attribute.
+ */
+
+void vPortYield( void ) __attribute__ ( ( naked ) );
+void vPortYield( void )
+{
+ asm volatile ( "push.w sr" );
+
+ portDISABLE_INTERRUPTS();
+ portSAVE_CONTEXT();
+
+ vTaskSwitchContext();
+
+ portRESTORE_CONTEXT();
+}
+/*-----------------------------------------------------------*/
+
+/*
+ * Hardware initialisation to generate the RTOS tick. This uses timer 0
+ * but could alternatively use the watchdog timer or timer 1.
+ */
+static void prvSetupTimerInterrupt( void )
+{
+ vApplicationSetupTimerInterrupt();
+}
+/*-----------------------------------------------------------*/
+
+/*
+ * The interrupt service routine used depends on whether the pre-emptive
+ * scheduler is being used or not.
+ */
+
+#if configUSE_PREEMPTION == 1
+void vPortPreemptiveTickISR(void)
+{
+ asm volatile("push.w sr");
+ portSAVE_CONTEXT();
+
+ if(xTaskIncrementTick() != pdFALSE)
+ {
+ vTaskSwitchContext();
+ }
+
+ portRESTORE_CONTEXT();
+}
+
+__attribute__((interrupt(configTICK_VECTOR))) void prvTickISR(void)
+{
+ __bic_SR_register_on_exit( SCG1 + SCG0 + OSCOFF + CPUOFF );
+ vPortPreemptiveTickISR();
+}
+#else
+void vPortCooperativeTickISR(void)
+{
+ asm volatile("push.w sr");
+ portSAVE_CONTEXT();
+
+ xTaskIncrementTick();
+
+ portRESTORE_CONTEXT();
+}
+
+__attribute__((interrupt(configTICK_VECTOR))) void prvTickISR(void)
+{
+ __bic_SR_register_on_exit( SCG1 + SCG0 + OSCOFF + CPUOFF );
+
+ vPortCooperativeTickISR();
+}
+#endif
diff -ruN FreeRTOS.orig/Source/portable/GCC/MSP430FR5969/portmacro.h FreeRTOS/Source/portable/GCC/MSP430FR5969/portmacro.h
--- FreeRTOS.orig/Source/portable/GCC/MSP430FR5969/portmacro.h 1970-01-01 01:00:00.000000000 +0100
+++ FreeRTOS/Source/portable/GCC/MSP430FR5969/portmacro.h 2020-06-02 12:48:12.044000000 +0100
@@ -0,0 +1,133 @@
+/*
+ * FreeRTOS Kernel V10.3.1
+ * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * http://www.FreeRTOS.org
+ * http://aws.amazon.com/freertos
+ *
+ * 1 tab == 4 spaces!
+ */
+
+#ifndef PORTMACRO_H
+#define PORTMACRO_H
+
+/*-----------------------------------------------------------
+ * Port specific definitions.
+ *
+ * The settings in this file configure FreeRTOS correctly for the
+ * given hardware and compiler.
+ *
+ * These settings should not be altered.
+ *-----------------------------------------------------------
+ */
+
+/* Hardware includes. */
+#include <msp430.h>
+
+/* Type definitions. */
+#define portCHAR char
+#define portFLOAT float
+#define portDOUBLE double
+#define portLONG long
+#define portSHORT int
+#define portBASE_TYPE short
+
+/* The stack type changes depending on the data model. */
+#ifdef __LARGE_DATA_MODEL__
+ #define portSTACK_TYPE uint32_t
+#else
+ #define portSTACK_TYPE uint16_t
+ #define portPOINTER_SIZE_TYPE uint16_t
+#endif
+
+typedef portSTACK_TYPE StackType_t;
+typedef short BaseType_t;
+typedef unsigned short UBaseType_t;
+
+#if( configUSE_16_BIT_TICKS == 1 )
+ typedef uint16_t TickType_t;
+ #define portMAX_DELAY ( TickType_t ) 0xffff
+#else
+ typedef uint32_t TickType_t;
+ #define portMAX_DELAY ( TickType_t ) 0xffffffffUL
+#endif
+
+/*-----------------------------------------------------------*/
+
+/* Interrupt control macros. */
+#define portDISABLE_INTERRUPTS() asm volatile ( "NOP" ); asm volatile ( "DINT" ); asm volatile ( "NOP" )
+#define portENABLE_INTERRUPTS() asm volatile ( "NOP" ); asm volatile ( "EINT" ); asm volatile ( "NOP" )
+/*-----------------------------------------------------------*/
+
+/* Critical section control macros. */
+#define portNO_CRITICAL_SECTION_NESTING ( ( uint16_t ) 0 )
+
+#define portENTER_CRITICAL() \
+{ \
+extern volatile uint16_t usCriticalNesting; \
+ \
+ portDISABLE_INTERRUPTS(); \
+ \
+ /* Now interrupts are disabled ulCriticalNesting can be accessed */ \
+ /* directly. Increment ulCriticalNesting to keep a count of how many */ \
+ /* times portENTER_CRITICAL() has been called. */ \
+ usCriticalNesting++; \
+}
+
+#define portEXIT_CRITICAL() \
+{ \
+extern volatile uint16_t usCriticalNesting; \
+ \
+ if( usCriticalNesting > portNO_CRITICAL_SECTION_NESTING ) \
+ { \
+ /* Decrement the nesting count as we are leaving a critical section. */ \
+ usCriticalNesting--; \
+ \
+ /* If the nesting level has reached zero then interrupts should be */ \
+ /* re-enabled. */ \
+ if( usCriticalNesting == portNO_CRITICAL_SECTION_NESTING ) \
+ { \
+ portENABLE_INTERRUPTS(); \
+ } \
+ } \
+}