From ac73b8792887fd494f2a6102709d6f833883816b Mon Sep 17 00:00:00 2001
From: Thibaut VIARD <thibaut.viard@atmel.com>
Date: Wed, 16 Apr 2014 10:53:11 +0200
Subject: [PATCH]  Cleanup and adding more needed files

---
 cores/arduino/USART.cpp                       |  138 ++
 cores/arduino/USART.h                         |   61 +
 cores/arduino/build_gcc/libarduino_adk2.mk    |  183 --
 .../build_gcc/libarduino_arduino_due_u.mk     |  185 --
 .../build_gcc/libarduino_arduino_due_x.mk     |  185 --
 .../arduino/build_gcc/libarduino_sam3s_ek.mk  |  183 --
 .../arduino/build_gcc/libarduino_sam3u_ek.mk  |  183 --
 .../arduino/build_gcc/libarduino_sam3x_ek.mk  |  183 --
 cores/arduino/validation/build_iar/test.ewd   | 1769 ----------------
 cores/arduino/validation/build_iar/test.ewp   | 1834 -----------------
 libraries/SPI/SPI.cpp                         |  139 ++
 libraries/SPI/SPI.h                           |   72 +
 .../BarometricPressureSensor.ino              |  143 ++
 .../DigitalPotControl/DigitalPotControl.ino   |   71 +
 libraries/SPI/keywords.txt                    |   31 +
 libraries/Wire/Wire.cpp                       |  384 ++++
 libraries/Wire/Wire.h                         |  117 ++
 .../SFRRanger_reader/SFRRanger_reader.pde     |   87 +
 .../digital_potentiometer.pde                 |   39 +
 .../examples/master_reader/master_reader.pde  |   32 +
 .../examples/master_writer/master_writer.pde  |   31 +
 .../slave_receiver/slave_receiver.pde         |   38 +
 .../examples/slave_sender/slave_sender.pde    |   32 +
 libraries/Wire/keywords.txt                   |   32 +
 .../build_gcc/libvariant_arduino_zero.mk      |    2 +-
 25 files changed, 1448 insertions(+), 4706 deletions(-)
 create mode 100644 cores/arduino/USART.cpp
 create mode 100644 cores/arduino/USART.h
 delete mode 100644 cores/arduino/build_gcc/libarduino_adk2.mk
 delete mode 100644 cores/arduino/build_gcc/libarduino_arduino_due_u.mk
 delete mode 100644 cores/arduino/build_gcc/libarduino_arduino_due_x.mk
 delete mode 100644 cores/arduino/build_gcc/libarduino_sam3s_ek.mk
 delete mode 100644 cores/arduino/build_gcc/libarduino_sam3u_ek.mk
 delete mode 100644 cores/arduino/build_gcc/libarduino_sam3x_ek.mk
 delete mode 100644 cores/arduino/validation/build_iar/test.ewd
 delete mode 100644 cores/arduino/validation/build_iar/test.ewp
 create mode 100644 libraries/SPI/SPI.cpp
 create mode 100644 libraries/SPI/SPI.h
 create mode 100644 libraries/SPI/examples/BarometricPressureSensor/BarometricPressureSensor.ino
 create mode 100644 libraries/SPI/examples/DigitalPotControl/DigitalPotControl.ino
 create mode 100644 libraries/SPI/keywords.txt
 create mode 100644 libraries/Wire/Wire.cpp
 create mode 100644 libraries/Wire/Wire.h
 create mode 100644 libraries/Wire/examples/SFRRanger_reader/SFRRanger_reader.pde
 create mode 100644 libraries/Wire/examples/digital_potentiometer/digital_potentiometer.pde
 create mode 100644 libraries/Wire/examples/master_reader/master_reader.pde
 create mode 100644 libraries/Wire/examples/master_writer/master_writer.pde
 create mode 100644 libraries/Wire/examples/slave_receiver/slave_receiver.pde
 create mode 100644 libraries/Wire/examples/slave_sender/slave_sender.pde
 create mode 100644 libraries/Wire/keywords.txt

diff --git a/cores/arduino/USART.cpp b/cores/arduino/USART.cpp
new file mode 100644
index 00000000..66b84ced
--- /dev/null
+++ b/cores/arduino/USART.cpp
@@ -0,0 +1,138 @@
+/*
+  Copyright (c) 2011 Arduino.  All right reserved.
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License, or (at your option) any later version.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+  See the GNU Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include "USARTClass.h"
+
+// Constructors ////////////////////////////////////////////////////////////////
+
+USARTClass::USARTClass( SERCOM_USART* pUsart, IRQn_Type dwIrq, uint32_t dwId, RingBuffer* pRx_buffer )
+{
+  _rx_buffer = pRx_buffer ;
+
+  _pUsart=pUsart ;
+  _dwIrq=dwIrq ;
+  _dwId=dwId ;
+}
+
+// Public Methods //////////////////////////////////////////////////////////////
+
+void USARTClass::begin( const uint32_t dwBaudRate )
+{
+  // Configure PMC
+  pmc_enable_periph_clk( _dwId ) ;
+
+  // Disable PDC channel
+  _pUsart->US_PTCR = US_PTCR_RXTDIS | US_PTCR_TXTDIS ;
+
+  // Reset and disable receiver and transmitter
+  _pUsart->US_CR = US_CR_RSTRX | US_CR_RSTTX | US_CR_RXDIS | US_CR_TXDIS ;
+
+  // Configure mode
+  _pUsart->US_MR = US_MR_USART_MODE_NORMAL | US_MR_USCLKS_MCK | US_MR_CHRL_8_BIT | US_MR_PAR_NO |
+                   US_MR_NBSTOP_1_BIT | US_MR_CHMODE_NORMAL;
+
+  // Configure baudrate, asynchronous no oversampling
+  _pUsart->US_BRGR = (SystemCoreClock / dwBaudRate) / 16 ;
+
+  // Configure interrupts
+  _pUsart->US_IDR = 0xFFFFFFFF;
+  _pUsart->US_IER = US_IER_RXRDY | US_IER_OVRE | US_IER_FRAME;
+
+  // Enable UART interrupt in NVIC
+  NVIC_EnableIRQ( _dwIrq ) ;
+
+  // Enable receiver and transmitter
+  _pUsart->US_CR = US_CR_RXEN | US_CR_TXEN ;
+}
+
+void USARTClass::end( void )
+{
+  // clear any received data
+  _rx_buffer->_iHead = _rx_buffer->_iTail ;
+
+  // Disable UART interrupt in NVIC
+  NVIC_DisableIRQ( _dwIrq ) ;
+
+  // Wait for any outstanding data to be sent
+  flush();
+
+  pmc_disable_periph_clk( _dwId ) ;
+}
+
+int USARTClass::available( void )
+{
+  return (uint32_t)(SERIAL_BUFFER_SIZE + _rx_buffer->_iHead - _rx_buffer->_iTail) % SERIAL_BUFFER_SIZE ;
+}
+
+int USARTClass::peek( void )
+{
+  if ( _rx_buffer->_iHead == _rx_buffer->_iTail )
+    return -1 ;
+
+  return _rx_buffer->_aucBuffer[_rx_buffer->_iTail] ;
+}
+
+int USARTClass::read( void )
+{
+  // if the head isn't ahead of the tail, we don't have any characters
+  if ( _rx_buffer->_iHead == _rx_buffer->_iTail )
+    return -1 ;
+
+  uint8_t uc = _rx_buffer->_aucBuffer[_rx_buffer->_iTail] ;
+  _rx_buffer->_iTail = (unsigned int)(_rx_buffer->_iTail + 1) % SERIAL_BUFFER_SIZE ;
+  return uc ;
+}
+
+void USARTClass::flush( void )
+{
+  // Wait for transmission to complete
+  while ((_pUsart->US_CSR & US_CSR_TXRDY) != US_CSR_TXRDY)
+	;
+}
+
+size_t USARTClass::write( const uint8_t uc_data )
+{
+  // Check if the transmitter is ready
+  while ((_pUsart->US_CSR & US_CSR_TXRDY) != US_CSR_TXRDY)
+    ;
+
+  // Send character
+  _pUsart->US_THR = uc_data ;
+  return 1;
+}
+
+void USARTClass::IrqHandler( void )
+{
+  uint32_t status = _pUsart->US_CSR;
+
+  // Did we receive data ?
+  if ((status & US_CSR_RXRDY) == US_CSR_RXRDY)
+    _rx_buffer->store_char( _pUsart->US_RHR ) ;
+
+  // Acknowledge errors
+  if ((status & US_CSR_OVRE) == US_CSR_OVRE ||
+		  (status & US_CSR_FRAME) == US_CSR_FRAME)
+  {
+	// TODO: error reporting outside ISR
+    _pUsart->US_CR |= US_CR_RSTSTA;
+  }
+}
+
diff --git a/cores/arduino/USART.h b/cores/arduino/USART.h
new file mode 100644
index 00000000..863732f9
--- /dev/null
+++ b/cores/arduino/USART.h
@@ -0,0 +1,61 @@
+/*
+  Copyright (c) 2011 Arduino.  All right reserved.
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License, or (at your option) any later version.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+  See the GNU Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+*/
+
+#ifndef _USART_CLASS_
+#define _USART_CLASS_
+
+#include "HardwareSerial.h"
+#include "RingBuffer.h"
+
+// Includes Atmel CMSIS
+#include "sam.h"
+
+class USARTClass : public HardwareSerial
+{
+  protected:
+    RingBuffer *_rx_buffer ;
+
+  protected:
+    Usart* _pUsart ;
+    IRQn_Type _dwIrq ;
+    uint32_t _dwId ;
+
+  public:
+    USARTClass( SERCOM_USART* pUsart, IRQn_Type dwIrq, uint32_t dwId, RingBuffer* pRx_buffer ) ;
+
+    void begin( const uint32_t dwBaudRate ) ;
+    void end( void ) ;
+    int available( void ) ;
+    int peek( void ) ;
+    int read( void ) ;
+    void flush( void ) ;
+    size_t write( const uint8_t c ) ;
+
+    void IrqHandler( void ) ;
+
+#if defined __GNUC__ /* GCC CS3 */
+    using Print::write ; // pull in write(str) and write(buf, size) from Print
+#elif defined __ICCARM__ /* IAR Ewarm 5.41+ */
+//    virtual void write( const char *str ) ;
+//    virtual void write( const uint8_t *buffer, size_t size ) ;
+#endif
+
+    operator bool() { return true; }; // USART always active
+};
+
+#endif // _USART_CLASS_
diff --git a/cores/arduino/build_gcc/libarduino_adk2.mk b/cores/arduino/build_gcc/libarduino_adk2.mk
deleted file mode 100644
index 52088559..00000000
--- a/cores/arduino/build_gcc/libarduino_adk2.mk
+++ /dev/null
@@ -1,183 +0,0 @@
-#
-#  Copyright (c) 2012 Arduino.  All right reserved.
-#
-#  This library is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU Lesser General Public
-#  License as published by the Free Software Foundation; either
-#  version 2.1 of the License, or (at your option) any later version.
-#
-#  This library is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-#  See the GNU Lesser General Public License for more details.
-#
-#  You should have received a copy of the GNU Lesser General Public
-#  License along with this library; if not, write to the Free Software
-#  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-#
-
-# Makefile for compiling libArduino
-.SUFFIXES: .o .a .c .s
-
-CHIP=__SAM3X8E__
-VARIANT=adk2
-LIBNAME=libarduino_$(VARIANT)
-TOOLCHAIN=gcc
-
-#-------------------------------------------------------------------------------
-# Path
-#-------------------------------------------------------------------------------
-
-# Output directories
-OUTPUT_BIN = ..
-
-# Libraries
-PROJECT_BASE_PATH = ..
-PROJECT_BASE_PATH_USB = ../USB
-SYSTEM_PATH = ../../../system
-CMSIS_ROOT_PATH = $(SYSTEM_PATH)/CMSIS
-CMSIS_ARM_PATH=$(CMSIS_ROOT_PATH)/CMSIS/Include
-CMSIS_ATMEL_PATH=$(CMSIS_ROOT_PATH)/Device/ATMEL
-CMSIS_CHIP_PATH=$(CMSIS_ROOT_PATH)/Device/ATMEL/$(CHIP_SERIE)
-VARIANT_PATH = ../../../../../google/sam/variants/$(VARIANT)
-
-#-------------------------------------------------------------------------------
-# Files
-#-------------------------------------------------------------------------------
-
-#vpath %.h $(PROJECT_BASE_PATH) $(PROJECT_BASE_PATH_USB) $(SYSTEM_PATH) $(VARIANT_PATH)
-vpath %.c $(PROJECT_BASE_PATH) $(PROJECT_BASE_PATH_USB) $(VARIANT_PATH)
-vpath %.cpp $(PROJECT_BASE_PATH) $(PROJECT_BASE_PATH_USB)
-
-VPATH+=$(PROJECT_BASE_PATH)
-
-INCLUDES =
-INCLUDES += -I$(PROJECT_BASE_PATH)
-INCLUDES += -I$(PROJECT_BASE_PATH_USB)
-INCLUDES += -I$(VARIANT_PATH)
-INCLUDES += -I$(CMSIS_ARM_PATH)
-INCLUDES += -I$(CMSIS_ATMEL_PATH)
-INCLUDES += -I$(SYSTEM_PATH)
-INCLUDES += -I$(SYSTEM_PATH)/libsam
-
-#-------------------------------------------------------------------------------
-ifdef DEBUG
-include debug.mk
-else
-include release.mk
-endif
-
-#-------------------------------------------------------------------------------
-# Tools
-#-------------------------------------------------------------------------------
-
-include $(TOOLCHAIN).mk
-
-CFLAGS += -DUSB_VID=0x2341 -DUSB_PID=0x003e
-CPPFLAGS += -DUSB_VID=0x2341 -DUSB_PID=0x003e
-
-#-------------------------------------------------------------------------------
-ifdef DEBUG
-OUTPUT_OBJ=debug
-OUTPUT_LIB=$(LIBNAME)_$(TOOLCHAIN)_dbg.a
-else
-OUTPUT_OBJ=release
-OUTPUT_LIB=$(LIBNAME)_$(TOOLCHAIN)_rel.a
-endif
-
-OUTPUT_PATH=$(OUTPUT_OBJ)_$(VARIANT)
-
-#-------------------------------------------------------------------------------
-# C source files and objects
-#-------------------------------------------------------------------------------
-C_SRC=$(wildcard $(PROJECT_BASE_PATH)/*.c $(PROJECT_BASE_PATH_USB)/*.c)
-
-C_OBJ_TEMP = $(patsubst %.c, %.o, $(notdir $(C_SRC)))
-
-# during development, remove some files
-C_OBJ_FILTER=
-
-C_OBJ=$(filter-out $(C_OBJ_FILTER), $(C_OBJ_TEMP))
-
-#-------------------------------------------------------------------------------
-# CPP source files and objects
-#-------------------------------------------------------------------------------
-CPP_SRC=$(wildcard $(PROJECT_BASE_PATH)/*.cpp $(PROJECT_BASE_PATH_USB)/*.cpp)
-
-CPP_OBJ_TEMP = $(patsubst %.cpp, %.o, $(notdir $(CPP_SRC)))
-
-# during development, remove some files
-CPP_OBJ_FILTER=
-
-CPP_OBJ=$(filter-out $(CPP_OBJ_FILTER), $(CPP_OBJ_TEMP))
-
-#-------------------------------------------------------------------------------
-# Assembler source files and objects
-#-------------------------------------------------------------------------------
-A_SRC=$(wildcard $(PROJECT_BASE_PATH)/*.s)
-
-A_OBJ_TEMP=$(patsubst %.s, %.o, $(notdir $(A_SRC)))
-
-# during development, remove some files
-A_OBJ_FILTER=
-
-A_OBJ=$(filter-out $(A_OBJ_FILTER), $(A_OBJ_TEMP))
-
-#-------------------------------------------------------------------------------
-# Rules
-#-------------------------------------------------------------------------------
-all: $(VARIANT)
-
-$(VARIANT): create_output $(OUTPUT_LIB)
-
-.PHONY: create_output
-create_output:
-	@echo ------------------------------------------------------------------------------------
-	@echo --- Preparing $(VARIANT) files in $(OUTPUT_PATH) $(OUTPUT_BIN)
-	@echo ------------------------------------------------------------------------------------
-#	@echo *$(INCLUDES)
-#	@echo -------------------------
-#	@echo *$(C_SRC)
-#	@echo -------------------------
-#	@echo *$(C_OBJ)
-#	@echo -------------------------
-#	@echo *$(addprefix $(OUTPUT_PATH)/, $(C_OBJ))
-#	@echo -------------------------
-#	@echo *$(CPP_SRC)
-#	@echo -------------------------
-#	@echo *$(CPP_OBJ)
-#	@echo -------------------------
-#	@echo *$(addprefix $(OUTPUT_PATH)/, $(CPP_OBJ))
-#	@echo -------------------------
-#	@echo *$(A_SRC)
-#	@echo -------------------------
-
-	-@mkdir $(OUTPUT_PATH) 1>NUL 2>&1
-	@echo ------------------------------------------------------------------------------------
-
-$(addprefix $(OUTPUT_PATH)/,$(C_OBJ)): $(OUTPUT_PATH)/%.o: %.c
-#	"$(CC)" -v -c $(CFLAGS) $< -o $@
-	@"$(CC)" -c $(CFLAGS) $< -o $@
-
-#$(addprefix $(OUTPUT_PATH)/,$(CPP_OBJ)): $(OUTPUT_PATH)/%.d: %.o
-#	"$(CC)" -M -MF $@.d -c $(CPPFLAGS) $<
-
-$(addprefix $(OUTPUT_PATH)/,$(CPP_OBJ)): $(OUTPUT_PATH)/%.o: %.cpp
-#	"$(CC)" -xc++ -c $(CPPFLAGS) $< -o $@
-	@"$(CC)" -xc++ -c $(CPPFLAGS) $< -o $@
-
-$(addprefix $(OUTPUT_PATH)/,$(A_OBJ)): $(OUTPUT_PATH)/%.o: %.s
-	@"$(AS)" -c $(ASFLAGS) $< -o $@
-
-$(OUTPUT_LIB): $(addprefix $(OUTPUT_PATH)/, $(C_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(CPP_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(A_OBJ))
-	@echo ------------------------------------------------------------------------------------
-	@"$(AR)" -r "$(OUTPUT_BIN)/$@" $^
-	@"$(NM)" "$(OUTPUT_BIN)/$@" > "$(OUTPUT_BIN)/$@.txt"
-	@echo ------------------------------------------------------------------------------------
-
-
-.PHONY: clean
-clean:
-	@echo --- Cleaning $(VARIANT) files [$(OUTPUT_PATH)$(SEP)*.o]
-	-@$(RM) $(OUTPUT_PATH) 1>NUL 2>&1
-	-@$(RM) $(OUTPUT_BIN)/$(OUTPUT_LIB) 1>NUL 2>&1
diff --git a/cores/arduino/build_gcc/libarduino_arduino_due_u.mk b/cores/arduino/build_gcc/libarduino_arduino_due_u.mk
deleted file mode 100644
index e610a1b9..00000000
--- a/cores/arduino/build_gcc/libarduino_arduino_due_u.mk
+++ /dev/null
@@ -1,185 +0,0 @@
-#
-#  Copyright (c) 2012 Arduino.  All right reserved.
-#
-#  This library is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU Lesser General Public
-#  License as published by the Free Software Foundation; either
-#  version 2.1 of the License, or (at your option) any later version.
-#
-#  This library is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-#  See the GNU Lesser General Public License for more details.
-#
-#  You should have received a copy of the GNU Lesser General Public
-#  License along with this library; if not, write to the Free Software
-#  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-#
-
-# Makefile for compiling libArduino
-.SUFFIXES: .o .a .c .s
-
-CHIP=__SAM3U4E__
-VARIANT=arduino_due_u
-LIBNAME=libarduino_$(VARIANT)
-TOOLCHAIN=gcc
-
-#-------------------------------------------------------------------------------
-# Path
-#-------------------------------------------------------------------------------
-
-# Output directories
-OUTPUT_BIN = ..
-
-# Libraries
-PROJECT_BASE_PATH = ..
-PROJECT_BASE_PATH_USB = ../USB
-SYSTEM_PATH = ../../../system
-CMSIS_ROOT_PATH = $(SYSTEM_PATH)/CMSIS
-CMSIS_ARM_PATH=$(CMSIS_ROOT_PATH)/CMSIS/Include
-CMSIS_ATMEL_PATH=$(CMSIS_ROOT_PATH)/Device/ATMEL
-CMSIS_CHIP_PATH=$(CMSIS_ROOT_PATH)/Device/ATMEL/$(CHIP_SERIE)
-VARIANT_PATH = ../../../variants/$(VARIANT)
-
-#-------------------------------------------------------------------------------
-# Files
-#-------------------------------------------------------------------------------
-
-#vpath %.h $(PROJECT_BASE_PATH) $(PROJECT_BASE_PATH_USB) $(SYSTEM_PATH) $(VARIANT_PATH)
-vpath %.c $(PROJECT_BASE_PATH) $(PROJECT_BASE_PATH_USB) $(VARIANT_PATH)
-vpath %.cpp $(PROJECT_BASE_PATH) $(PROJECT_BASE_PATH_USB)
-
-VPATH+=$(PROJECT_BASE_PATH)
-
-INCLUDES =
-INCLUDES += -I$(PROJECT_BASE_PATH)
-INCLUDES += -I$(PROJECT_BASE_PATH_USB)
-INCLUDES += -I$(VARIANT_PATH)
-INCLUDES += -I$(CMSIS_ARM_PATH)
-INCLUDES += -I$(CMSIS_ATMEL_PATH)
-INCLUDES += -I$(SYSTEM_PATH)
-INCLUDES += -I$(SYSTEM_PATH)/libsam
-
-#-------------------------------------------------------------------------------
-ifdef DEBUG
-include debug.mk
-else
-include release.mk
-endif
-
-#-------------------------------------------------------------------------------
-# Tools
-#-------------------------------------------------------------------------------
-
-include $(TOOLCHAIN).mk
-
-CFLAGS += -DUSB_VID=0x2341 -DUSB_PID=0x003e
-CPPFLAGS += -DUSB_VID=0x2341 -DUSB_PID=0x003e
-
-#-------------------------------------------------------------------------------
-ifdef DEBUG
-OUTPUT_OBJ=debug
-OUTPUT_LIB=$(LIBNAME)_$(TOOLCHAIN)_dbg.a
-else
-OUTPUT_OBJ=release
-OUTPUT_LIB=$(LIBNAME)_$(TOOLCHAIN)_rel.a
-endif
-
-OUTPUT_PATH=$(OUTPUT_OBJ)_$(VARIANT)
-
-#-------------------------------------------------------------------------------
-# C source files and objects
-#-------------------------------------------------------------------------------
-C_SRC=$(wildcard $(PROJECT_BASE_PATH)/*.c)
-#C_SRC=$(wildcard $(PROJECT_BASE_PATH)/*.c $(PROJECT_BASE_PATH_USB)/*.c)
-
-C_OBJ_TEMP = $(patsubst %.c, %.o, $(notdir $(C_SRC)))
-
-# during development, remove some files
-C_OBJ_FILTER=
-
-C_OBJ=$(filter-out $(C_OBJ_FILTER), $(C_OBJ_TEMP))
-
-#-------------------------------------------------------------------------------
-# CPP source files and objects
-#-------------------------------------------------------------------------------
-CPP_SRC=$(wildcard $(PROJECT_BASE_PATH)/*.cpp)
-#CPP_SRC=$(wildcard $(PROJECT_BASE_PATH)/*.cpp $(PROJECT_BASE_PATH_USB)/*.cpp)
-
-CPP_OBJ_TEMP = $(patsubst %.cpp, %.o, $(notdir $(CPP_SRC)))
-
-# during development, remove some files
-CPP_OBJ_FILTER=
-
-CPP_OBJ=$(filter-out $(CPP_OBJ_FILTER), $(CPP_OBJ_TEMP))
-
-#-------------------------------------------------------------------------------
-# Assembler source files and objects
-#-------------------------------------------------------------------------------
-A_SRC=$(wildcard $(PROJECT_BASE_PATH)/*.s)
-
-A_OBJ_TEMP=$(patsubst %.s, %.o, $(notdir $(A_SRC)))
-
-# during development, remove some files
-A_OBJ_FILTER=
-
-A_OBJ=$(filter-out $(A_OBJ_FILTER), $(A_OBJ_TEMP))
-
-#-------------------------------------------------------------------------------
-# Rules
-#-------------------------------------------------------------------------------
-all: $(VARIANT)
-
-$(VARIANT): create_output $(OUTPUT_LIB)
-
-.PHONY: create_output
-create_output:
-	@echo ------------------------------------------------------------------------------------
-	@echo --- Preparing $(VARIANT) files in $(OUTPUT_PATH) $(OUTPUT_BIN)
-	@echo ------------------------------------------------------------------------------------
-#	@echo *$(INCLUDES)
-#	@echo -------------------------
-#	@echo *$(C_SRC)
-#	@echo -------------------------
-#	@echo *$(C_OBJ)
-#	@echo -------------------------
-#	@echo *$(addprefix $(OUTPUT_PATH)/, $(C_OBJ))
-#	@echo -------------------------
-#	@echo *$(CPP_SRC)
-#	@echo -------------------------
-#	@echo *$(CPP_OBJ)
-#	@echo -------------------------
-#	@echo *$(addprefix $(OUTPUT_PATH)/, $(CPP_OBJ))
-#	@echo -------------------------
-#	@echo *$(A_SRC)
-#	@echo -------------------------
-
-	-@mkdir $(OUTPUT_PATH) 1>NUL 2>&1
-	@echo ------------------------------------------------------------------------------------
-
-$(addprefix $(OUTPUT_PATH)/,$(C_OBJ)): $(OUTPUT_PATH)/%.o: %.c
-#	"$(CC)" -v -c $(CFLAGS) $< -o $@
-	@"$(CC)" -c $(CFLAGS) $< -o $@
-
-#$(addprefix $(OUTPUT_PATH)/,$(CPP_OBJ)): $(OUTPUT_PATH)/%.d: %.o
-#	"$(CC)" -M -MF $@.d -c $(CPPFLAGS) $<
-
-$(addprefix $(OUTPUT_PATH)/,$(CPP_OBJ)): $(OUTPUT_PATH)/%.o: %.cpp
-#	"$(CC)" -xc++ -c $(CPPFLAGS) $< -o $@
-	@"$(CC)" -xc++ -c $(CPPFLAGS) $< -o $@
-
-$(addprefix $(OUTPUT_PATH)/,$(A_OBJ)): $(OUTPUT_PATH)/%.o: %.s
-	@"$(AS)" -c $(ASFLAGS) $< -o $@
-
-$(OUTPUT_LIB): $(addprefix $(OUTPUT_PATH)/, $(C_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(CPP_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(A_OBJ))
-	@echo ------------------------------------------------------------------------------------
-	@"$(AR)" -r "$(OUTPUT_BIN)/$@" $^
-	@"$(NM)" "$(OUTPUT_BIN)/$@" > "$(OUTPUT_BIN)/$@.txt"
-	@echo ------------------------------------------------------------------------------------
-
-
-.PHONY: clean
-clean:
-	@echo --- Cleaning $(VARIANT) files [$(OUTPUT_PATH)$(SEP)*.o]
-	-@$(RM) $(OUTPUT_PATH) 1>NUL 2>&1
-	-@$(RM) $(OUTPUT_BIN)/$(OUTPUT_LIB) 1>NUL 2>&1
diff --git a/cores/arduino/build_gcc/libarduino_arduino_due_x.mk b/cores/arduino/build_gcc/libarduino_arduino_due_x.mk
deleted file mode 100644
index 104eeda0..00000000
--- a/cores/arduino/build_gcc/libarduino_arduino_due_x.mk
+++ /dev/null
@@ -1,185 +0,0 @@
-#
-#  Copyright (c) 2012 Arduino.  All right reserved.
-#
-#  This library is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU Lesser General Public
-#  License as published by the Free Software Foundation; either
-#  version 2.1 of the License, or (at your option) any later version.
-#
-#  This library is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-#  See the GNU Lesser General Public License for more details.
-#
-#  You should have received a copy of the GNU Lesser General Public
-#  License along with this library; if not, write to the Free Software
-#  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-#
-
-# Makefile for compiling libArduino
-.SUFFIXES: .o .a .c .s
-
-CHIP=__SAM3X8E__
-VARIANT=arduino_due_x
-LIBNAME=libarduino_$(VARIANT)
-TOOLCHAIN=gcc
-
-#-------------------------------------------------------------------------------
-# Path
-#-------------------------------------------------------------------------------
-
-# Output directories
-OUTPUT_BIN = ..
-
-# Libraries
-PROJECT_BASE_PATH = ..
-PROJECT_BASE_PATH_USB = ../USB
-PROJECT_BASE_PATH_USB_HOST = ../../../system/USBHost
-SYSTEM_PATH = ../../../system
-CMSIS_ROOT_PATH = $(SYSTEM_PATH)/CMSIS
-CMSIS_ARM_PATH=$(CMSIS_ROOT_PATH)/CMSIS/Include
-CMSIS_ATMEL_PATH=$(CMSIS_ROOT_PATH)/Device/ATMEL
-CMSIS_CHIP_PATH=$(CMSIS_ROOT_PATH)/Device/ATMEL/$(CHIP_SERIE)
-VARIANT_PATH = ../../../variants/$(VARIANT)
-
-#-------------------------------------------------------------------------------
-# Files
-#-------------------------------------------------------------------------------
-
-#vpath %.h $(PROJECT_BASE_PATH) $(PROJECT_BASE_PATH_USB) $(PROJECT_BASE_PATH_USB_HOST) $(SYSTEM_PATH) $(VARIANT_PATH)
-vpath %.c $(PROJECT_BASE_PATH) $(PROJECT_BASE_PATH_USB) $(PROJECT_BASE_PATH_USB_HOST) $(VARIANT_PATH)
-vpath %.cpp $(PROJECT_BASE_PATH) $(PROJECT_BASE_PATH_USB) $(PROJECT_BASE_PATH_USB_HOST)
-
-VPATH+=$(PROJECT_BASE_PATH)
-
-INCLUDES =
-INCLUDES += -I$(PROJECT_BASE_PATH)
-INCLUDES += -I$(PROJECT_BASE_PATH_USB)
-INCLUDES += -I$(PROJECT_BASE_PATH_USB_HOST)
-INCLUDES += -I$(VARIANT_PATH)
-INCLUDES += -I$(CMSIS_ARM_PATH)
-INCLUDES += -I$(CMSIS_ATMEL_PATH)
-INCLUDES += -I$(SYSTEM_PATH)
-INCLUDES += -I$(SYSTEM_PATH)/libsam
-
-#-------------------------------------------------------------------------------
-ifdef DEBUG
-include debug.mk
-else
-include release.mk
-endif
-
-#-------------------------------------------------------------------------------
-# Tools
-#-------------------------------------------------------------------------------
-
-include $(TOOLCHAIN).mk
-
-CFLAGS += -DUSB_VID=0x2341 -DUSB_PID=0x003e
-CPPFLAGS += -DUSB_VID=0x2341 -DUSB_PID=0x003e
-
-#-------------------------------------------------------------------------------
-ifdef DEBUG
-OUTPUT_OBJ=debug
-OUTPUT_LIB=$(LIBNAME)_$(TOOLCHAIN)_dbg.a
-else
-OUTPUT_OBJ=release
-OUTPUT_LIB=$(LIBNAME)_$(TOOLCHAIN)_rel.a
-endif
-
-OUTPUT_PATH=$(OUTPUT_OBJ)_$(VARIANT)
-
-#-------------------------------------------------------------------------------
-# C source files and objects
-#-------------------------------------------------------------------------------
-C_SRC=$(wildcard $(PROJECT_BASE_PATH)/*.c $(PROJECT_BASE_PATH_USB)/*.c $(PROJECT_BASE_PATH_USB_HOST)/*.c)
-
-C_OBJ_TEMP = $(patsubst %.c, %.o, $(notdir $(C_SRC)))
-
-# during development, remove some files
-C_OBJ_FILTER=
-
-C_OBJ=$(filter-out $(C_OBJ_FILTER), $(C_OBJ_TEMP))
-
-#-------------------------------------------------------------------------------
-# CPP source files and objects
-#-------------------------------------------------------------------------------
-CPP_SRC=$(wildcard $(PROJECT_BASE_PATH)/*.cpp $(PROJECT_BASE_PATH_USB)/*.cpp $(PROJECT_BASE_PATH_USB_HOST)/*.cpp)
-
-CPP_OBJ_TEMP = $(patsubst %.cpp, %.o, $(notdir $(CPP_SRC)))
-
-# during development, remove some files
-CPP_OBJ_FILTER=
-
-CPP_OBJ=$(filter-out $(CPP_OBJ_FILTER), $(CPP_OBJ_TEMP))
-
-#-------------------------------------------------------------------------------
-# Assembler source files and objects
-#-------------------------------------------------------------------------------
-A_SRC=$(wildcard $(PROJECT_BASE_PATH)/*.s)
-
-A_OBJ_TEMP=$(patsubst %.s, %.o, $(notdir $(A_SRC)))
-
-# during development, remove some files
-A_OBJ_FILTER=
-
-A_OBJ=$(filter-out $(A_OBJ_FILTER), $(A_OBJ_TEMP))
-
-#-------------------------------------------------------------------------------
-# Rules
-#-------------------------------------------------------------------------------
-all: $(VARIANT)
-
-$(VARIANT): create_output $(OUTPUT_LIB)
-
-.PHONY: create_output
-create_output:
-	@echo ------------------------------------------------------------------------------------
-	@echo --- Preparing $(VARIANT) files in $(OUTPUT_PATH) $(OUTPUT_BIN)
-	@echo ------------------------------------------------------------------------------------
-#	@echo *$(INCLUDES)
-#	@echo -------------------------
-#	@echo *$(C_SRC)
-#	@echo -------------------------
-#	@echo *$(C_OBJ)
-#	@echo -------------------------
-#	@echo *$(addprefix $(OUTPUT_PATH)/, $(C_OBJ))
-#	@echo -------------------------
-#	@echo *$(CPP_SRC)
-#	@echo -------------------------
-#	@echo *$(CPP_OBJ)
-#	@echo -------------------------
-#	@echo *$(addprefix $(OUTPUT_PATH)/, $(CPP_OBJ))
-#	@echo -------------------------
-#	@echo *$(A_SRC)
-#	@echo -------------------------
-
-	-@mkdir $(OUTPUT_PATH) 1>NUL 2>&1
-	@echo ------------------------------------------------------------------------------------
-
-$(addprefix $(OUTPUT_PATH)/,$(C_OBJ)): $(OUTPUT_PATH)/%.o: %.c
-#	"$(CC)" -v -c $(CFLAGS) $< -o $@
-	@"$(CC)" -c $(CFLAGS) $< -o $@
-
-#$(addprefix $(OUTPUT_PATH)/,$(CPP_OBJ)): $(OUTPUT_PATH)/%.d: %.o
-#	"$(CC)" -M -MF $@.d -c $(CPPFLAGS) $<
-
-$(addprefix $(OUTPUT_PATH)/,$(CPP_OBJ)): $(OUTPUT_PATH)/%.o: %.cpp
-#	"$(CC)" -xc++ -c $(CPPFLAGS) $< -o $@
-	@"$(CC)" -xc++ -c $(CPPFLAGS) $< -o $@
-
-$(addprefix $(OUTPUT_PATH)/,$(A_OBJ)): $(OUTPUT_PATH)/%.o: %.s
-	@"$(AS)" -c $(ASFLAGS) $< -o $@
-
-$(OUTPUT_LIB): $(addprefix $(OUTPUT_PATH)/, $(C_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(CPP_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(A_OBJ))
-	@echo ------------------------------------------------------------------------------------
-	@"$(AR)" -r "$(OUTPUT_BIN)/$@" $^
-	@"$(NM)" "$(OUTPUT_BIN)/$@" > "$(OUTPUT_BIN)/$@.txt"
-	@echo ------------------------------------------------------------------------------------
-
-
-.PHONY: clean
-clean:
-	@echo --- Cleaning $(VARIANT) files [$(OUTPUT_PATH)$(SEP)*.o]
-	-@$(RM) $(OUTPUT_PATH) 1>NUL 2>&1
-	-@$(RM) $(OUTPUT_BIN)/$(OUTPUT_LIB) 1>NUL 2>&1
diff --git a/cores/arduino/build_gcc/libarduino_sam3s_ek.mk b/cores/arduino/build_gcc/libarduino_sam3s_ek.mk
deleted file mode 100644
index a8087bf3..00000000
--- a/cores/arduino/build_gcc/libarduino_sam3s_ek.mk
+++ /dev/null
@@ -1,183 +0,0 @@
-#
-#  Copyright (c) 2012 Arduino.  All right reserved.
-#
-#  This library is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU Lesser General Public
-#  License as published by the Free Software Foundation; either
-#  version 2.1 of the License, or (at your option) any later version.
-#
-#  This library is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-#  See the GNU Lesser General Public License for more details.
-#
-#  You should have received a copy of the GNU Lesser General Public
-#  License along with this library; if not, write to the Free Software
-#  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-#
-
-# Makefile for compiling libArduino
-.SUFFIXES: .o .a .c .s
-
-CHIP=__SAM3S4C__
-VARIANT=sam3s_ek
-LIBNAME=libarduino_$(VARIANT)
-TOOLCHAIN=gcc
-
-#-------------------------------------------------------------------------------
-# Path
-#-------------------------------------------------------------------------------
-
-# Output directories
-OUTPUT_BIN = ..
-
-# Libraries
-PROJECT_BASE_PATH = ..
-PROJECT_BASE_PATH_USB = ../USB
-SYSTEM_PATH = ../../../system
-CMSIS_ROOT_PATH = $(SYSTEM_PATH)/CMSIS
-CMSIS_ARM_PATH=$(CMSIS_ROOT_PATH)/CMSIS/Include
-CMSIS_ATMEL_PATH=$(CMSIS_ROOT_PATH)/Device/ATMEL
-CMSIS_CHIP_PATH=$(CMSIS_ROOT_PATH)/Device/ATMEL/$(CHIP_SERIE)
-VARIANT_PATH = ../../../../../atmel/sam/variants/$(VARIANT)
-
-#-------------------------------------------------------------------------------
-# Files
-#-------------------------------------------------------------------------------
-
-#vpath %.h $(PROJECT_BASE_PATH) $(PROJECT_BASE_PATH_USB) $(SYSTEM_PATH) $(VARIANT_PATH)
-vpath %.c $(PROJECT_BASE_PATH) $(PROJECT_BASE_PATH_USB) $(VARIANT_PATH)
-vpath %.cpp $(PROJECT_BASE_PATH) $(PROJECT_BASE_PATH_USB)
-
-VPATH+=$(PROJECT_BASE_PATH)
-
-INCLUDES =
-INCLUDES += -I$(PROJECT_BASE_PATH)
-INCLUDES += -I$(PROJECT_BASE_PATH_USB)
-INCLUDES += -I$(VARIANT_PATH)
-INCLUDES += -I$(CMSIS_ARM_PATH)
-INCLUDES += -I$(CMSIS_ATMEL_PATH)
-INCLUDES += -I$(SYSTEM_PATH)
-INCLUDES += -I$(SYSTEM_PATH)/libsam
-
-#-------------------------------------------------------------------------------
-ifdef DEBUG
-include debug.mk
-else
-include release.mk
-endif
-
-#-------------------------------------------------------------------------------
-# Tools
-#-------------------------------------------------------------------------------
-
-include $(TOOLCHAIN).mk
-
-CFLAGS += -DUSB_VID=0x2341 -DUSB_PID=0xcafe
-CPPFLAGS += -DUSB_VID=0x2341 -DUSB_PID=0xcafe
-
-#-------------------------------------------------------------------------------
-ifdef DEBUG
-OUTPUT_OBJ=debug
-OUTPUT_LIB=$(LIBNAME)_$(TOOLCHAIN)_dbg.a
-else
-OUTPUT_OBJ=release
-OUTPUT_LIB=$(LIBNAME)_$(TOOLCHAIN)_rel.a
-endif
-
-OUTPUT_PATH=$(OUTPUT_OBJ)_$(VARIANT)
-
-#-------------------------------------------------------------------------------
-# C source files and objects
-#-------------------------------------------------------------------------------
-C_SRC=$(wildcard $(PROJECT_BASE_PATH)/*.c $(PROJECT_BASE_PATH_USB)/*.c)
-
-C_OBJ_TEMP = $(patsubst %.c, %.o, $(notdir $(C_SRC)))
-
-# during development, remove some files
-C_OBJ_FILTER=
-
-C_OBJ=$(filter-out $(C_OBJ_FILTER), $(C_OBJ_TEMP))
-
-#-------------------------------------------------------------------------------
-# CPP source files and objects
-#-------------------------------------------------------------------------------
-CPP_SRC=$(wildcard $(PROJECT_BASE_PATH)/*.cpp $(PROJECT_BASE_PATH_USB)/*.cpp)
-
-CPP_OBJ_TEMP = $(patsubst %.cpp, %.o, $(notdir $(CPP_SRC)))
-
-# during development, remove some files
-CPP_OBJ_FILTER=
-
-CPP_OBJ=$(filter-out $(CPP_OBJ_FILTER), $(CPP_OBJ_TEMP))
-
-#-------------------------------------------------------------------------------
-# Assembler source files and objects
-#-------------------------------------------------------------------------------
-A_SRC=$(wildcard $(PROJECT_BASE_PATH)/*.s)
-
-A_OBJ_TEMP=$(patsubst %.s, %.o, $(notdir $(A_SRC)))
-
-# during development, remove some files
-A_OBJ_FILTER=
-
-A_OBJ=$(filter-out $(A_OBJ_FILTER), $(A_OBJ_TEMP))
-
-#-------------------------------------------------------------------------------
-# Rules
-#-------------------------------------------------------------------------------
-all: $(VARIANT)
-
-$(VARIANT): create_output $(OUTPUT_LIB)
-
-.PHONY: create_output
-create_output:
-	@echo ------------------------------------------------------------------------------------
-	@echo --- Preparing $(VARIANT) files in $(OUTPUT_PATH) $(OUTPUT_BIN)
-	@echo ------------------------------------------------------------------------------------
-#	@echo *$(INCLUDES)
-#	@echo -------------------------
-#	@echo *$(C_SRC)
-#	@echo -------------------------
-#	@echo *$(C_OBJ)
-#	@echo -------------------------
-#	@echo *$(addprefix $(OUTPUT_PATH)/, $(C_OBJ))
-#	@echo -------------------------
-#	@echo *$(CPP_SRC)
-#	@echo -------------------------
-#	@echo *$(CPP_OBJ)
-#	@echo -------------------------
-#	@echo *$(addprefix $(OUTPUT_PATH)/, $(CPP_OBJ))
-#	@echo -------------------------
-#	@echo *$(A_SRC)
-#	@echo -------------------------
-
-	-@mkdir $(OUTPUT_PATH) 1>NUL 2>&1
-	@echo ------------------------------------------------------------------------------------
-
-$(addprefix $(OUTPUT_PATH)/,$(C_OBJ)): $(OUTPUT_PATH)/%.o: %.c
-#	"$(CC)" -v -c $(CFLAGS) $< -o $@
-	@"$(CC)" -c $(CFLAGS) $< -o $@
-
-#$(addprefix $(OUTPUT_PATH)/,$(CPP_OBJ)): $(OUTPUT_PATH)/%.d: %.o
-#	"$(CC)" -M -MF $@.d -c $(CPPFLAGS) $<
-
-$(addprefix $(OUTPUT_PATH)/,$(CPP_OBJ)): $(OUTPUT_PATH)/%.o: %.cpp
-#	"$(CC)" -xc++ -c $(CPPFLAGS) $< -o $@
-	@"$(CC)" -xc++ -c $(CPPFLAGS) $< -o $@
-
-$(addprefix $(OUTPUT_PATH)/,$(A_OBJ)): $(OUTPUT_PATH)/%.o: %.s
-	@"$(AS)" -c $(ASFLAGS) $< -o $@
-
-$(OUTPUT_LIB): $(addprefix $(OUTPUT_PATH)/, $(C_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(CPP_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(A_OBJ))
-	@echo ------------------------------------------------------------------------------------
-	@"$(AR)" -r "$(OUTPUT_BIN)/$@" $^
-	@"$(NM)" "$(OUTPUT_BIN)/$@" > "$(OUTPUT_BIN)/$@.txt"
-	@echo ------------------------------------------------------------------------------------
-
-
-.PHONY: clean
-clean:
-	@echo --- Cleaning $(VARIANT) files [$(OUTPUT_PATH)$(SEP)*.o]
-	-@$(RM) $(OUTPUT_PATH) 1>NUL 2>&1
-	-@$(RM) $(OUTPUT_BIN)/$(OUTPUT_LIB) 1>NUL 2>&1
diff --git a/cores/arduino/build_gcc/libarduino_sam3u_ek.mk b/cores/arduino/build_gcc/libarduino_sam3u_ek.mk
deleted file mode 100644
index 766cbc46..00000000
--- a/cores/arduino/build_gcc/libarduino_sam3u_ek.mk
+++ /dev/null
@@ -1,183 +0,0 @@
-#
-#  Copyright (c) 2012 Arduino.  All right reserved.
-#
-#  This library is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU Lesser General Public
-#  License as published by the Free Software Foundation; either
-#  version 2.1 of the License, or (at your option) any later version.
-#
-#  This library is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-#  See the GNU Lesser General Public License for more details.
-#
-#  You should have received a copy of the GNU Lesser General Public
-#  License along with this library; if not, write to the Free Software
-#  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-#
-
-# Makefile for compiling libArduino
-.SUFFIXES: .o .a .c .s
-
-CHIP=__SAM3U4E__
-VARIANT=sam3u_ek
-LIBNAME=libarduino_$(VARIANT)
-TOOLCHAIN=gcc
-
-#-------------------------------------------------------------------------------
-# Path
-#-------------------------------------------------------------------------------
-
-# Output directories
-OUTPUT_BIN = ..
-
-# Libraries
-PROJECT_BASE_PATH = ..
-PROJECT_BASE_PATH_USB = ../USB
-SYSTEM_PATH = ../../../system
-CMSIS_ROOT_PATH = $(SYSTEM_PATH)/CMSIS
-CMSIS_ARM_PATH=$(CMSIS_ROOT_PATH)/CMSIS/Include
-CMSIS_ATMEL_PATH=$(CMSIS_ROOT_PATH)/Device/ATMEL
-CMSIS_CHIP_PATH=$(CMSIS_ROOT_PATH)/Device/ATMEL/$(CHIP_SERIE)
-VARIANT_PATH = ../../../../../atmel/sam/variants/$(VARIANT)
-
-#-------------------------------------------------------------------------------
-# Files
-#-------------------------------------------------------------------------------
-
-vpath %.h $(PROJECT_BASE_PATH) $(PROJECT_BASE_PATH_USB) $(SYSTEM_PATH) $(VARIANT_PATH)
-vpath %.c $(PROJECT_BASE_PATH) $(PROJECT_BASE_PATH_USB) $(VARIANT_PATH)
-vpath %.cpp $(PROJECT_BASE_PATH) $(PROJECT_BASE_PATH_USB)
-
-VPATH+=$(PROJECT_BASE_PATH)
-
-INCLUDES =
-INCLUDES += -I$(PROJECT_BASE_PATH)
-INCLUDES += -I$(PROJECT_BASE_PATH_USB)
-INCLUDES += -I$(VARIANT_PATH)
-INCLUDES += -I$(CMSIS_ARM_PATH)
-INCLUDES += -I$(CMSIS_ATMEL_PATH)
-INCLUDES += -I$(SYSTEM_PATH)
-INCLUDES += -I$(SYSTEM_PATH)/libsam
-
-#-------------------------------------------------------------------------------
-ifdef DEBUG
-include debug.mk
-else
-include release.mk
-endif
-
-#-------------------------------------------------------------------------------
-# Tools
-#-------------------------------------------------------------------------------
-
-include $(TOOLCHAIN).mk
-
-CFLAGS += -DUSB_VID=0x2341 -DUSB_PID=0xcafe
-CPPFLAGS += -DUSB_VID=0x2341 -DUSB_PID=0xcafe
-
-#-------------------------------------------------------------------------------
-ifdef DEBUG
-OUTPUT_OBJ=debug
-OUTPUT_LIB=$(LIBNAME)_$(TOOLCHAIN)_dbg.a
-else
-OUTPUT_OBJ=release
-OUTPUT_LIB=$(LIBNAME)_$(TOOLCHAIN)_rel.a
-endif
-
-OUTPUT_PATH=$(OUTPUT_OBJ)_$(VARIANT)
-
-#-------------------------------------------------------------------------------
-# C source files and objects
-#-------------------------------------------------------------------------------
-C_SRC=$(wildcard $(PROJECT_BASE_PATH)/*.c $(PROJECT_BASE_PATH_USB)/*.c)
-
-C_OBJ_TEMP = $(patsubst %.c, %.o, $(notdir $(C_SRC)))
-
-# during development, remove some files
-C_OBJ_FILTER=
-
-C_OBJ=$(filter-out $(C_OBJ_FILTER), $(C_OBJ_TEMP))
-
-#-------------------------------------------------------------------------------
-# CPP source files and objects
-#-------------------------------------------------------------------------------
-CPP_SRC=$(wildcard $(PROJECT_BASE_PATH)/*.cpp $(PROJECT_BASE_PATH_USB)/*.cpp)
-
-CPP_OBJ_TEMP = $(patsubst %.cpp, %.o, $(notdir $(CPP_SRC)))
-
-# during development, remove some files
-CPP_OBJ_FILTER=
-
-CPP_OBJ=$(filter-out $(CPP_OBJ_FILTER), $(CPP_OBJ_TEMP))
-
-#-------------------------------------------------------------------------------
-# Assembler source files and objects
-#-------------------------------------------------------------------------------
-A_SRC=$(wildcard $(PROJECT_BASE_PATH)/*.s)
-
-A_OBJ_TEMP=$(patsubst %.s, %.o, $(notdir $(A_SRC)))
-
-# during development, remove some files
-A_OBJ_FILTER=
-
-A_OBJ=$(filter-out $(A_OBJ_FILTER), $(A_OBJ_TEMP))
-
-#-------------------------------------------------------------------------------
-# Rules
-#-------------------------------------------------------------------------------
-all: $(VARIANT)
-
-$(VARIANT): create_output $(OUTPUT_LIB)
-
-.PHONY: create_output
-create_output:
-	@echo ------------------------------------------------------------------------------------
-	@echo --- Preparing $(VARIANT) files in $(OUTPUT_PATH) $(OUTPUT_BIN)
-	@echo ------------------------------------------------------------------------------------
-#	@echo *$(INCLUDES)
-#	@echo -------------------------
-#	@echo *$(C_SRC)
-#	@echo -------------------------
-#	@echo *$(C_OBJ)
-#	@echo -------------------------
-#	@echo *$(addprefix $(OUTPUT_PATH)/, $(C_OBJ))
-#	@echo -------------------------
-#	@echo *$(CPP_SRC)
-#	@echo -------------------------
-#	@echo *$(CPP_OBJ)
-#	@echo -------------------------
-#	@echo *$(addprefix $(OUTPUT_PATH)/, $(CPP_OBJ))
-#	@echo -------------------------
-#	@echo *$(A_SRC)
-#	@echo -------------------------
-
-	-@mkdir $(OUTPUT_PATH) 1>NUL 2>&1
-	@echo ------------------------------------------------------------------------------------
-
-$(addprefix $(OUTPUT_PATH)/,$(C_OBJ)): $(OUTPUT_PATH)/%.o: %.c
-#	"$(CC)" -v -c $(CFLAGS) $< -o $@
-	@"$(CC)" -c $(CFLAGS) $< -o $@
-
-#$(addprefix $(OUTPUT_PATH)/,$(CPP_OBJ)): $(OUTPUT_PATH)/%.d: %.o
-#	"$(CC)" -M -MF $@.d -c $(CPPFLAGS) $<
-
-$(addprefix $(OUTPUT_PATH)/,$(CPP_OBJ)): $(OUTPUT_PATH)/%.o: %.cpp
-#	"$(CC)" -xc++ -c $(CPPFLAGS) $< -o $@
-	@"$(CC)" -xc++ -c $(CPPFLAGS) $< -o $@
-
-$(addprefix $(OUTPUT_PATH)/,$(A_OBJ)): $(OUTPUT_PATH)/%.o: %.s
-	@"$(AS)" -c $(ASFLAGS) $< -o $@
-
-$(OUTPUT_LIB): $(addprefix $(OUTPUT_PATH)/, $(C_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(CPP_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(A_OBJ))
-	@echo ------------------------------------------------------------------------------------
-	@"$(AR)" -r "$(OUTPUT_BIN)/$@" $^
-	@"$(NM)" "$(OUTPUT_BIN)/$@" > "$(OUTPUT_BIN)/$@.txt"
-	@echo ------------------------------------------------------------------------------------
-
-
-.PHONY: clean
-clean:
-	@echo --- Cleaning $(VARIANT) files [$(OUTPUT_PATH)$(SEP)*.o]
-	-@$(RM) $(OUTPUT_PATH) 1>NUL 2>&1
-	-@$(RM) $(OUTPUT_BIN)/$(OUTPUT_LIB) 1>NUL 2>&1
diff --git a/cores/arduino/build_gcc/libarduino_sam3x_ek.mk b/cores/arduino/build_gcc/libarduino_sam3x_ek.mk
deleted file mode 100644
index 14b0186a..00000000
--- a/cores/arduino/build_gcc/libarduino_sam3x_ek.mk
+++ /dev/null
@@ -1,183 +0,0 @@
-#
-#  Copyright (c) 2012 Arduino.  All right reserved.
-#
-#  This library is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU Lesser General Public
-#  License as published by the Free Software Foundation; either
-#  version 2.1 of the License, or (at your option) any later version.
-#
-#  This library is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-#  See the GNU Lesser General Public License for more details.
-#
-#  You should have received a copy of the GNU Lesser General Public
-#  License along with this library; if not, write to the Free Software
-#  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-#
-
-# Makefile for compiling libArduino
-.SUFFIXES: .o .a .c .s
-
-CHIP=__SAM3X8H__
-VARIANT=sam3x_ek
-LIBNAME=libarduino_$(VARIANT)
-TOOLCHAIN=gcc
-
-#-------------------------------------------------------------------------------
-# Path
-#-------------------------------------------------------------------------------
-
-# Output directories
-OUTPUT_BIN = ..
-
-# Libraries
-PROJECT_BASE_PATH = ..
-PROJECT_BASE_PATH_USB = ../USB
-SYSTEM_PATH = ../../../system
-CMSIS_ROOT_PATH = $(SYSTEM_PATH)/CMSIS
-CMSIS_ARM_PATH=$(CMSIS_ROOT_PATH)/CMSIS/Include
-CMSIS_ATMEL_PATH=$(CMSIS_ROOT_PATH)/Device/ATMEL
-CMSIS_CHIP_PATH=$(CMSIS_ROOT_PATH)/Device/ATMEL/$(CHIP_SERIE)
-VARIANT_PATH = ../../../../../atmel/sam/variants/$(VARIANT)
-
-#-------------------------------------------------------------------------------
-# Files
-#-------------------------------------------------------------------------------
-
-vpath %.h $(PROJECT_BASE_PATH) $(PROJECT_BASE_PATH_USB) $(SYSTEM_PATH) $(VARIANT_PATH)
-vpath %.c $(PROJECT_BASE_PATH) $(PROJECT_BASE_PATH_USB) $(VARIANT_PATH)
-vpath %.cpp $(PROJECT_BASE_PATH) $(PROJECT_BASE_PATH_USB)
-
-VPATH+=$(PROJECT_BASE_PATH)
-
-INCLUDES =
-INCLUDES += -I$(PROJECT_BASE_PATH)
-INCLUDES += -I$(PROJECT_BASE_PATH_USB)
-INCLUDES += -I$(VARIANT_PATH)
-INCLUDES += -I$(CMSIS_ARM_PATH)
-INCLUDES += -I$(CMSIS_ATMEL_PATH)
-INCLUDES += -I$(SYSTEM_PATH)
-INCLUDES += -I$(SYSTEM_PATH)/libsam
-
-#-------------------------------------------------------------------------------
-ifdef DEBUG
-include debug.mk
-else
-include release.mk
-endif
-
-#-------------------------------------------------------------------------------
-# Tools
-#-------------------------------------------------------------------------------
-
-include $(TOOLCHAIN).mk
-
-CFLAGS += -DUSB_VID=0x2341 -DUSB_PID=0xcafe
-CPPFLAGS += -DUSB_VID=0x2341 -DUSB_PID=0xcafe
-
-#-------------------------------------------------------------------------------
-ifdef DEBUG
-OUTPUT_OBJ=debug
-OUTPUT_LIB=$(LIBNAME)_$(TOOLCHAIN)_dbg.a
-else
-OUTPUT_OBJ=release
-OUTPUT_LIB=$(LIBNAME)_$(TOOLCHAIN)_rel.a
-endif
-
-OUTPUT_PATH=$(OUTPUT_OBJ)_$(VARIANT)
-
-#-------------------------------------------------------------------------------
-# C source files and objects
-#-------------------------------------------------------------------------------
-C_SRC=$(wildcard $(PROJECT_BASE_PATH)/*.c $(PROJECT_BASE_PATH_USB)/*.c)
-
-C_OBJ_TEMP = $(patsubst %.c, %.o, $(notdir $(C_SRC)))
-
-# during development, remove some files
-C_OBJ_FILTER=
-
-C_OBJ=$(filter-out $(C_OBJ_FILTER), $(C_OBJ_TEMP))
-
-#-------------------------------------------------------------------------------
-# CPP source files and objects
-#-------------------------------------------------------------------------------
-CPP_SRC=$(wildcard $(PROJECT_BASE_PATH)/*.cpp $(PROJECT_BASE_PATH_USB)/*.cpp)
-
-CPP_OBJ_TEMP = $(patsubst %.cpp, %.o, $(notdir $(CPP_SRC)))
-
-# during development, remove some files
-CPP_OBJ_FILTER=
-
-CPP_OBJ=$(filter-out $(CPP_OBJ_FILTER), $(CPP_OBJ_TEMP))
-
-#-------------------------------------------------------------------------------
-# Assembler source files and objects
-#-------------------------------------------------------------------------------
-A_SRC=$(wildcard $(PROJECT_BASE_PATH)/*.s)
-
-A_OBJ_TEMP=$(patsubst %.s, %.o, $(notdir $(A_SRC)))
-
-# during development, remove some files
-A_OBJ_FILTER=
-
-A_OBJ=$(filter-out $(A_OBJ_FILTER), $(A_OBJ_TEMP))
-
-#-------------------------------------------------------------------------------
-# Rules
-#-------------------------------------------------------------------------------
-all: $(VARIANT)
-
-$(VARIANT): create_output $(OUTPUT_LIB)
-
-.PHONY: create_output
-create_output:
-	@echo ------------------------------------------------------------------------------------
-	@echo --- Preparing $(VARIANT) files in $(OUTPUT_PATH) $(OUTPUT_BIN)
-	@echo ------------------------------------------------------------------------------------
-#	@echo *$(INCLUDES)
-#	@echo -------------------------
-#	@echo *$(C_SRC)
-#	@echo -------------------------
-#	@echo *$(C_OBJ)
-#	@echo -------------------------
-#	@echo *$(addprefix $(OUTPUT_PATH)/, $(C_OBJ))
-#	@echo -------------------------
-#	@echo *$(CPP_SRC)
-#	@echo -------------------------
-#	@echo *$(CPP_OBJ)
-#	@echo -------------------------
-#	@echo *$(addprefix $(OUTPUT_PATH)/, $(CPP_OBJ))
-#	@echo -------------------------
-#	@echo *$(A_SRC)
-#	@echo -------------------------
-
-	-@mkdir $(OUTPUT_PATH) 1>NUL 2>&1
-	@echo ------------------------------------------------------------------------------------
-
-$(addprefix $(OUTPUT_PATH)/,$(C_OBJ)): $(OUTPUT_PATH)/%.o: %.c
-#	"$(CC)" -v -c $(CFLAGS) $< -o $@
-	@"$(CC)" -c $(CFLAGS) $< -o $@
-
-#$(addprefix $(OUTPUT_PATH)/,$(CPP_OBJ)): $(OUTPUT_PATH)/%.d: %.o
-#	"$(CC)" -M -MF $@.d -c $(CPPFLAGS) $<
-
-$(addprefix $(OUTPUT_PATH)/,$(CPP_OBJ)): $(OUTPUT_PATH)/%.o: %.cpp
-#	"$(CC)" -xc++ -c $(CPPFLAGS) $< -o $@
-	@"$(CC)" -xc++ -c $(CPPFLAGS) $< -o $@
-
-$(addprefix $(OUTPUT_PATH)/,$(A_OBJ)): $(OUTPUT_PATH)/%.o: %.s
-	@"$(AS)" -c $(ASFLAGS) $< -o $@
-
-$(OUTPUT_LIB): $(addprefix $(OUTPUT_PATH)/, $(C_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(CPP_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(A_OBJ))
-	@echo ------------------------------------------------------------------------------------
-	@"$(AR)" -r "$(OUTPUT_BIN)/$@" $^
-	@"$(NM)" "$(OUTPUT_BIN)/$@" > "$(OUTPUT_BIN)/$@.txt"
-	@echo ------------------------------------------------------------------------------------
-
-
-.PHONY: clean
-clean:
-	@echo --- Cleaning $(VARIANT) files [$(OUTPUT_PATH)$(SEP)*.o]
-	-@$(RM) $(OUTPUT_PATH) 1>NUL 2>&1
-	-@$(RM) $(OUTPUT_BIN)/$(OUTPUT_LIB) 1>NUL 2>&1
diff --git a/cores/arduino/validation/build_iar/test.ewd b/cores/arduino/validation/build_iar/test.ewd
deleted file mode 100644
index a8513fb8..00000000
--- a/cores/arduino/validation/build_iar/test.ewd
+++ /dev/null
@@ -1,1769 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-
-<project>
-  <fileVersion>2</fileVersion>
-  <configuration>
-    <name>Debug</name>
-    <toolchain>
-      <name>ARM</name>
-    </toolchain>
-    <debug>1</debug>
-    <settings>
-      <name>C-SPY</name>
-      <archiveVersion>2</archiveVersion>
-      <data>
-        <version>22</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>1</debug>
-        <option>
-          <name>CInput</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CEndian</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CProcessor</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>OCVariant</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>MacOverride</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>MacFile</name>
-          <state>$PROJ_DIR$\..\..\..\..\variants\sam3s_ek\debug_scripts\iar\sam3s_ek_flash.mac</state>
-        </option>
-        <option>
-          <name>MemOverride</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>MemFile</name>
-          <state>$TOOLKIT_DIR$\CONFIG\debugger\Atmel\iosam3s.ddf</state>
-        </option>
-        <option>
-          <name>RunToEnable</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>RunToName</name>
-          <state>main</state>
-        </option>
-        <option>
-          <name>CExtraOptionsCheck</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CExtraOptions</name>
-          <state></state>
-        </option>
-        <option>
-          <name>CFpuProcessor</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>OCDDFArgumentProducer</name>
-          <state></state>
-        </option>
-        <option>
-          <name>OCDownloadSuppressDownload</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OCDownloadVerifyAll</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>OCProductVersion</name>
-          <state>6.21.1.52845</state>
-        </option>
-        <option>
-          <name>OCDynDriverList</name>
-          <state>JLINK_ID</state>
-        </option>
-        <option>
-          <name>OCLastSavedByProductVersion</name>
-          <state>6.21.3.52923</state>
-        </option>
-        <option>
-          <name>OCDownloadAttachToProgram</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>UseFlashLoader</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CLowLevel</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>OCBE8Slave</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>MacFile2</name>
-          <state></state>
-        </option>
-        <option>
-          <name>CDevice</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>FlashLoadersV3</name>
-          <state>$TOOLKIT_DIR$\config\flashloader\Atmel\SAM3S4\sam3s4-flash.board</state>
-        </option>
-        <option>
-          <name>OCImagesSuppressCheck1</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OCImagesPath1</name>
-          <state></state>
-        </option>
-        <option>
-          <name>OCImagesSuppressCheck2</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OCImagesPath2</name>
-          <state></state>
-        </option>
-        <option>
-          <name>OCImagesSuppressCheck3</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OCImagesPath3</name>
-          <state></state>
-        </option>
-        <option>
-          <name>OverrideDefFlashBoard</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OCImagesOffset1</name>
-          <state></state>
-        </option>
-        <option>
-          <name>OCImagesOffset2</name>
-          <state></state>
-        </option>
-        <option>
-          <name>OCImagesOffset3</name>
-          <state></state>
-        </option>
-        <option>
-          <name>OCImagesUse1</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OCImagesUse2</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OCImagesUse3</name>
-          <state>0</state>
-        </option>
-      </data>
-    </settings>
-    <settings>
-      <name>ARMSIM_ID</name>
-      <archiveVersion>2</archiveVersion>
-      <data>
-        <version>1</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>1</debug>
-        <option>
-          <name>OCSimDriverInfo</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>OCSimEnablePSP</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OCSimPspOverrideConfig</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OCSimPspConfigFile</name>
-          <state></state>
-        </option>
-      </data>
-    </settings>
-    <settings>
-      <name>ANGEL_ID</name>
-      <archiveVersion>2</archiveVersion>
-      <data>
-        <version>0</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>1</debug>
-        <option>
-          <name>CCAngelHeartbeat</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CAngelCommunication</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CAngelCommBaud</name>
-          <version>0</version>
-          <state>3</state>
-        </option>
-        <option>
-          <name>CAngelCommPort</name>
-          <version>0</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>ANGELTCPIP</name>
-          <state>aaa.bbb.ccc.ddd</state>
-        </option>
-        <option>
-          <name>DoAngelLogfile</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>AngelLogFile</name>
-          <state>$PROJ_DIR$\cspycomm.log</state>
-        </option>
-        <option>
-          <name>OCDriverInfo</name>
-          <state>1</state>
-        </option>
-      </data>
-    </settings>
-    <settings>
-      <name>GDBSERVER_ID</name>
-      <archiveVersion>2</archiveVersion>
-      <data>
-        <version>0</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>1</debug>
-        <option>
-          <name>OCDriverInfo</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>TCPIP</name>
-          <state>aaa.bbb.ccc.ddd</state>
-        </option>
-        <option>
-          <name>DoLogfile</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>LogFile</name>
-          <state>$PROJ_DIR$\cspycomm.log</state>
-        </option>
-        <option>
-          <name>CCJTagBreakpointRadio</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCJTagDoUpdateBreakpoints</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCJTagUpdateBreakpoints</name>
-          <state>_call_main</state>
-        </option>
-      </data>
-    </settings>
-    <settings>
-      <name>IARROM_ID</name>
-      <archiveVersion>2</archiveVersion>
-      <data>
-        <version>1</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>1</debug>
-        <option>
-          <name>CRomLogFileCheck</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CRomLogFileEditB</name>
-          <state>$PROJ_DIR$\cspycomm.log</state>
-        </option>
-        <option>
-          <name>CRomCommPort</name>
-          <version>0</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CRomCommBaud</name>
-          <version>0</version>
-          <state>7</state>
-        </option>
-        <option>
-          <name>OCDriverInfo</name>
-          <state>1</state>
-        </option>
-      </data>
-    </settings>
-    <settings>
-      <name>JLINK_ID</name>
-      <archiveVersion>2</archiveVersion>
-      <data>
-        <version>13</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>1</debug>
-        <option>
-          <name>JLinkSpeed</name>
-          <state>32</state>
-        </option>
-        <option>
-          <name>CCJLinkDoLogfile</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCJLinkLogFile</name>
-          <state>$PROJ_DIR$\cspycomm.log</state>
-        </option>
-        <option>
-          <name>CCJLinkHWResetDelay</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OCDriverInfo</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>JLinkInitialSpeed</name>
-          <state>32</state>
-        </option>
-        <option>
-          <name>CCDoJlinkMultiTarget</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCScanChainNonARMDevices</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCJLinkMultiTarget</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCJLinkIRLength</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCJLinkCommRadio</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCJLinkTCPIP</name>
-          <state>aaa.bbb.ccc.ddd</state>
-        </option>
-        <option>
-          <name>CCJLinkSpeedRadioV2</name>
-          <state>2</state>
-        </option>
-        <option>
-          <name>CCUSBDevice</name>
-          <version>1</version>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CCRDICatchReset</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCRDICatchUndef</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCRDICatchSWI</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCRDICatchData</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCRDICatchPrefetch</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCRDICatchIRQ</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCRDICatchFIQ</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCJLinkBreakpointRadio</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCJLinkDoUpdateBreakpoints</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCJLinkUpdateBreakpoints</name>
-          <state>_call_main</state>
-        </option>
-        <option>
-          <name>CCJLinkInterfaceRadio</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OCJLinkAttachSlave</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CCJLinkResetList</name>
-          <version>6</version>
-          <state>7</state>
-        </option>
-        <option>
-          <name>CCJLinkInterfaceCmdLine</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCCatchCORERESET</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCCatchMMERR</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCCatchNOCPERR</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCCatchCHRERR</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCCatchSTATERR</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCCatchBUSERR</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCCatchINTERR</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCCatchHARDERR</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCCatchDummy</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OCJLinkScriptFile</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CCJLinkUsbSerialNo</name>
-          <state></state>
-        </option>
-        <option>
-          <name>CCTcpIpAlt</name>
-          <version>0</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCJLinkTcpIpSerialNo</name>
-          <state></state>
-        </option>
-        <option>
-          <name>CCCpuClockEdit</name>
-          <state>72.0</state>
-        </option>
-        <option>
-          <name>CCSwoClockAuto</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCSwoClockEdit</name>
-          <state>2000</state>
-        </option>
-      </data>
-    </settings>
-    <settings>
-      <name>LMIFTDI_ID</name>
-      <archiveVersion>2</archiveVersion>
-      <data>
-        <version>2</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>1</debug>
-        <option>
-          <name>OCDriverInfo</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>LmiftdiSpeed</name>
-          <state>500</state>
-        </option>
-        <option>
-          <name>CCLmiftdiDoLogfile</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCLmiftdiLogFile</name>
-          <state>$PROJ_DIR$\cspycomm.log</state>
-        </option>
-        <option>
-          <name>CCLmiFtdiInterfaceRadio</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCLmiFtdiInterfaceCmdLine</name>
-          <state>0</state>
-        </option>
-      </data>
-    </settings>
-    <settings>
-      <name>MACRAIGOR_ID</name>
-      <archiveVersion>2</archiveVersion>
-      <data>
-        <version>3</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>1</debug>
-        <option>
-          <name>jtag</name>
-          <version>0</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>EmuSpeed</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>TCPIP</name>
-          <state>aaa.bbb.ccc.ddd</state>
-        </option>
-        <option>
-          <name>DoLogfile</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>LogFile</name>
-          <state>$PROJ_DIR$\cspycomm.log</state>
-        </option>
-        <option>
-          <name>DoEmuMultiTarget</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>EmuMultiTarget</name>
-          <state>0@ARM7TDMI</state>
-        </option>
-        <option>
-          <name>EmuHWReset</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CEmuCommBaud</name>
-          <version>0</version>
-          <state>4</state>
-        </option>
-        <option>
-          <name>CEmuCommPort</name>
-          <version>0</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>jtago</name>
-          <version>0</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OCDriverInfo</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>UnusedAddr</name>
-          <state>0x00800000</state>
-        </option>
-        <option>
-          <name>CCMacraigorHWResetDelay</name>
-          <state></state>
-        </option>
-        <option>
-          <name>CCJTagBreakpointRadio</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCJTagDoUpdateBreakpoints</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCJTagUpdateBreakpoints</name>
-          <state>_call_main</state>
-        </option>
-        <option>
-          <name>CCMacraigorInterfaceRadio</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCMacraigorInterfaceCmdLine</name>
-          <state>0</state>
-        </option>
-      </data>
-    </settings>
-    <settings>
-      <name>PEMICRO_ID</name>
-      <archiveVersion>2</archiveVersion>
-      <data>
-        <version>0</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>1</debug>
-        <option>
-          <name>OCDriverInfo</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>OCPEMicroAttachSlave</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CCPEMicroInterfaceList</name>
-          <version>0</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCPEMicroResetDelay</name>
-          <state></state>
-        </option>
-        <option>
-          <name>CCPEMicroJtagSpeed</name>
-          <state>#UNINITIALIZED#</state>
-        </option>
-        <option>
-          <name>CCJPEMicroShowSettings</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>DoLogfile</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>LogFile</name>
-          <state>$PROJ_DIR$\cspycomm.log</state>
-        </option>
-        <option>
-          <name>CCPEMicroUSBDevice</name>
-          <version>0</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCPEMicroSerialPort</name>
-          <version>0</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCJPEMicroTCPIPAutoScanNetwork</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CCPEMicroTCPIP</name>
-          <state>10.0.0.1</state>
-        </option>
-        <option>
-          <name>CCPEMicroCommCmdLineProducer</name>
-          <state>0</state>
-        </option>
-      </data>
-    </settings>
-    <settings>
-      <name>RDI_ID</name>
-      <archiveVersion>2</archiveVersion>
-      <data>
-        <version>2</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>1</debug>
-        <option>
-          <name>CRDIDriverDll</name>
-          <state>###Uninitialized###</state>
-        </option>
-        <option>
-          <name>CRDILogFileCheck</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CRDILogFileEdit</name>
-          <state>$PROJ_DIR$\cspycomm.log</state>
-        </option>
-        <option>
-          <name>CCRDIHWReset</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCRDICatchReset</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCRDICatchUndef</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCRDICatchSWI</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCRDICatchData</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCRDICatchPrefetch</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCRDICatchIRQ</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCRDICatchFIQ</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OCDriverInfo</name>
-          <state>1</state>
-        </option>
-      </data>
-    </settings>
-    <settings>
-      <name>STLINK_ID</name>
-      <archiveVersion>2</archiveVersion>
-      <data>
-        <version>2</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>1</debug>
-        <option>
-          <name>OCDriverInfo</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CCSTLinkInterfaceRadio</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCSTLinkInterfaceCmdLine</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCSTLinkResetList</name>
-          <version>1</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCCpuClockEdit</name>
-          <state>72.0</state>
-        </option>
-        <option>
-          <name>CCSwoClockAuto</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCSwoClockEdit</name>
-          <state>2000</state>
-        </option>
-      </data>
-    </settings>
-    <settings>
-      <name>THIRDPARTY_ID</name>
-      <archiveVersion>2</archiveVersion>
-      <data>
-        <version>0</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>1</debug>
-        <option>
-          <name>CThirdPartyDriverDll</name>
-          <state>###Uninitialized###</state>
-        </option>
-        <option>
-          <name>CThirdPartyLogFileCheck</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CThirdPartyLogFileEditB</name>
-          <state>$PROJ_DIR$\cspycomm.log</state>
-        </option>
-        <option>
-          <name>OCDriverInfo</name>
-          <state>1</state>
-        </option>
-      </data>
-    </settings>
-    <settings>
-      <name>XDS100_ID</name>
-      <archiveVersion>2</archiveVersion>
-      <data>
-        <version>0</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>1</debug>
-        <option>
-          <name>OCDriverInfo</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>OCXDS100AttachSlave</name>
-          <state>1</state>
-        </option>
-      </data>
-    </settings>
-    <debuggerPlugins>
-      <plugin>
-        <file>$TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin</file>
-        <loadFlag>0</loadFlag>
-      </plugin>
-      <plugin>
-        <file>$TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin</file>
-        <loadFlag>0</loadFlag>
-      </plugin>
-      <plugin>
-        <file>$TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin</file>
-        <loadFlag>0</loadFlag>
-      </plugin>
-      <plugin>
-        <file>$TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin</file>
-        <loadFlag>0</loadFlag>
-      </plugin>
-      <plugin>
-        <file>$TOOLKIT_DIR$\plugins\rtos\MQX\MQXRtosPlugin.ewplugin</file>
-        <loadFlag>0</loadFlag>
-      </plugin>
-      <plugin>
-        <file>$TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin</file>
-        <loadFlag>0</loadFlag>
-      </plugin>
-      <plugin>
-        <file>$TOOLKIT_DIR$\plugins\rtos\PowerPac\PowerPacRTOS.ewplugin</file>
-        <loadFlag>0</loadFlag>
-      </plugin>
-      <plugin>
-        <file>$TOOLKIT_DIR$\plugins\rtos\Quadros\Quadros_EWB6_Plugin.ewplugin</file>
-        <loadFlag>0</loadFlag>
-      </plugin>
-      <plugin>
-        <file>$TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin</file>
-        <loadFlag>0</loadFlag>
-      </plugin>
-      <plugin>
-        <file>$TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin</file>
-        <loadFlag>0</loadFlag>
-      </plugin>
-      <plugin>
-        <file>$TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin</file>
-        <loadFlag>0</loadFlag>
-      </plugin>
-      <plugin>
-        <file>$TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin</file>
-        <loadFlag>0</loadFlag>
-      </plugin>
-      <plugin>
-        <file>$EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin</file>
-        <loadFlag>1</loadFlag>
-      </plugin>
-      <plugin>
-        <file>$EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin</file>
-        <loadFlag>0</loadFlag>
-      </plugin>
-      <plugin>
-        <file>$EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin</file>
-        <loadFlag>1</loadFlag>
-      </plugin>
-    </debuggerPlugins>
-  </configuration>
-  <configuration>
-    <name>Release</name>
-    <toolchain>
-      <name>ARM</name>
-    </toolchain>
-    <debug>0</debug>
-    <settings>
-      <name>C-SPY</name>
-      <archiveVersion>2</archiveVersion>
-      <data>
-        <version>22</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>0</debug>
-        <option>
-          <name>CInput</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CEndian</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CProcessor</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>OCVariant</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>MacOverride</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>MacFile</name>
-          <state></state>
-        </option>
-        <option>
-          <name>MemOverride</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>MemFile</name>
-          <state></state>
-        </option>
-        <option>
-          <name>RunToEnable</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>RunToName</name>
-          <state>main</state>
-        </option>
-        <option>
-          <name>CExtraOptionsCheck</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CExtraOptions</name>
-          <state></state>
-        </option>
-        <option>
-          <name>CFpuProcessor</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>OCDDFArgumentProducer</name>
-          <state></state>
-        </option>
-        <option>
-          <name>OCDownloadSuppressDownload</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OCDownloadVerifyAll</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OCProductVersion</name>
-          <state>6.21.1.52845</state>
-        </option>
-        <option>
-          <name>OCDynDriverList</name>
-          <state>ARMSIM_ID</state>
-        </option>
-        <option>
-          <name>OCLastSavedByProductVersion</name>
-          <state></state>
-        </option>
-        <option>
-          <name>OCDownloadAttachToProgram</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>UseFlashLoader</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CLowLevel</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>OCBE8Slave</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>MacFile2</name>
-          <state></state>
-        </option>
-        <option>
-          <name>CDevice</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>FlashLoadersV3</name>
-          <state></state>
-        </option>
-        <option>
-          <name>OCImagesSuppressCheck1</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OCImagesPath1</name>
-          <state></state>
-        </option>
-        <option>
-          <name>OCImagesSuppressCheck2</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OCImagesPath2</name>
-          <state></state>
-        </option>
-        <option>
-          <name>OCImagesSuppressCheck3</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OCImagesPath3</name>
-          <state></state>
-        </option>
-        <option>
-          <name>OverrideDefFlashBoard</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OCImagesOffset1</name>
-          <state></state>
-        </option>
-        <option>
-          <name>OCImagesOffset2</name>
-          <state></state>
-        </option>
-        <option>
-          <name>OCImagesOffset3</name>
-          <state></state>
-        </option>
-        <option>
-          <name>OCImagesUse1</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OCImagesUse2</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OCImagesUse3</name>
-          <state>0</state>
-        </option>
-      </data>
-    </settings>
-    <settings>
-      <name>ARMSIM_ID</name>
-      <archiveVersion>2</archiveVersion>
-      <data>
-        <version>1</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>0</debug>
-        <option>
-          <name>OCSimDriverInfo</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>OCSimEnablePSP</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OCSimPspOverrideConfig</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OCSimPspConfigFile</name>
-          <state></state>
-        </option>
-      </data>
-    </settings>
-    <settings>
-      <name>ANGEL_ID</name>
-      <archiveVersion>2</archiveVersion>
-      <data>
-        <version>0</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>0</debug>
-        <option>
-          <name>CCAngelHeartbeat</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CAngelCommunication</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CAngelCommBaud</name>
-          <version>0</version>
-          <state>3</state>
-        </option>
-        <option>
-          <name>CAngelCommPort</name>
-          <version>0</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>ANGELTCPIP</name>
-          <state>aaa.bbb.ccc.ddd</state>
-        </option>
-        <option>
-          <name>DoAngelLogfile</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>AngelLogFile</name>
-          <state>$PROJ_DIR$\cspycomm.log</state>
-        </option>
-        <option>
-          <name>OCDriverInfo</name>
-          <state>1</state>
-        </option>
-      </data>
-    </settings>
-    <settings>
-      <name>GDBSERVER_ID</name>
-      <archiveVersion>2</archiveVersion>
-      <data>
-        <version>0</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>0</debug>
-        <option>
-          <name>OCDriverInfo</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>TCPIP</name>
-          <state>aaa.bbb.ccc.ddd</state>
-        </option>
-        <option>
-          <name>DoLogfile</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>LogFile</name>
-          <state>$PROJ_DIR$\cspycomm.log</state>
-        </option>
-        <option>
-          <name>CCJTagBreakpointRadio</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCJTagDoUpdateBreakpoints</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCJTagUpdateBreakpoints</name>
-          <state>_call_main</state>
-        </option>
-      </data>
-    </settings>
-    <settings>
-      <name>IARROM_ID</name>
-      <archiveVersion>2</archiveVersion>
-      <data>
-        <version>1</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>0</debug>
-        <option>
-          <name>CRomLogFileCheck</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CRomLogFileEditB</name>
-          <state>$PROJ_DIR$\cspycomm.log</state>
-        </option>
-        <option>
-          <name>CRomCommPort</name>
-          <version>0</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CRomCommBaud</name>
-          <version>0</version>
-          <state>7</state>
-        </option>
-        <option>
-          <name>OCDriverInfo</name>
-          <state>1</state>
-        </option>
-      </data>
-    </settings>
-    <settings>
-      <name>JLINK_ID</name>
-      <archiveVersion>2</archiveVersion>
-      <data>
-        <version>13</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>0</debug>
-        <option>
-          <name>JLinkSpeed</name>
-          <state>32</state>
-        </option>
-        <option>
-          <name>CCJLinkDoLogfile</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCJLinkLogFile</name>
-          <state>$PROJ_DIR$\cspycomm.log</state>
-        </option>
-        <option>
-          <name>CCJLinkHWResetDelay</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OCDriverInfo</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>JLinkInitialSpeed</name>
-          <state>32</state>
-        </option>
-        <option>
-          <name>CCDoJlinkMultiTarget</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCScanChainNonARMDevices</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCJLinkMultiTarget</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCJLinkIRLength</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCJLinkCommRadio</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCJLinkTCPIP</name>
-          <state>aaa.bbb.ccc.ddd</state>
-        </option>
-        <option>
-          <name>CCJLinkSpeedRadioV2</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCUSBDevice</name>
-          <version>1</version>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CCRDICatchReset</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCRDICatchUndef</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCRDICatchSWI</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCRDICatchData</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCRDICatchPrefetch</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCRDICatchIRQ</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCRDICatchFIQ</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCJLinkBreakpointRadio</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCJLinkDoUpdateBreakpoints</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCJLinkUpdateBreakpoints</name>
-          <state>_call_main</state>
-        </option>
-        <option>
-          <name>CCJLinkInterfaceRadio</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OCJLinkAttachSlave</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CCJLinkResetList</name>
-          <version>6</version>
-          <state>5</state>
-        </option>
-        <option>
-          <name>CCJLinkInterfaceCmdLine</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCCatchCORERESET</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCCatchMMERR</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCCatchNOCPERR</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCCatchCHRERR</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCCatchSTATERR</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCCatchBUSERR</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCCatchINTERR</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCCatchHARDERR</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCCatchDummy</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OCJLinkScriptFile</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CCJLinkUsbSerialNo</name>
-          <state></state>
-        </option>
-        <option>
-          <name>CCTcpIpAlt</name>
-          <version>0</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCJLinkTcpIpSerialNo</name>
-          <state></state>
-        </option>
-        <option>
-          <name>CCCpuClockEdit</name>
-          <state>72.0</state>
-        </option>
-        <option>
-          <name>CCSwoClockAuto</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCSwoClockEdit</name>
-          <state>2000</state>
-        </option>
-      </data>
-    </settings>
-    <settings>
-      <name>LMIFTDI_ID</name>
-      <archiveVersion>2</archiveVersion>
-      <data>
-        <version>2</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>0</debug>
-        <option>
-          <name>OCDriverInfo</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>LmiftdiSpeed</name>
-          <state>500</state>
-        </option>
-        <option>
-          <name>CCLmiftdiDoLogfile</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCLmiftdiLogFile</name>
-          <state>$PROJ_DIR$\cspycomm.log</state>
-        </option>
-        <option>
-          <name>CCLmiFtdiInterfaceRadio</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCLmiFtdiInterfaceCmdLine</name>
-          <state>0</state>
-        </option>
-      </data>
-    </settings>
-    <settings>
-      <name>MACRAIGOR_ID</name>
-      <archiveVersion>2</archiveVersion>
-      <data>
-        <version>3</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>0</debug>
-        <option>
-          <name>jtag</name>
-          <version>0</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>EmuSpeed</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>TCPIP</name>
-          <state>aaa.bbb.ccc.ddd</state>
-        </option>
-        <option>
-          <name>DoLogfile</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>LogFile</name>
-          <state>$PROJ_DIR$\cspycomm.log</state>
-        </option>
-        <option>
-          <name>DoEmuMultiTarget</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>EmuMultiTarget</name>
-          <state>0@ARM7TDMI</state>
-        </option>
-        <option>
-          <name>EmuHWReset</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CEmuCommBaud</name>
-          <version>0</version>
-          <state>4</state>
-        </option>
-        <option>
-          <name>CEmuCommPort</name>
-          <version>0</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>jtago</name>
-          <version>0</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OCDriverInfo</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>UnusedAddr</name>
-          <state>0x00800000</state>
-        </option>
-        <option>
-          <name>CCMacraigorHWResetDelay</name>
-          <state></state>
-        </option>
-        <option>
-          <name>CCJTagBreakpointRadio</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCJTagDoUpdateBreakpoints</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCJTagUpdateBreakpoints</name>
-          <state>_call_main</state>
-        </option>
-        <option>
-          <name>CCMacraigorInterfaceRadio</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCMacraigorInterfaceCmdLine</name>
-          <state>0</state>
-        </option>
-      </data>
-    </settings>
-    <settings>
-      <name>PEMICRO_ID</name>
-      <archiveVersion>2</archiveVersion>
-      <data>
-        <version>0</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>0</debug>
-        <option>
-          <name>OCDriverInfo</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>OCPEMicroAttachSlave</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CCPEMicroInterfaceList</name>
-          <version>0</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCPEMicroResetDelay</name>
-          <state></state>
-        </option>
-        <option>
-          <name>CCPEMicroJtagSpeed</name>
-          <state>#UNINITIALIZED#</state>
-        </option>
-        <option>
-          <name>CCJPEMicroShowSettings</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>DoLogfile</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>LogFile</name>
-          <state>$PROJ_DIR$\cspycomm.log</state>
-        </option>
-        <option>
-          <name>CCPEMicroUSBDevice</name>
-          <version>0</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCPEMicroSerialPort</name>
-          <version>0</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCJPEMicroTCPIPAutoScanNetwork</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CCPEMicroTCPIP</name>
-          <state>10.0.0.1</state>
-        </option>
-        <option>
-          <name>CCPEMicroCommCmdLineProducer</name>
-          <state>0</state>
-        </option>
-      </data>
-    </settings>
-    <settings>
-      <name>RDI_ID</name>
-      <archiveVersion>2</archiveVersion>
-      <data>
-        <version>2</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>0</debug>
-        <option>
-          <name>CRDIDriverDll</name>
-          <state>###Uninitialized###</state>
-        </option>
-        <option>
-          <name>CRDILogFileCheck</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CRDILogFileEdit</name>
-          <state>$PROJ_DIR$\cspycomm.log</state>
-        </option>
-        <option>
-          <name>CCRDIHWReset</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCRDICatchReset</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCRDICatchUndef</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCRDICatchSWI</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCRDICatchData</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCRDICatchPrefetch</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCRDICatchIRQ</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCRDICatchFIQ</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OCDriverInfo</name>
-          <state>1</state>
-        </option>
-      </data>
-    </settings>
-    <settings>
-      <name>STLINK_ID</name>
-      <archiveVersion>2</archiveVersion>
-      <data>
-        <version>2</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>0</debug>
-        <option>
-          <name>OCDriverInfo</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CCSTLinkInterfaceRadio</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCSTLinkInterfaceCmdLine</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCSTLinkResetList</name>
-          <version>1</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCCpuClockEdit</name>
-          <state>72.0</state>
-        </option>
-        <option>
-          <name>CCSwoClockAuto</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCSwoClockEdit</name>
-          <state>2000</state>
-        </option>
-      </data>
-    </settings>
-    <settings>
-      <name>THIRDPARTY_ID</name>
-      <archiveVersion>2</archiveVersion>
-      <data>
-        <version>0</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>0</debug>
-        <option>
-          <name>CThirdPartyDriverDll</name>
-          <state>###Uninitialized###</state>
-        </option>
-        <option>
-          <name>CThirdPartyLogFileCheck</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CThirdPartyLogFileEditB</name>
-          <state>$PROJ_DIR$\cspycomm.log</state>
-        </option>
-        <option>
-          <name>OCDriverInfo</name>
-          <state>1</state>
-        </option>
-      </data>
-    </settings>
-    <settings>
-      <name>XDS100_ID</name>
-      <archiveVersion>2</archiveVersion>
-      <data>
-        <version>0</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>0</debug>
-        <option>
-          <name>OCDriverInfo</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>OCXDS100AttachSlave</name>
-          <state>1</state>
-        </option>
-      </data>
-    </settings>
-    <debuggerPlugins>
-      <plugin>
-        <file>$TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin</file>
-        <loadFlag>0</loadFlag>
-      </plugin>
-      <plugin>
-        <file>$TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin</file>
-        <loadFlag>0</loadFlag>
-      </plugin>
-      <plugin>
-        <file>$TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin</file>
-        <loadFlag>0</loadFlag>
-      </plugin>
-      <plugin>
-        <file>$TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin</file>
-        <loadFlag>0</loadFlag>
-      </plugin>
-      <plugin>
-        <file>$TOOLKIT_DIR$\plugins\rtos\MQX\MQXRtosPlugin.ewplugin</file>
-        <loadFlag>0</loadFlag>
-      </plugin>
-      <plugin>
-        <file>$TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin</file>
-        <loadFlag>0</loadFlag>
-      </plugin>
-      <plugin>
-        <file>$TOOLKIT_DIR$\plugins\rtos\PowerPac\PowerPacRTOS.ewplugin</file>
-        <loadFlag>0</loadFlag>
-      </plugin>
-      <plugin>
-        <file>$TOOLKIT_DIR$\plugins\rtos\Quadros\Quadros_EWB6_Plugin.ewplugin</file>
-        <loadFlag>0</loadFlag>
-      </plugin>
-      <plugin>
-        <file>$TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin</file>
-        <loadFlag>0</loadFlag>
-      </plugin>
-      <plugin>
-        <file>$TOOLKIT_DIR$\plugins\rtos\ThreadX\ThreadXArmPlugin.ENU.ewplugin</file>
-        <loadFlag>0</loadFlag>
-      </plugin>
-      <plugin>
-        <file>$TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin</file>
-        <loadFlag>0</loadFlag>
-      </plugin>
-      <plugin>
-        <file>$TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin</file>
-        <loadFlag>0</loadFlag>
-      </plugin>
-      <plugin>
-        <file>$EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin</file>
-        <loadFlag>1</loadFlag>
-      </plugin>
-      <plugin>
-        <file>$EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin</file>
-        <loadFlag>0</loadFlag>
-      </plugin>
-      <plugin>
-        <file>$EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin</file>
-        <loadFlag>1</loadFlag>
-      </plugin>
-    </debuggerPlugins>
-  </configuration>
-</project>
-
-
diff --git a/cores/arduino/validation/build_iar/test.ewp b/cores/arduino/validation/build_iar/test.ewp
deleted file mode 100644
index c22825fb..00000000
--- a/cores/arduino/validation/build_iar/test.ewp
+++ /dev/null
@@ -1,1834 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-
-<project>
-  <fileVersion>2</fileVersion>
-  <configuration>
-    <name>Debug</name>
-    <toolchain>
-      <name>ARM</name>
-    </toolchain>
-    <debug>1</debug>
-    <settings>
-      <name>General</name>
-      <archiveVersion>3</archiveVersion>
-      <data>
-        <version>21</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>1</debug>
-        <option>
-          <name>ExePath</name>
-          <state>Debug\Exe</state>
-        </option>
-        <option>
-          <name>ObjPath</name>
-          <state>Debug\Obj</state>
-        </option>
-        <option>
-          <name>ListPath</name>
-          <state>Debug\List</state>
-        </option>
-        <option>
-          <name>Variant</name>
-          <version>19</version>
-          <state>37</state>
-        </option>
-        <option>
-          <name>GEndianMode</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>Input variant</name>
-          <version>3</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>Input description</name>
-          <state>Automatic choice of formatter.</state>
-        </option>
-        <option>
-          <name>Output variant</name>
-          <version>2</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>Output description</name>
-          <state>Automatic choice of formatter.</state>
-        </option>
-        <option>
-          <name>GOutputBinary</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>FPU</name>
-          <version>2</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OGCoreOrChip</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>GRuntimeLibSelect</name>
-          <version>0</version>
-          <state>1</state>
-        </option>
-        <option>
-          <name>GRuntimeLibSelectSlave</name>
-          <version>0</version>
-          <state>1</state>
-        </option>
-        <option>
-          <name>RTDescription</name>
-          <state>Use the normal configuration of the C/C++ runtime library. No locale interface, C locale, no file descriptor support, no multibytes in printf and scanf, and no hex floats in strtod.</state>
-        </option>
-        <option>
-          <name>OGProductVersion</name>
-          <state>6.21.1.52845</state>
-        </option>
-        <option>
-          <name>OGLastSavedByProductVersion</name>
-          <state>6.21.3.52923</state>
-        </option>
-        <option>
-          <name>GeneralEnableMisra</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>GeneralMisraVerbose</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OGChipSelectEditMenu</name>
-          <state>SAM3S4	Atmel SAM3S4</state>
-        </option>
-        <option>
-          <name>GenLowLevelInterface</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>GEndianModeBE</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>OGBufferedTerminalOutput</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>GenStdoutInterface</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>GeneralMisraRules98</name>
-          <version>0</version>
-          <state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
-        </option>
-        <option>
-          <name>GeneralMisraVer</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>GeneralMisraRules04</name>
-          <version>0</version>
-          <state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
-        </option>
-        <option>
-          <name>RTConfigPath2</name>
-          <state>$TOOLKIT_DIR$\INC\c\DLib_Config_Normal.h</state>
-        </option>
-        <option>
-          <name>GFPUCoreSlave</name>
-          <version>19</version>
-          <state>37</state>
-        </option>
-        <option>
-          <name>GBECoreSlave</name>
-          <version>19</version>
-          <state>37</state>
-        </option>
-        <option>
-          <name>OGUseCmsis</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>OGUseCmsisDspLib</name>
-          <state>0</state>
-        </option>
-      </data>
-    </settings>
-    <settings>
-      <name>ICCARM</name>
-      <archiveVersion>2</archiveVersion>
-      <data>
-        <version>28</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>1</debug>
-        <option>
-          <name>CCDefines</name>
-          <state>__SAM3S4C__</state>
-        </option>
-        <option>
-          <name>CCPreprocFile</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCPreprocComments</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCPreprocLine</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCListCFile</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCListCMnemonics</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCListCMessages</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCListAssFile</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCListAssSource</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCEnableRemarks</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CCDiagSuppress</name>
-          <state></state>
-        </option>
-        <option>
-          <name>CCDiagRemark</name>
-          <state></state>
-        </option>
-        <option>
-          <name>CCDiagWarning</name>
-          <state></state>
-        </option>
-        <option>
-          <name>CCDiagError</name>
-          <state></state>
-        </option>
-        <option>
-          <name>CCObjPrefix</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CCAllowList</name>
-          <version>1</version>
-          <state>0000000</state>
-        </option>
-        <option>
-          <name>CCDebugInfo</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IEndianMode</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IProcessor</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IExtraOptionsCheck</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IExtraOptions</name>
-          <state></state>
-        </option>
-        <option>
-          <name>CCLangConformance</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCSignedPlainChar</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CCRequirePrototypes</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCMultibyteSupport</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCDiagWarnAreErr</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCCompilerRuntimeInfo</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IFpuProcessor</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>OutputFile</name>
-          <state>$FILE_BNAME$.o</state>
-        </option>
-        <option>
-          <name>CCLibConfigHeader</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>PreInclude</name>
-          <state></state>
-        </option>
-        <option>
-          <name>CompilerMisraOverride</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCIncludePath2</name>
-          <state>$PROJ_DIR$\..\..</state>
-          <state>$PROJ_DIR$\..\..\..\..\variants</state>
-          <state>$PROJ_DIR$\..\..\..\..\variants\sam3s_ek</state>
-          <state>$PROJ_DIR$\..\..\..\..\system</state>
-        </option>
-        <option>
-          <name>CCStdIncCheck</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCCodeSection</name>
-          <state>.text</state>
-        </option>
-        <option>
-          <name>IInterwork2</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IProcessorMode2</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CCOptLevel</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CCOptStrategy</name>
-          <version>0</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCOptLevelSlave</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CompilerMisraRules98</name>
-          <version>0</version>
-          <state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
-        </option>
-        <option>
-          <name>CompilerMisraRules04</name>
-          <version>0</version>
-          <state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
-        </option>
-        <option>
-          <name>CCPosIndRopi</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCPosIndRwpi</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCPosIndNoDynInit</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IccLang</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IccCDialect</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IccAllowVLA</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IccCppDialect</name>
-          <state>2</state>
-        </option>
-        <option>
-          <name>IccExceptions</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IccRTTI</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IccStaticDestr</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IccCppInlineSemantics</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IccCmsis</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IccFloatSemantics</name>
-          <state>0</state>
-        </option>
-      </data>
-    </settings>
-    <settings>
-      <name>AARM</name>
-      <archiveVersion>2</archiveVersion>
-      <data>
-        <version>8</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>1</debug>
-        <option>
-          <name>AObjPrefix</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>AEndian</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>ACaseSensitivity</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>MacroChars</name>
-          <version>0</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>AWarnEnable</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>AWarnWhat</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>AWarnOne</name>
-          <state></state>
-        </option>
-        <option>
-          <name>AWarnRange1</name>
-          <state></state>
-        </option>
-        <option>
-          <name>AWarnRange2</name>
-          <state></state>
-        </option>
-        <option>
-          <name>ADebug</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>AltRegisterNames</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>ADefines</name>
-          <state></state>
-        </option>
-        <option>
-          <name>AList</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>AListHeader</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>AListing</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>Includes</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>MacDefs</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>MacExps</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>MacExec</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OnlyAssed</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>MultiLine</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>PageLengthCheck</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>PageLength</name>
-          <state>80</state>
-        </option>
-        <option>
-          <name>TabSpacing</name>
-          <state>8</state>
-        </option>
-        <option>
-          <name>AXRef</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>AXRefDefines</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>AXRefInternal</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>AXRefDual</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>AProcessor</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>AFpuProcessor</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>AOutputFile</name>
-          <state></state>
-        </option>
-        <option>
-          <name>AMultibyteSupport</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>ALimitErrorsCheck</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>ALimitErrorsEdit</name>
-          <state>100</state>
-        </option>
-        <option>
-          <name>AIgnoreStdInclude</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>AUserIncludes</name>
-          <state></state>
-        </option>
-        <option>
-          <name>AExtraOptionsCheckV2</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>AExtraOptionsV2</name>
-          <state></state>
-        </option>
-      </data>
-    </settings>
-    <settings>
-      <name>OBJCOPY</name>
-      <archiveVersion>0</archiveVersion>
-      <data>
-        <version>1</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>1</debug>
-        <option>
-          <name>OOCOutputFormat</name>
-          <version>2</version>
-          <state>2</state>
-        </option>
-        <option>
-          <name>OCOutputOverride</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OOCOutputFile</name>
-          <state>test.bin</state>
-        </option>
-        <option>
-          <name>OOCCommandLineProducer</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>OOCObjCopyEnable</name>
-          <state>1</state>
-        </option>
-      </data>
-    </settings>
-    <settings>
-      <name>CUSTOM</name>
-      <archiveVersion>3</archiveVersion>
-      <data>
-        <extensions></extensions>
-        <cmdline></cmdline>
-      </data>
-    </settings>
-    <settings>
-      <name>BICOMP</name>
-      <archiveVersion>0</archiveVersion>
-      <data/>
-    </settings>
-    <settings>
-      <name>BUILDACTION</name>
-      <archiveVersion>1</archiveVersion>
-      <data>
-        <prebuild></prebuild>
-        <postbuild></postbuild>
-      </data>
-    </settings>
-    <settings>
-      <name>ILINK</name>
-      <archiveVersion>0</archiveVersion>
-      <data>
-        <version>13</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>1</debug>
-        <option>
-          <name>IlinkLibIOConfig</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>XLinkMisraHandler</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkInputFileSlave</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkOutputFile</name>
-          <state>test.out</state>
-        </option>
-        <option>
-          <name>IlinkDebugInfoEnable</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkKeepSymbols</name>
-          <state></state>
-        </option>
-        <option>
-          <name>IlinkRawBinaryFile</name>
-          <state></state>
-        </option>
-        <option>
-          <name>IlinkRawBinarySymbol</name>
-          <state></state>
-        </option>
-        <option>
-          <name>IlinkRawBinarySegment</name>
-          <state></state>
-        </option>
-        <option>
-          <name>IlinkRawBinaryAlign</name>
-          <state></state>
-        </option>
-        <option>
-          <name>IlinkDefines</name>
-          <state></state>
-        </option>
-        <option>
-          <name>IlinkConfigDefines</name>
-          <state></state>
-        </option>
-        <option>
-          <name>IlinkMapFile</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkLogFile</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkLogInitialization</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkLogModule</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkLogSection</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkLogVeneer</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkIcfOverride</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkIcfFile</name>
-          <state>$PROJ_DIR$\..\..\..\..\variants\sam3s_ek\linker_scripts\iar\sam3s_ek_flash.icf</state>
-        </option>
-        <option>
-          <name>IlinkIcfFileSlave</name>
-          <state></state>
-        </option>
-        <option>
-          <name>IlinkEnableRemarks</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkSuppressDiags</name>
-          <state></state>
-        </option>
-        <option>
-          <name>IlinkTreatAsRem</name>
-          <state></state>
-        </option>
-        <option>
-          <name>IlinkTreatAsWarn</name>
-          <state></state>
-        </option>
-        <option>
-          <name>IlinkTreatAsErr</name>
-          <state></state>
-        </option>
-        <option>
-          <name>IlinkWarningsAreErrors</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkUseExtraOptions</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkExtraOptions</name>
-          <state></state>
-        </option>
-        <option>
-          <name>IlinkLowLevelInterfaceSlave</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkAutoLibEnable</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkAdditionalLibs</name>
-          <state></state>
-        </option>
-        <option>
-          <name>IlinkOverrideProgramEntryLabel</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkProgramEntryLabelSelect</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkProgramEntryLabel</name>
-          <state>__iar_program_start</state>
-        </option>
-        <option>
-          <name>DoFill</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>FillerByte</name>
-          <state>0xFF</state>
-        </option>
-        <option>
-          <name>FillerStart</name>
-          <state>0x0</state>
-        </option>
-        <option>
-          <name>FillerEnd</name>
-          <state>0x0</state>
-        </option>
-        <option>
-          <name>CrcSize</name>
-          <version>0</version>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CrcAlign</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CrcAlgo</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CrcPoly</name>
-          <state>0x11021</state>
-        </option>
-        <option>
-          <name>CrcCompl</name>
-          <version>0</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CrcBitOrder</name>
-          <version>0</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CrcInitialValue</name>
-          <state>0x0</state>
-        </option>
-        <option>
-          <name>DoCrc</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkBE8Slave</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkBufferedTerminalOutput</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkStdoutInterfaceSlave</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CrcFullSize</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkIElfToolPostProcess</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkLogAutoLibSelect</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkLogRedirSymbols</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkLogUnusedFragments</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkCrcReverseByteOrder</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkCrcUseAsInput</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkOptInline</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkOptExceptionsAllow</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkOptExceptionsForce</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkCmsis</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkOptMergeDuplSections</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkOptUseVfe</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkOptForceVfe</name>
-          <state>0</state>
-        </option>
-      </data>
-    </settings>
-    <settings>
-      <name>IARCHIVE</name>
-      <archiveVersion>0</archiveVersion>
-      <data>
-        <version>0</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>1</debug>
-        <option>
-          <name>IarchiveInputs</name>
-          <state></state>
-        </option>
-        <option>
-          <name>IarchiveOverride</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IarchiveOutput</name>
-          <state>###Unitialized###</state>
-        </option>
-      </data>
-    </settings>
-    <settings>
-      <name>BILINK</name>
-      <archiveVersion>0</archiveVersion>
-      <data/>
-    </settings>
-  </configuration>
-  <configuration>
-    <name>Release</name>
-    <toolchain>
-      <name>ARM</name>
-    </toolchain>
-    <debug>0</debug>
-    <settings>
-      <name>General</name>
-      <archiveVersion>3</archiveVersion>
-      <data>
-        <version>21</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>0</debug>
-        <option>
-          <name>ExePath</name>
-          <state>Release\Exe</state>
-        </option>
-        <option>
-          <name>ObjPath</name>
-          <state>Release\Obj</state>
-        </option>
-        <option>
-          <name>ListPath</name>
-          <state>Release\List</state>
-        </option>
-        <option>
-          <name>Variant</name>
-          <version>19</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>GEndianMode</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>Input variant</name>
-          <version>3</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>Input description</name>
-          <state></state>
-        </option>
-        <option>
-          <name>Output variant</name>
-          <version>2</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>Output description</name>
-          <state></state>
-        </option>
-        <option>
-          <name>GOutputBinary</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>FPU</name>
-          <version>2</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OGCoreOrChip</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>GRuntimeLibSelect</name>
-          <version>0</version>
-          <state>1</state>
-        </option>
-        <option>
-          <name>GRuntimeLibSelectSlave</name>
-          <version>0</version>
-          <state>1</state>
-        </option>
-        <option>
-          <name>RTDescription</name>
-          <state></state>
-        </option>
-        <option>
-          <name>OGProductVersion</name>
-          <state>6.21.1.52845</state>
-        </option>
-        <option>
-          <name>OGLastSavedByProductVersion</name>
-          <state></state>
-        </option>
-        <option>
-          <name>GeneralEnableMisra</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>GeneralMisraVerbose</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OGChipSelectEditMenu</name>
-          <state></state>
-        </option>
-        <option>
-          <name>GenLowLevelInterface</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>GEndianModeBE</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OGBufferedTerminalOutput</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>GenStdoutInterface</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>GeneralMisraRules98</name>
-          <version>0</version>
-          <state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
-        </option>
-        <option>
-          <name>GeneralMisraVer</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>GeneralMisraRules04</name>
-          <version>0</version>
-          <state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
-        </option>
-        <option>
-          <name>RTConfigPath2</name>
-          <state></state>
-        </option>
-        <option>
-          <name>GFPUCoreSlave</name>
-          <version>19</version>
-          <state>1</state>
-        </option>
-        <option>
-          <name>GBECoreSlave</name>
-          <version>19</version>
-          <state>1</state>
-        </option>
-        <option>
-          <name>OGUseCmsis</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OGUseCmsisDspLib</name>
-          <state>0</state>
-        </option>
-      </data>
-    </settings>
-    <settings>
-      <name>ICCARM</name>
-      <archiveVersion>2</archiveVersion>
-      <data>
-        <version>28</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>0</debug>
-        <option>
-          <name>CCDefines</name>
-          <state>NDEBUG</state>
-        </option>
-        <option>
-          <name>CCPreprocFile</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCPreprocComments</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCPreprocLine</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCListCFile</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCListCMnemonics</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCListCMessages</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCListAssFile</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCListAssSource</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCEnableRemarks</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCDiagSuppress</name>
-          <state></state>
-        </option>
-        <option>
-          <name>CCDiagRemark</name>
-          <state></state>
-        </option>
-        <option>
-          <name>CCDiagWarning</name>
-          <state></state>
-        </option>
-        <option>
-          <name>CCDiagError</name>
-          <state></state>
-        </option>
-        <option>
-          <name>CCObjPrefix</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CCAllowList</name>
-          <version>1</version>
-          <state>1111111</state>
-        </option>
-        <option>
-          <name>CCDebugInfo</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IEndianMode</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IProcessor</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IExtraOptionsCheck</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IExtraOptions</name>
-          <state></state>
-        </option>
-        <option>
-          <name>CCLangConformance</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCSignedPlainChar</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CCRequirePrototypes</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCMultibyteSupport</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCDiagWarnAreErr</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCCompilerRuntimeInfo</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IFpuProcessor</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>OutputFile</name>
-          <state></state>
-        </option>
-        <option>
-          <name>CCLibConfigHeader</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>PreInclude</name>
-          <state></state>
-        </option>
-        <option>
-          <name>CompilerMisraOverride</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCIncludePath2</name>
-          <state></state>
-        </option>
-        <option>
-          <name>CCStdIncCheck</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCCodeSection</name>
-          <state>.text</state>
-        </option>
-        <option>
-          <name>IInterwork2</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IProcessorMode2</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CCOptLevel</name>
-          <state>3</state>
-        </option>
-        <option>
-          <name>CCOptStrategy</name>
-          <version>0</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCOptLevelSlave</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CompilerMisraRules98</name>
-          <version>0</version>
-          <state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
-        </option>
-        <option>
-          <name>CompilerMisraRules04</name>
-          <version>0</version>
-          <state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
-        </option>
-        <option>
-          <name>CCPosIndRopi</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCPosIndRwpi</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CCPosIndNoDynInit</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IccLang</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IccCDialect</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IccAllowVLA</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IccCppDialect</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IccExceptions</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IccRTTI</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IccStaticDestr</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IccCppInlineSemantics</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IccCmsis</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IccFloatSemantics</name>
-          <state>0</state>
-        </option>
-      </data>
-    </settings>
-    <settings>
-      <name>AARM</name>
-      <archiveVersion>2</archiveVersion>
-      <data>
-        <version>8</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>0</debug>
-        <option>
-          <name>AObjPrefix</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>AEndian</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>ACaseSensitivity</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>MacroChars</name>
-          <version>0</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>AWarnEnable</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>AWarnWhat</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>AWarnOne</name>
-          <state></state>
-        </option>
-        <option>
-          <name>AWarnRange1</name>
-          <state></state>
-        </option>
-        <option>
-          <name>AWarnRange2</name>
-          <state></state>
-        </option>
-        <option>
-          <name>ADebug</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>AltRegisterNames</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>ADefines</name>
-          <state></state>
-        </option>
-        <option>
-          <name>AList</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>AListHeader</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>AListing</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>Includes</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>MacDefs</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>MacExps</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>MacExec</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OnlyAssed</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>MultiLine</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>PageLengthCheck</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>PageLength</name>
-          <state>80</state>
-        </option>
-        <option>
-          <name>TabSpacing</name>
-          <state>8</state>
-        </option>
-        <option>
-          <name>AXRef</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>AXRefDefines</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>AXRefInternal</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>AXRefDual</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>AProcessor</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>AFpuProcessor</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>AOutputFile</name>
-          <state></state>
-        </option>
-        <option>
-          <name>AMultibyteSupport</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>ALimitErrorsCheck</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>ALimitErrorsEdit</name>
-          <state>100</state>
-        </option>
-        <option>
-          <name>AIgnoreStdInclude</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>AUserIncludes</name>
-          <state></state>
-        </option>
-        <option>
-          <name>AExtraOptionsCheckV2</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>AExtraOptionsV2</name>
-          <state></state>
-        </option>
-      </data>
-    </settings>
-    <settings>
-      <name>OBJCOPY</name>
-      <archiveVersion>0</archiveVersion>
-      <data>
-        <version>1</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>0</debug>
-        <option>
-          <name>OOCOutputFormat</name>
-          <version>2</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OCOutputOverride</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>OOCOutputFile</name>
-          <state></state>
-        </option>
-        <option>
-          <name>OOCCommandLineProducer</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>OOCObjCopyEnable</name>
-          <state>0</state>
-        </option>
-      </data>
-    </settings>
-    <settings>
-      <name>CUSTOM</name>
-      <archiveVersion>3</archiveVersion>
-      <data>
-        <extensions></extensions>
-        <cmdline></cmdline>
-      </data>
-    </settings>
-    <settings>
-      <name>BICOMP</name>
-      <archiveVersion>0</archiveVersion>
-      <data/>
-    </settings>
-    <settings>
-      <name>BUILDACTION</name>
-      <archiveVersion>1</archiveVersion>
-      <data>
-        <prebuild></prebuild>
-        <postbuild></postbuild>
-      </data>
-    </settings>
-    <settings>
-      <name>ILINK</name>
-      <archiveVersion>0</archiveVersion>
-      <data>
-        <version>13</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>0</debug>
-        <option>
-          <name>IlinkLibIOConfig</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>XLinkMisraHandler</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkInputFileSlave</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkOutputFile</name>
-          <state>###Unitialized###</state>
-        </option>
-        <option>
-          <name>IlinkDebugInfoEnable</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkKeepSymbols</name>
-          <state></state>
-        </option>
-        <option>
-          <name>IlinkRawBinaryFile</name>
-          <state></state>
-        </option>
-        <option>
-          <name>IlinkRawBinarySymbol</name>
-          <state></state>
-        </option>
-        <option>
-          <name>IlinkRawBinarySegment</name>
-          <state></state>
-        </option>
-        <option>
-          <name>IlinkRawBinaryAlign</name>
-          <state></state>
-        </option>
-        <option>
-          <name>IlinkDefines</name>
-          <state></state>
-        </option>
-        <option>
-          <name>IlinkConfigDefines</name>
-          <state></state>
-        </option>
-        <option>
-          <name>IlinkMapFile</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkLogFile</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkLogInitialization</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkLogModule</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkLogSection</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkLogVeneer</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkIcfOverride</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkIcfFile</name>
-          <state>lnk0t.icf</state>
-        </option>
-        <option>
-          <name>IlinkIcfFileSlave</name>
-          <state></state>
-        </option>
-        <option>
-          <name>IlinkEnableRemarks</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkSuppressDiags</name>
-          <state></state>
-        </option>
-        <option>
-          <name>IlinkTreatAsRem</name>
-          <state></state>
-        </option>
-        <option>
-          <name>IlinkTreatAsWarn</name>
-          <state></state>
-        </option>
-        <option>
-          <name>IlinkTreatAsErr</name>
-          <state></state>
-        </option>
-        <option>
-          <name>IlinkWarningsAreErrors</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkUseExtraOptions</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkExtraOptions</name>
-          <state></state>
-        </option>
-        <option>
-          <name>IlinkLowLevelInterfaceSlave</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkAutoLibEnable</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkAdditionalLibs</name>
-          <state></state>
-        </option>
-        <option>
-          <name>IlinkOverrideProgramEntryLabel</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkProgramEntryLabelSelect</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkProgramEntryLabel</name>
-          <state></state>
-        </option>
-        <option>
-          <name>DoFill</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>FillerByte</name>
-          <state>0xFF</state>
-        </option>
-        <option>
-          <name>FillerStart</name>
-          <state>0x0</state>
-        </option>
-        <option>
-          <name>FillerEnd</name>
-          <state>0x0</state>
-        </option>
-        <option>
-          <name>CrcSize</name>
-          <version>0</version>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CrcAlign</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CrcAlgo</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CrcPoly</name>
-          <state>0x11021</state>
-        </option>
-        <option>
-          <name>CrcCompl</name>
-          <version>0</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CrcBitOrder</name>
-          <version>0</version>
-          <state>0</state>
-        </option>
-        <option>
-          <name>CrcInitialValue</name>
-          <state>0x0</state>
-        </option>
-        <option>
-          <name>DoCrc</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkBE8Slave</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkBufferedTerminalOutput</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkStdoutInterfaceSlave</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>CrcFullSize</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkIElfToolPostProcess</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkLogAutoLibSelect</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkLogRedirSymbols</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkLogUnusedFragments</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkCrcReverseByteOrder</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkCrcUseAsInput</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkOptInline</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkOptExceptionsAllow</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkOptExceptionsForce</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkCmsis</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkOptMergeDuplSections</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IlinkOptUseVfe</name>
-          <state>1</state>
-        </option>
-        <option>
-          <name>IlinkOptForceVfe</name>
-          <state>0</state>
-        </option>
-      </data>
-    </settings>
-    <settings>
-      <name>IARCHIVE</name>
-      <archiveVersion>0</archiveVersion>
-      <data>
-        <version>0</version>
-        <wantNonLocal>1</wantNonLocal>
-        <debug>0</debug>
-        <option>
-          <name>IarchiveInputs</name>
-          <state></state>
-        </option>
-        <option>
-          <name>IarchiveOverride</name>
-          <state>0</state>
-        </option>
-        <option>
-          <name>IarchiveOutput</name>
-          <state>###Unitialized###</state>
-        </option>
-      </data>
-    </settings>
-    <settings>
-      <name>BILINK</name>
-      <archiveVersion>0</archiveVersion>
-      <data/>
-    </settings>
-  </configuration>
-  <group>
-    <name>resources</name>
-    <group>
-      <name>arduino_due</name>
-    </group>
-    <group>
-      <name>sam3s_ek</name>
-      <file>
-        <name>$PROJ_DIR$\..\..\..\..\variants\sam3s_ek\linker_scripts\iar\sam3s_ek_flash.icf</name>
-      </file>
-      <file>
-        <name>$PROJ_DIR$\..\..\..\..\variants\sam3s_ek\debug_scripts\iar\sam3s_ek_flash.mac</name>
-      </file>
-      <file>
-        <name>$PROJ_DIR$\..\..\..\..\variants\sam3s_ek\linker_scripts\iar\sam3s_ek_sram.icf</name>
-      </file>
-      <file>
-        <name>$PROJ_DIR$\..\..\..\..\variants\sam3s_ek\debug_scripts\iar\sam3s_ek_sram.mac</name>
-      </file>
-    </group>
-    <group>
-      <name>sam3u_ek</name>
-    </group>
-  </group>
-  <file>
-    <name>$PROJ_DIR$\..\..\libarduino_sam3s_ek_ewarm_dbg.a</name>
-  </file>
-  <file>
-    <name>$PROJ_DIR$\..\..\libsam_sam3s4c_ewarm_dbg.a</name>
-  </file>
-  <file>
-    <name>$PROJ_DIR$\..\..\libvariant_sam3s_ek_ewarm_dbg.a</name>
-  </file>
-  <file>
-    <name>$PROJ_DIR$\..\test.cpp</name>
-  </file>
-</project>
-
-
diff --git a/libraries/SPI/SPI.cpp b/libraries/SPI/SPI.cpp
new file mode 100644
index 00000000..9517e222
--- /dev/null
+++ b/libraries/SPI/SPI.cpp
@@ -0,0 +1,139 @@
+/*
+ * Copyright (c) 2010 by Cristian Maglie <c.maglie@bug.st>
+ * SPI Master library for arduino.
+ *
+ * This file is free software; you can redistribute it and/or modify
+ * it under the terms of either the GNU General Public License version 2
+ * or the GNU Lesser General Public License version 2.1, both as
+ * published by the Free Software Foundation.
+ */
+
+#include "SPI.h"
+
+SPIClass::SPIClass(Spi *_spi, uint32_t _id, void(*_initCb)(void)) :
+	spi(_spi), id(_id), initCb(_initCb), initialized(false)
+{
+	// Empty
+}
+
+void SPIClass::begin() {
+	init();
+
+	// NPCS control is left to the user
+
+	// Default speed set to 4Mhz
+	setClockDivider(BOARD_SPI_DEFAULT_SS, 21);
+	setDataMode(BOARD_SPI_DEFAULT_SS, SPI_MODE0);
+	setBitOrder(BOARD_SPI_DEFAULT_SS, MSBFIRST);
+}
+
+void SPIClass::begin(uint8_t _pin) {
+	init();
+
+	uint32_t spiPin = BOARD_PIN_TO_SPI_PIN(_pin);
+	PIO_Configure(
+		g_APinDescription[spiPin].pPort,
+		g_APinDescription[spiPin].ulPinType,
+		g_APinDescription[spiPin].ulPin,
+		g_APinDescription[spiPin].ulPinConfiguration);
+
+	// Default speed set to 4Mhz
+	setClockDivider(_pin, 21);
+	setDataMode(_pin, SPI_MODE0);
+	setBitOrder(_pin, MSBFIRST);
+}
+
+void SPIClass::init() {
+	if (initialized)
+		return;
+	initCb();
+	SPI_Configure(spi, id, SPI_MR_MSTR | SPI_MR_PS | SPI_MR_MODFDIS);
+	SPI_Enable(spi);
+	initialized = true;
+}
+
+void SPIClass::end(uint8_t _pin) {
+	uint32_t spiPin = BOARD_PIN_TO_SPI_PIN(_pin);
+	// Setting the pin as INPUT will disconnect it from SPI peripheral
+	pinMode(spiPin, INPUT);
+}
+
+void SPIClass::end() {
+	SPI_Disable(spi);
+	initialized = false;
+}
+
+void SPIClass::setBitOrder(uint8_t _pin, BitOrder _bitOrder) {
+	uint32_t ch = BOARD_PIN_TO_SPI_CHANNEL(_pin);
+	bitOrder[ch] = _bitOrder;
+}
+
+void SPIClass::setDataMode(uint8_t _pin, uint8_t _mode) {
+	uint32_t ch = BOARD_PIN_TO_SPI_CHANNEL(_pin);
+	mode[ch] = _mode | SPI_CSR_CSAAT;
+	// SPI_CSR_DLYBCT(1) keeps CS enabled for 32 MCLK after a completed
+	// transfer. Some device needs that for working properly.
+	SPI_ConfigureNPCS(spi, ch, mode[ch] | SPI_CSR_SCBR(divider[ch]) | SPI_CSR_DLYBCT(1));
+}
+
+void SPIClass::setClockDivider(uint8_t _pin, uint8_t _divider) {
+	uint32_t ch = BOARD_PIN_TO_SPI_CHANNEL(_pin);
+	divider[ch] = _divider;
+	// SPI_CSR_DLYBCT(1) keeps CS enabled for 32 MCLK after a completed
+	// transfer. Some device needs that for working properly.
+	SPI_ConfigureNPCS(spi, ch, mode[ch] | SPI_CSR_SCBR(divider[ch]) | SPI_CSR_DLYBCT(1));
+}
+
+byte SPIClass::transfer(byte _pin, uint8_t _data, SPITransferMode _mode) {
+	uint32_t ch = BOARD_PIN_TO_SPI_CHANNEL(_pin);
+	// Reverse bit order
+	if (bitOrder[ch] == LSBFIRST)
+		_data = __REV(__RBIT(_data));
+	uint32_t d = _data | SPI_PCS(ch);
+	if (_mode == SPI_LAST)
+		d |= SPI_TDR_LASTXFER;
+
+	// SPI_Write(spi, _channel, _data);
+    while ((spi->SPI_SR & SPI_SR_TDRE) == 0)
+    	;
+    spi->SPI_TDR = d;
+
+    // return SPI_Read(spi);
+    while ((spi->SPI_SR & SPI_SR_RDRF) == 0)
+    	;
+    d = spi->SPI_RDR;
+	// Reverse bit order
+	if (bitOrder[ch] == LSBFIRST)
+		d = __REV(__RBIT(d));
+    return d & 0xFF;
+}
+
+void SPIClass::attachInterrupt(void) {
+	// Should be enableInterrupt()
+}
+
+void SPIClass::detachInterrupt(void) {
+	// Should be disableInterrupt()
+}
+
+#if SPI_INTERFACES_COUNT > 0
+static void SPI_0_Init(void) {
+	PIO_Configure(
+			g_APinDescription[PIN_SPI_MOSI].pPort,
+			g_APinDescription[PIN_SPI_MOSI].ulPinType,
+			g_APinDescription[PIN_SPI_MOSI].ulPin,
+			g_APinDescription[PIN_SPI_MOSI].ulPinConfiguration);
+	PIO_Configure(
+			g_APinDescription[PIN_SPI_MISO].pPort,
+			g_APinDescription[PIN_SPI_MISO].ulPinType,
+			g_APinDescription[PIN_SPI_MISO].ulPin,
+			g_APinDescription[PIN_SPI_MISO].ulPinConfiguration);
+	PIO_Configure(
+			g_APinDescription[PIN_SPI_SCK].pPort,
+			g_APinDescription[PIN_SPI_SCK].ulPinType,
+			g_APinDescription[PIN_SPI_SCK].ulPin,
+			g_APinDescription[PIN_SPI_SCK].ulPinConfiguration);
+}
+
+SPIClass SPI(SPI_INTERFACE, SPI_INTERFACE_ID, SPI_0_Init);
+#endif
diff --git a/libraries/SPI/SPI.h b/libraries/SPI/SPI.h
new file mode 100644
index 00000000..735bd4bf
--- /dev/null
+++ b/libraries/SPI/SPI.h
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2010 by Cristian Maglie <c.maglie@bug.st>
+ * SPI Master library for arduino.
+ *
+ * This file is free software; you can redistribute it and/or modify
+ * it under the terms of either the GNU General Public License version 2
+ * or the GNU Lesser General Public License version 2.1, both as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef _SPI_H_INCLUDED
+#define _SPI_H_INCLUDED
+
+#include "variant.h"
+#include <stdio.h>
+
+#define SPI_MODE0 0x02
+#define SPI_MODE1 0x00
+#define SPI_MODE2 0x03
+#define SPI_MODE3 0x01
+
+enum SPITransferMode {
+	SPI_CONTINUE,
+	SPI_LAST
+};
+
+class SPIClass {
+  public:
+	SPIClass(Spi *_spi, uint32_t _id, void(*_initCb)(void));
+
+	byte transfer(uint8_t _data, SPITransferMode _mode = SPI_LAST) { return transfer(BOARD_SPI_DEFAULT_SS, _data, _mode); }
+	byte transfer(byte _channel, uint8_t _data, SPITransferMode _mode = SPI_LAST);
+
+	// SPI Configuration methods
+
+	void attachInterrupt(void);
+	void detachInterrupt(void);
+
+	void begin(void);
+	void end(void);
+
+	// Attach/Detach pin to/from SPI controller
+	void begin(uint8_t _pin);
+	void end(uint8_t _pin);
+
+	// These methods sets a parameter on a single pin
+	void setBitOrder(uint8_t _pin, BitOrder);
+	void setDataMode(uint8_t _pin, uint8_t);
+	void setClockDivider(uint8_t _pin, uint8_t);
+
+	// These methods sets the same parameters but on default pin BOARD_SPI_DEFAULT_SS
+	void setBitOrder(BitOrder _order) { setBitOrder(BOARD_SPI_DEFAULT_SS, _order); };
+	void setDataMode(uint8_t _mode) { setDataMode(BOARD_SPI_DEFAULT_SS, _mode); };
+	void setClockDivider(uint8_t _div) { setClockDivider(BOARD_SPI_DEFAULT_SS, _div); };
+
+  private:
+	void init();
+
+	Spi *spi;
+	uint32_t id;
+	BitOrder bitOrder[SPI_CHANNELS_NUM];
+	uint32_t divider[SPI_CHANNELS_NUM];
+	uint32_t mode[SPI_CHANNELS_NUM];
+	void (*initCb)(void);
+	bool initialized;
+};
+
+#if SPI_INTERFACES_COUNT > 0
+extern SPIClass SPI;
+#endif
+
+#endif
diff --git a/libraries/SPI/examples/BarometricPressureSensor/BarometricPressureSensor.ino b/libraries/SPI/examples/BarometricPressureSensor/BarometricPressureSensor.ino
new file mode 100644
index 00000000..8104fcbc
--- /dev/null
+++ b/libraries/SPI/examples/BarometricPressureSensor/BarometricPressureSensor.ino
@@ -0,0 +1,143 @@
+/*
+ SCP1000 Barometric Pressure Sensor Display
+
+ Shows the output of a Barometric Pressure Sensor on a
+ Uses the SPI library. For details on the sensor, see:
+ http://www.sparkfun.com/commerce/product_info.php?products_id=8161
+ http://www.vti.fi/en/support/obsolete_products/pressure_sensors/
+
+ This sketch adapted from Nathan Seidle's SCP1000 example for PIC:
+ http://www.sparkfun.com/datasheets/Sensors/SCP1000-Testing.zip
+
+ Circuit:
+ SCP1000 sensor attached to pins 6, 7, 10 - 13:
+ DRDY: pin 6
+ CSB: pin 7
+ MOSI: pin 11
+ MISO: pin 12
+ SCK: pin 13
+
+ created 31 July 2010
+ modified 14 August 2010
+ by Tom Igoe
+ */
+
+// the sensor communicates using SPI, so include the library:
+#include <SPI.h>
+
+//Sensor's memory register addresses:
+const int PRESSURE = 0x1F;      //3 most significant bits of pressure
+const int PRESSURE_LSB = 0x20;  //16 least significant bits of pressure
+const int TEMPERATURE = 0x21;   //16 bit temperature reading
+const byte READ = 0b11111100;     // SCP1000's read command
+const byte WRITE = 0b00000010;   // SCP1000's write command
+
+// pins used for the connection with the sensor
+// the other you need are controlled by the SPI library):
+const int dataReadyPin = 6;
+const int chipSelectPin = 7;
+
+void setup() {
+  Serial.begin(9600);
+
+  // start the SPI library:
+  SPI.begin();
+
+  // initalize the  data ready and chip select pins:
+  pinMode(dataReadyPin, INPUT);
+  pinMode(chipSelectPin, OUTPUT);
+
+  //Configure SCP1000 for low noise configuration:
+  writeRegister(0x02, 0x2D);
+  writeRegister(0x01, 0x03);
+  writeRegister(0x03, 0x02);
+  // give the sensor time to set up:
+  delay(100);
+}
+
+void loop() {
+  //Select High Resolution Mode
+  writeRegister(0x03, 0x0A);
+
+  // don't do anything until the data ready pin is high:
+  if (digitalRead(dataReadyPin) == HIGH) {
+    //Read the temperature data
+    int tempData = readRegister(0x21, 2);
+
+    // convert the temperature to celsius and display it:
+    float realTemp = (float)tempData / 20.0;
+    Serial.print("Temp[C]=");
+    Serial.print(realTemp);
+
+
+    //Read the pressure data highest 3 bits:
+    byte  pressure_data_high = readRegister(0x1F, 1);
+    pressure_data_high &= 0b00000111; //you only needs bits 2 to 0
+
+    //Read the pressure data lower 16 bits:
+    unsigned int pressure_data_low = readRegister(0x20, 2);
+    //combine the two parts into one 19-bit number:
+    long pressure = ((pressure_data_high << 16) | pressure_data_low) / 4;
+
+    // display the temperature:
+    Serial.println("\tPressure [Pa]=" + String(pressure));
+  }
+}
+
+//Read from or write to register from the SCP1000:
+unsigned int readRegister(byte thisRegister, int bytesToRead ) {
+  byte inByte = 0;           // incoming byte from the SPI
+  unsigned int result = 0;   // result to return
+  Serial.print(thisRegister, BIN);
+  Serial.print("\t");
+  // SCP1000 expects the register name in the upper 6 bits
+  // of the byte. So shift the bits left by two bits:
+  thisRegister = thisRegister << 2;
+  // now combine the address and the command into one byte
+  byte dataToSend = thisRegister & READ;
+  Serial.println(thisRegister, BIN);
+  // take the chip select low to select the device:
+  digitalWrite(chipSelectPin, LOW);
+  // send the device the register you want to read:
+  SPI.transfer(dataToSend);
+  // send a value of 0 to read the first byte returned:
+  result = SPI.transfer(0x00);
+  // decrement the number of bytes left to read:
+  bytesToRead--;
+  // if you still have another byte to read:
+  if (bytesToRead > 0) {
+    // shift the first byte left, then get the second byte:
+    result = result << 8;
+    inByte = SPI.transfer(0x00);
+    // combine the byte you just got with the previous one:
+    result = result | inByte;
+    // decrement the number of bytes left to read:
+    bytesToRead--;
+  }
+  // take the chip select high to de-select:
+  digitalWrite(chipSelectPin, HIGH);
+  // return the result:
+  return(result);
+}
+
+
+//Sends a write command to SCP1000
+
+void writeRegister(byte thisRegister, byte thisValue) {
+
+  // SCP1000 expects the register address in the upper 6 bits
+  // of the byte. So shift the bits left by two bits:
+  thisRegister = thisRegister << 2;
+  // now combine the register address and the command into one byte:
+  byte dataToSend = thisRegister | WRITE;
+
+  // take the chip select low to select the device:
+  digitalWrite(chipSelectPin, LOW);
+
+  SPI.transfer(dataToSend); //Send register location
+  SPI.transfer(thisValue);  //Send value to record into register
+
+  // take the chip select high to de-select:
+  digitalWrite(chipSelectPin, HIGH);
+}
+
diff --git a/libraries/SPI/examples/DigitalPotControl/DigitalPotControl.ino b/libraries/SPI/examples/DigitalPotControl/DigitalPotControl.ino
new file mode 100644
index 00000000..b135a74f
--- /dev/null
+++ b/libraries/SPI/examples/DigitalPotControl/DigitalPotControl.ino
@@ -0,0 +1,71 @@
+/*
+  Digital Pot Control
+
+  This example controls an Analog Devices AD5206 digital potentiometer.
+  The AD5206 has 6 potentiometer channels. Each channel's pins are labeled
+  A - connect this to voltage
+  W - this is the pot's wiper, which changes when you set it
+  B - connect this to ground.
+
+ The AD5206 is SPI-compatible,and to command it, you send two bytes,
+ one with the channel number (0 - 5) and one with the resistance value for the
+ channel (0 - 255).
+
+ The circuit:
+  * All A pins  of AD5206 connected to +5V
+  * All B pins of AD5206 connected to ground
+  * An LED and a 220-ohm resisor in series connected from each W pin to ground
+  * CS - to digital pin 10  (SS pin)
+  * SDI - to digital pin 11 (MOSI pin)
+  * CLK - to digital pin 13 (SCK pin)
+
+ created 10 Aug 2010
+ by Tom Igoe
+
+ Thanks to Heather Dewey-Hagborg for the original tutorial, 2005
+
+*/
+
+
+// inslude the SPI library:
+#include <SPI.h>
+
+
+// set pin 10 as the slave select for the digital pot:
+const int slaveSelectPin = 10;
+
+void setup() {
+  // set the slaveSelectPin as an output:
+  pinMode (slaveSelectPin, OUTPUT);
+  // initialize SPI:
+  SPI.begin();
+}
+
+void loop() {
+  // go through the six channels of the digital pot:
+  for (int channel = 0; channel < 6; channel++) {
+    // change the resistance on this channel from min to max:
+    for (int level = 0; level < 255; level++) {
+      digitalPotWrite(channel, level);
+      delay(10);
+    }
+    // wait a second at the top:
+    delay(100);
+    // change the resistance on this channel from max to min:
+    for (int level = 0; level < 255; level++) {
+      digitalPotWrite(channel, 255 - level);
+      delay(10);
+    }
+  }
+
+}
+
+void digitalPotWrite(int address, int value) {
+  // take the SS pin low to select the chip:
+  digitalWrite(slaveSelectPin, LOW);
+  //  send in the address and value via SPI:
+  SPI.transfer(address);
+  SPI.transfer(value);
+  // take the SS pin high to de-select the chip:
+  digitalWrite(slaveSelectPin, HIGH);
+}
diff --git a/libraries/SPI/keywords.txt b/libraries/SPI/keywords.txt
new file mode 100644
index 00000000..47738f9f
--- /dev/null
+++ b/libraries/SPI/keywords.txt
@@ -0,0 +1,31 @@
+#######################################
+# Syntax Coloring Map SPI
+#######################################
+
+#######################################
+# Datatypes (KEYWORD1)
+#######################################
+
+SPI	KEYWORD1
+
+#######################################
+# Methods and Functions (KEYWORD2)
+#######################################
+begin			KEYWORD2
+end				KEYWORD2
+transfer		KEYWORD2
+#setBitOrder	KEYWORD2
+setDataMode		KEYWORD2
+setClockDivider	KEYWORD2
+
+
+#######################################
+# Constants (LITERAL1)
+#######################################
+SPI_MODE0		LITERAL1
+SPI_MODE1		LITERAL1
+SPI_MODE2		LITERAL1
+SPI_MODE3		LITERAL1
+
+SPI_CONTINUE	LITERAL1
+SPI_LAST		LITERAL1
diff --git a/libraries/Wire/Wire.cpp b/libraries/Wire/Wire.cpp
new file mode 100644
index 00000000..cbf46db9
--- /dev/null
+++ b/libraries/Wire/Wire.cpp
@@ -0,0 +1,384 @@
+/*
+ * TwoWire.h - TWI/I2C library for Arduino Due
+ * Copyright (c) 2011 Cristian Maglie <c.maglie@bug.st>.
+ * All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+extern "C" {
+#include <string.h>
+}
+
+#include "Wire.h"
+
+static inline bool TWI_FailedAcknowledge(Twi *pTwi) {
+	return pTwi->TWI_SR & TWI_SR_NACK;
+}
+
+static inline bool TWI_WaitTransferComplete(Twi *_twi, uint32_t _timeout) {
+	while (!TWI_TransferComplete(_twi)) {
+		if (TWI_FailedAcknowledge(_twi))
+			return false;
+		if (--_timeout == 0)
+			return false;
+	}
+	return true;
+}
+
+static inline bool TWI_WaitByteSent(Twi *_twi, uint32_t _timeout) {
+	while (!TWI_ByteSent(_twi)) {
+		if (TWI_FailedAcknowledge(_twi))
+			return false;
+		if (--_timeout == 0)
+			return false;
+	}
+	return true;
+}
+
+static inline bool TWI_WaitByteReceived(Twi *_twi, uint32_t _timeout) {
+	while (!TWI_ByteReceived(_twi)) {
+		if (TWI_FailedAcknowledge(_twi))
+			return false;
+		if (--_timeout == 0)
+			return false;
+	}
+	return true;
+}
+
+static inline bool TWI_STATUS_SVREAD(uint32_t status) {
+	return (status & TWI_SR_SVREAD) == TWI_SR_SVREAD;
+}
+
+static inline bool TWI_STATUS_SVACC(uint32_t status) {
+	return (status & TWI_SR_SVACC) == TWI_SR_SVACC;
+}
+
+static inline bool TWI_STATUS_GACC(uint32_t status) {
+	return (status & TWI_SR_GACC) == TWI_SR_GACC;
+}
+
+static inline bool TWI_STATUS_EOSACC(uint32_t status) {
+	return (status & TWI_SR_EOSACC) == TWI_SR_EOSACC;
+}
+
+static inline bool TWI_STATUS_NACK(uint32_t status) {
+	return (status & TWI_SR_NACK) == TWI_SR_NACK;
+}
+
+TwoWire::TwoWire(Twi *_twi, void(*_beginCb)(void)) :
+	twi(_twi), rxBufferIndex(0), rxBufferLength(0), txAddress(0),
+			txBufferLength(0), srvBufferIndex(0), srvBufferLength(0), status(
+					UNINITIALIZED), onBeginCallback(_beginCb) {
+	// Empty
+}
+
+void TwoWire::begin(void) {
+	if (onBeginCallback)
+		onBeginCallback();
+
+	// Disable PDC channel
+	twi->TWI_PTCR = UART_PTCR_RXTDIS | UART_PTCR_TXTDIS;
+
+	TWI_ConfigureMaster(twi, TWI_CLOCK, VARIANT_MCK);
+	status = MASTER_IDLE;
+}
+
+void TwoWire::begin(uint8_t address) {
+	if (onBeginCallback)
+		onBeginCallback();
+
+	// Disable PDC channel
+	twi->TWI_PTCR = UART_PTCR_RXTDIS | UART_PTCR_TXTDIS;
+
+	TWI_ConfigureSlave(twi, address);
+	status = SLAVE_IDLE;
+	TWI_EnableIt(twi, TWI_IER_SVACC);
+	//| TWI_IER_RXRDY | TWI_IER_TXRDY	| TWI_IER_TXCOMP);
+}
+
+void TwoWire::begin(int address) {
+	begin((uint8_t) address);
+}
+
+uint8_t TwoWire::requestFrom(uint8_t address, uint8_t quantity, uint8_t sendStop) {
+	if (quantity > BUFFER_LENGTH)
+		quantity = BUFFER_LENGTH;
+
+	// perform blocking read into buffer
+	int readed = 0;
+	TWI_StartRead(twi, address, 0, 0);
+	do {
+		// Stop condition must be set during the reception of last byte
+		if (readed + 1 == quantity)
+			TWI_SendSTOPCondition( twi);
+
+		TWI_WaitByteReceived(twi, RECV_TIMEOUT);
+		rxBuffer[readed++] = TWI_ReadByte(twi);
+	} while (readed < quantity);
+	TWI_WaitTransferComplete(twi, RECV_TIMEOUT);
+
+	// set rx buffer iterator vars
+	rxBufferIndex = 0;
+	rxBufferLength = readed;
+
+	return readed;
+}
+
+uint8_t TwoWire::requestFrom(uint8_t address, uint8_t quantity) {
+	return requestFrom((uint8_t) address, (uint8_t) quantity, (uint8_t) true);
+}
+
+uint8_t TwoWire::requestFrom(int address, int quantity) {
+	return requestFrom((uint8_t) address, (uint8_t) quantity, (uint8_t) true);
+}
+
+uint8_t TwoWire::requestFrom(int address, int quantity, int sendStop) {
+	return requestFrom((uint8_t) address, (uint8_t) quantity, (uint8_t) sendStop);
+}
+
+void TwoWire::beginTransmission(uint8_t address) {
+	status = MASTER_SEND;
+
+	// save address of target and empty buffer
+	txAddress = address;
+	txBufferLength = 0;
+}
+
+void TwoWire::beginTransmission(int address) {
+	beginTransmission((uint8_t) address);
+}
+
+//
+//	Originally, 'endTransmission' was an f(void) function.
+//	It has been modified to take one parameter indicating
+//	whether or not a STOP should be performed on the bus.
+//	Calling endTransmission(false) allows a sketch to
+//	perform a repeated start.
+//
+//	WARNING: Nothing in the library keeps track of whether
+//	the bus tenure has been properly ended with a STOP. It
+//	is very possible to leave the bus in a hung state if
+//	no call to endTransmission(true) is made. Some I2C
+//	devices will behave oddly if they do not see a STOP.
+//
+uint8_t TwoWire::endTransmission(uint8_t sendStop) {
+	// transmit buffer (blocking)
+	TWI_StartWrite(twi, txAddress, 0, 0, txBuffer[0]);
+	TWI_WaitByteSent(twi, XMIT_TIMEOUT);
+	int sent = 1;
+	while (sent < txBufferLength) {
+		TWI_WriteByte(twi, txBuffer[sent++]);
+		TWI_WaitByteSent(twi, XMIT_TIMEOUT);
+	}
+	TWI_Stop( twi);
+	TWI_WaitTransferComplete(twi, XMIT_TIMEOUT);
+
+	// empty buffer
+	txBufferLength = 0;
+
+	status = MASTER_IDLE;
+	return sent;
+}
+
+//	This provides backwards compatibility with the original
+//	definition, and expected behaviour, of endTransmission
+//
+uint8_t TwoWire::endTransmission(void)
+{
+	return endTransmission(true);
+}
+
+size_t TwoWire::write(uint8_t data) {
+	if (status == MASTER_SEND) {
+		if (txBufferLength >= BUFFER_LENGTH)
+			return 0;
+		txBuffer[txBufferLength++] = data;
+		return 1;
+	} else {
+		if (srvBufferLength >= BUFFER_LENGTH)
+			return 0;
+		srvBuffer[srvBufferLength++] = data;
+		return 1;
+	}
+}
+
+size_t TwoWire::write(const uint8_t *data, size_t quantity) {
+	if (status == MASTER_SEND) {
+		for (size_t i = 0; i < quantity; ++i) {
+			if (txBufferLength >= BUFFER_LENGTH)
+				return i;
+			txBuffer[txBufferLength++] = data[i];
+		}
+	} else {
+		for (size_t i = 0; i < quantity; ++i) {
+			if (srvBufferLength >= BUFFER_LENGTH)
+				return i;
+			srvBuffer[srvBufferLength++] = data[i];
+		}
+	}
+	return quantity;
+}
+
+int TwoWire::available(void) {
+	return rxBufferLength - rxBufferIndex;
+}
+
+int TwoWire::read(void) {
+	if (rxBufferIndex < rxBufferLength)
+		return rxBuffer[rxBufferIndex++];
+	return -1;
+}
+
+int TwoWire::peek(void) {
+	if (rxBufferIndex < rxBufferLength)
+		return rxBuffer[rxBufferIndex];
+	return -1;
+}
+
+void TwoWire::flush(void) {
+	// Do nothing, use endTransmission(..) to force
+	// data transfer.
+}
+
+void TwoWire::onReceive(void(*function)(int)) {
+	onReceiveCallback = function;
+}
+
+void TwoWire::onRequest(void(*function)(void)) {
+	onRequestCallback = function;
+}
+
+void TwoWire::onService(void) {
+	// Retrieve interrupt status
+	uint32_t sr = TWI_GetStatus(twi);
+
+	if (status == SLAVE_IDLE && TWI_STATUS_SVACC(sr)) {
+		TWI_DisableIt(twi, TWI_IDR_SVACC);
+		TWI_EnableIt(twi, TWI_IER_RXRDY | TWI_IER_GACC | TWI_IER_NACK
+				| TWI_IER_EOSACC | TWI_IER_SCL_WS | TWI_IER_TXCOMP);
+
+		srvBufferLength = 0;
+		srvBufferIndex = 0;
+
+		// Detect if we should go into RECV or SEND status
+		// SVREAD==1 means *master* reading -> SLAVE_SEND
+		if (!TWI_STATUS_SVREAD(sr)) {
+			status = SLAVE_RECV;
+		} else {
+			status = SLAVE_SEND;
+
+			// Alert calling program to generate a response ASAP
+			if (onRequestCallback)
+				onRequestCallback();
+			else
+				// create a default 1-byte response
+				write((uint8_t) 0);
+		}
+	}
+
+	if (status != SLAVE_IDLE) {
+		if (TWI_STATUS_TXCOMP(sr) && TWI_STATUS_EOSACC(sr)) {
+			if (status == SLAVE_RECV && onReceiveCallback) {
+				// Copy data into rxBuffer
+				// (allows to receive another packet while the
+				// user program reads actual data)
+				for (uint8_t i = 0; i < srvBufferLength; ++i)
+					rxBuffer[i] = srvBuffer[i];
+				rxBufferIndex = 0;
+				rxBufferLength = srvBufferLength;
+
+				// Alert calling program
+				onReceiveCallback( rxBufferLength);
+			}
+
+			// Transfer completed
+			TWI_EnableIt(twi, TWI_SR_SVACC);
+			TWI_DisableIt(twi, TWI_IDR_RXRDY | TWI_IDR_GACC | TWI_IDR_NACK
+					| TWI_IDR_EOSACC | TWI_IDR_SCL_WS | TWI_IER_TXCOMP);
+			status = SLAVE_IDLE;
+		}
+	}
+
+	if (status == SLAVE_RECV) {
+		if (TWI_STATUS_RXRDY(sr)) {
+			if (srvBufferLength < BUFFER_LENGTH)
+				srvBuffer[srvBufferLength++] = TWI_ReadByte(twi);
+		}
+	}
+
+	if (status == SLAVE_SEND) {
+		if (TWI_STATUS_TXRDY(sr) && !TWI_STATUS_NACK(sr)) {
+			uint8_t c = 'x';
+			if (srvBufferIndex < srvBufferLength)
+				c = srvBuffer[srvBufferIndex++];
+			TWI_WriteByte(twi, c);
+		}
+	}
+}
+
+#if WIRE_INTERFACES_COUNT > 0
+static void Wire_Init(void) {
+	pmc_enable_periph_clk(WIRE_INTERFACE_ID);
+	PIO_Configure(
+			g_APinDescription[PIN_WIRE_SDA].pPort,
+			g_APinDescription[PIN_WIRE_SDA].ulPinType,
+			g_APinDescription[PIN_WIRE_SDA].ulPin,
+			g_APinDescription[PIN_WIRE_SDA].ulPinConfiguration);
+	PIO_Configure(
+			g_APinDescription[PIN_WIRE_SCL].pPort,
+			g_APinDescription[PIN_WIRE_SCL].ulPinType,
+			g_APinDescription[PIN_WIRE_SCL].ulPin,
+			g_APinDescription[PIN_WIRE_SCL].ulPinConfiguration);
+
+	NVIC_DisableIRQ(WIRE_ISR_ID);
+	NVIC_ClearPendingIRQ(WIRE_ISR_ID);
+	NVIC_SetPriority(WIRE_ISR_ID, 0);
+	NVIC_EnableIRQ(WIRE_ISR_ID);
+}
+
+TwoWire Wire = TwoWire(WIRE_INTERFACE, Wire_Init);
+
+void WIRE_ISR_HANDLER(void) {
+	Wire.onService();
+}
+#endif
+
+#if WIRE_INTERFACES_COUNT > 1
+static void Wire1_Init(void) {
+	pmc_enable_periph_clk(WIRE1_INTERFACE_ID);
+	PIO_Configure(
+			g_APinDescription[PIN_WIRE1_SDA].pPort,
+			g_APinDescription[PIN_WIRE1_SDA].ulPinType,
+			g_APinDescription[PIN_WIRE1_SDA].ulPin,
+			g_APinDescription[PIN_WIRE1_SDA].ulPinConfiguration);
+	PIO_Configure(
+			g_APinDescription[PIN_WIRE1_SCL].pPort,
+			g_APinDescription[PIN_WIRE1_SCL].ulPinType,
+			g_APinDescription[PIN_WIRE1_SCL].ulPin,
+			g_APinDescription[PIN_WIRE1_SCL].ulPinConfiguration);
+
+	NVIC_DisableIRQ(WIRE1_ISR_ID);
+	NVIC_ClearPendingIRQ(WIRE1_ISR_ID);
+	NVIC_SetPriority(WIRE1_ISR_ID, 0);
+	NVIC_EnableIRQ(WIRE1_ISR_ID);
+}
+
+TwoWire Wire1 = TwoWire(WIRE1_INTERFACE, Wire1_Init);
+
+void WIRE1_ISR_HANDLER(void) {
+	Wire1.onService();
+}
+#endif
diff --git a/libraries/Wire/Wire.h b/libraries/Wire/Wire.h
new file mode 100644
index 00000000..d36faa95
--- /dev/null
+++ b/libraries/Wire/Wire.h
@@ -0,0 +1,117 @@
+/*
+ * TwoWire.h - TWI/I2C library for Arduino Due
+ * Copyright (c) 2011 Cristian Maglie <c.maglie@bug.st>.
+ * All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifndef TwoWire_h
+#define TwoWire_h
+
+// Include Atmel CMSIS driver
+#include <include/twi.h>
+
+#include "Stream.h"
+#include "variant.h"
+
+#define BUFFER_LENGTH 32
+
+class TwoWire : public Stream {
+public:
+	TwoWire(Twi *twi, void(*begin_cb)(void));
+	void begin();
+	void begin(uint8_t);
+	void begin(int);
+	void beginTransmission(uint8_t);
+	void beginTransmission(int);
+	uint8_t endTransmission(void);
+    uint8_t endTransmission(uint8_t);
+	uint8_t requestFrom(uint8_t, uint8_t);
+    uint8_t requestFrom(uint8_t, uint8_t, uint8_t);
+	uint8_t requestFrom(int, int);
+    uint8_t requestFrom(int, int, int);
+	virtual size_t write(uint8_t);
+	virtual size_t write(const uint8_t *, size_t);
+	virtual int available(void);
+	virtual int read(void);
+	virtual int peek(void);
+	virtual void flush(void);
+	void onReceive(void(*)(int));
+	void onRequest(void(*)(void));
+
+    inline size_t write(unsigned long n) { return write((uint8_t)n); }
+    inline size_t write(long n) { return write((uint8_t)n); }
+    inline size_t write(unsigned int n) { return write((uint8_t)n); }
+    inline size_t write(int n) { return write((uint8_t)n); }
+    using Print::write;
+
+	void onService(void);
+
+private:
+	// RX Buffer
+	uint8_t rxBuffer[BUFFER_LENGTH];
+	uint8_t rxBufferIndex;
+	uint8_t rxBufferLength;
+
+	// TX Buffer
+	uint8_t txAddress;
+	uint8_t txBuffer[BUFFER_LENGTH];
+	uint8_t txBufferLength;
+
+	// Service buffer
+	uint8_t srvBuffer[BUFFER_LENGTH];
+	uint8_t srvBufferIndex;
+	uint8_t srvBufferLength;
+
+	// Callback user functions
+	void (*onRequestCallback)(void);
+	void (*onReceiveCallback)(int);
+
+	// Called before initialization
+	void (*onBeginCallback)(void);
+
+	// TWI instance
+	Twi *twi;
+
+	// TWI state
+	enum TwoWireStatus {
+		UNINITIALIZED,
+		MASTER_IDLE,
+		MASTER_SEND,
+		MASTER_RECV,
+		SLAVE_IDLE,
+		SLAVE_RECV,
+		SLAVE_SEND
+	};
+	TwoWireStatus status;
+
+	// TWI clock frequency
+	static const uint32_t TWI_CLOCK = 100000;
+
+	// Timeouts (
+	static const uint32_t RECV_TIMEOUT = 100000;
+	static const uint32_t XMIT_TIMEOUT = 100000;
+};
+
+#if WIRE_INTERFACES_COUNT > 0
+extern TwoWire Wire;
+#endif
+#if WIRE_INTERFACES_COUNT > 1
+extern TwoWire Wire1;
+#endif
+
+#endif
+
diff --git a/libraries/Wire/examples/SFRRanger_reader/SFRRanger_reader.pde b/libraries/Wire/examples/SFRRanger_reader/SFRRanger_reader.pde
new file mode 100644
index 00000000..9c41c18f
--- /dev/null
+++ b/libraries/Wire/examples/SFRRanger_reader/SFRRanger_reader.pde
@@ -0,0 +1,87 @@
+// I2C SRF10 or SRF08 Devantech Ultrasonic Ranger Finder 
+// by Nicholas Zambetti <http://www.zambetti.com>
+// and James Tichenor <http://www.jamestichenor.net> 
+
+// Demonstrates use of the Wire library reading data from the 
+// Devantech Utrasonic Rangers SFR08 and SFR10
+
+// Created 29 April 2006
+
+// This example code is in the public domain.
+
+
+#include <Wire.h>
+
+void setup()
+{
+  Wire.begin();                // join i2c bus (address optional for master)
+  Serial.begin(9600);          // start serial communication at 9600bps
+}
+
+int reading = 0;
+
+void loop()
+{
+  // step 1: instruct sensor to read echoes
+  Wire.beginTransmission(112); // transmit to device #112 (0x70)
+                               // the address specified in the datasheet is 224 (0xE0)
+                               // but i2c adressing uses the high 7 bits so it's 112
+  Wire.write(byte(0x00));      // sets register pointer to the command register (0x00)  
+  Wire.write(byte(0x50));      // command sensor to measure in "inches" (0x50) 
+                               // use 0x51 for centimeters
+                               // use 0x52 for ping microseconds
+  Wire.endTransmission();      // stop transmitting
+
+  // step 2: wait for readings to happen
+  delay(70);                   // datasheet suggests at least 65 milliseconds
+
+  // step 3: instruct sensor to return a particular echo reading
+  Wire.beginTransmission(112); // transmit to device #112
+  Wire.write(byte(0x02));      // sets register pointer to echo #1 register (0x02)
+  Wire.endTransmission();      // stop transmitting
+
+  // step 4: request reading from sensor
+  Wire.requestFrom(112, 2);    // request 2 bytes from slave device #112
+
+  // step 5: receive reading from sensor
+  if(2 <= Wire.available())    // if two bytes were received
+  {
+    reading = Wire.read();  // receive high byte (overwrites previous reading)
+    reading = reading << 8;    // shift high byte to be high 8 bits
+    reading |= Wire.read(); // receive low byte as lower 8 bits
+    Serial.println(reading);   // print the reading
+  }
+
+  delay(250);                  // wait a bit since people have to read the output :)
+}
+
+
+/*
+
+// The following code changes the address of a Devantech Ultrasonic Range Finder (SRF10 or SRF08)
+// usage: changeAddress(0x70, 0xE6);
+
+void changeAddress(byte oldAddress, byte newAddress)
+{
+  Wire.beginTransmission(oldAddress);
+  Wire.write(byte(0x00));
+  Wire.write(byte(0xA0));
+  Wire.endTransmission();
+
+  Wire.beginTransmission(oldAddress);
+  Wire.write(byte(0x00));
+  Wire.write(byte(0xAA));
+  Wire.endTransmission();
+
+  Wire.beginTransmission(oldAddress);
+  Wire.write(byte(0x00));
+  Wire.write(byte(0xA5));
+  Wire.endTransmission();
+
+  Wire.beginTransmission(oldAddress);
+  Wire.write(byte(0x00));
+  Wire.write(newAddress);
+  Wire.endTransmission();
+}
+
+*/
diff --git a/libraries/Wire/examples/digital_potentiometer/digital_potentiometer.pde b/libraries/Wire/examples/digital_potentiometer/digital_potentiometer.pde
new file mode 100644
index 00000000..38da1c54
--- /dev/null
+++ b/libraries/Wire/examples/digital_potentiometer/digital_potentiometer.pde
@@ -0,0 +1,39 @@
+// I2C Digital Potentiometer
+// by Nicholas Zambetti <http://www.zambetti.com>
+// and Shawn Bonkowski <http://people.interaction-ivrea.it/s.bonkowski/>
+
+// Demonstrates use of the Wire library
+// Controls AD5171 digital potentiometer via I2C/TWI
+
+// Created 31 March 2006
+
+// This example code is in the public domain.
+
+// This example code is in the public domain.
+
+
+#include <Wire.h>
+
+void setup()
+{
+  Wire.begin(); // join i2c bus (address optional for master)
+}
+
+byte val = 0;
+
+void loop()
+{
+  Wire.beginTransmission(44); // transmit to device #44 (0x2c)
+                              // device address is specified in datasheet
+  Wire.write(byte(0x00));            // sends instruction byte  
+  Wire.write(val);             // sends potentiometer value byte  
+  Wire.endTransmission();     // stop transmitting
+
+  val++;        // increment value
+  if(val == 64) // if reached 64th position (max)
+  {
+    val = 0;    // start over from lowest value
+  }
+  delay(500);
+}
+
diff --git a/libraries/Wire/examples/master_reader/master_reader.pde b/libraries/Wire/examples/master_reader/master_reader.pde
new file mode 100644
index 00000000..4124d7d6
--- /dev/null
+++ b/libraries/Wire/examples/master_reader/master_reader.pde
@@ -0,0 +1,32 @@
+// Wire Master Reader
+// by Nicholas Zambetti <http://www.zambetti.com>
+
+// Demonstrates use of the Wire library
+// Reads data from an I2C/TWI slave device
+// Refer to the "Wire Slave Sender" example for use with this
+
+// Created 29 March 2006
+
+// This example code is in the public domain.
+
+
+#include <Wire.h>
+
+void setup()
+{
+  Wire.begin();        // join i2c bus (address optional for master)
+  Serial.begin(9600);  // start serial for output
+}
+
+void loop()
+{
+  Wire.requestFrom(2, 6);    // request 6 bytes from slave device #2
+
+  while(Wire.available())    // slave may send less than requested
+  { 
+    char c = Wire.read(); // receive a byte as character
+    Serial.print(c);         // print the character
+  }
+
+  delay(500);
+}
diff --git a/libraries/Wire/examples/master_writer/master_writer.pde b/libraries/Wire/examples/master_writer/master_writer.pde
new file mode 100644
index 00000000..ccaa0361
--- /dev/null
+++ b/libraries/Wire/examples/master_writer/master_writer.pde
@@ -0,0 +1,31 @@
+// Wire Master Writer
+// by Nicholas Zambetti <http://www.zambetti.com>
+
+// Demonstrates use of the Wire library
+// Writes data to an I2C/TWI slave device
+// Refer to the "Wire Slave Receiver" example for use with this
+
+// Created 29 March 2006
+
+// This example code is in the public domain.
+
+
+#include <Wire.h>
+
+void setup()
+{
+  Wire.begin(); // join i2c bus (address optional for master)
+}
+
+byte x = 0;
+
+void loop()
+{
+  Wire.beginTransmission(4); // transmit to device #4
+  Wire.write("x is ");        // sends five bytes
+  Wire.write(x);              // sends one byte  
+  Wire.endTransmission();    // stop transmitting
+
+  x++;
+  delay(500);
+}
diff --git a/libraries/Wire/examples/slave_receiver/slave_receiver.pde b/libraries/Wire/examples/slave_receiver/slave_receiver.pde
new file mode 100644
index 00000000..60dd4bdd
--- /dev/null
+++ b/libraries/Wire/examples/slave_receiver/slave_receiver.pde
@@ -0,0 +1,38 @@
+// Wire Slave Receiver
+// by Nicholas Zambetti <http://www.zambetti.com>
+
+// Demonstrates use of the Wire library
+// Receives data as an I2C/TWI slave device
+// Refer to the "Wire Master Writer" example for use with this
+
+// Created 29 March 2006
+
+// This example code is in the public domain.
+
+
+#include <Wire.h>
+
+void setup()
+{
+  Wire.begin(4);                // join i2c bus with address #4
+  Wire.onReceive(receiveEvent); // register event
+  Serial.begin(9600);           // start serial for output
+}
+
+void loop()
+{
+  delay(100);
+}
+
+// function that executes whenever data is received from master
+// this function is registered as an event, see setup()
+void receiveEvent(int howMany)
+{
+  while(1 < Wire.available()) // loop through all but the last
+  {
+    char c = Wire.read(); // receive byte as a character
+    Serial.print(c);         // print the character
+  }
+  int x = Wire.read();    // receive byte as an integer
+  Serial.println(x);         // print the integer
+}
diff --git a/libraries/Wire/examples/slave_sender/slave_sender.pde b/libraries/Wire/examples/slave_sender/slave_sender.pde
new file mode 100644
index 00000000..d3b238af
--- /dev/null
+++ b/libraries/Wire/examples/slave_sender/slave_sender.pde
@@ -0,0 +1,32 @@
+// Wire Slave Sender
+// by Nicholas Zambetti <http://www.zambetti.com>
+
+// Demonstrates use of the Wire library
+// Sends data as an I2C/TWI slave device
+// Refer to the "Wire Master Reader" example for use with this
+
+// Created 29 March 2006
+
+// This example code is in the public domain.
+
+
+#include <Wire.h>
+
+void setup()
+{
+  Wire.begin(2);                // join i2c bus with address #2
+  Wire.onRequest(requestEvent); // register event
+}
+
+void loop()
+{
+  delay(100);
+}
+
+// function that executes whenever data is requested by master
+// this function is registered as an event, see setup()
+void requestEvent()
+{
+  Wire.write("hello "); // respond with message of 6 bytes
+                       // as expected by master
+}
diff --git a/libraries/Wire/keywords.txt b/libraries/Wire/keywords.txt
new file mode 100644
index 00000000..e75e929e
--- /dev/null
+++ b/libraries/Wire/keywords.txt
@@ -0,0 +1,32 @@
+#######################################
+# Syntax Coloring Map For Wire
+#######################################
+
+#######################################
+# Datatypes (KEYWORD1)
+#######################################
+
+#######################################
+# Methods and Functions (KEYWORD2)
+#######################################
+
+begin	KEYWORD2
+beginTransmission	KEYWORD2
+endTransmission	KEYWORD2
+requestFrom	KEYWORD2
+send	KEYWORD2
+receive	KEYWORD2
+onReceive	KEYWORD2
+onRequest	KEYWORD2
+
+#######################################
+# Instances (KEYWORD2)
+#######################################
+
+Wire	KEYWORD2
+Wire1	KEYWORD2
+
+#######################################
+# Constants (LITERAL1)
+#######################################
+
diff --git a/variants/arduino_zero/build_gcc/libvariant_arduino_zero.mk b/variants/arduino_zero/build_gcc/libvariant_arduino_zero.mk
index 7a18765b..91ebe38e 100644
--- a/variants/arduino_zero/build_gcc/libvariant_arduino_zero.mk
+++ b/variants/arduino_zero/build_gcc/libvariant_arduino_zero.mk
@@ -19,7 +19,7 @@
 # Makefile for compiling libArduino
 .SUFFIXES: .o .a .c .s
 
-CHIP=__SAMD21J18A__
+CHIP=__SAMD21G18A__
 VARIANT=arduino_zero
 LIBNAME=libvariant_$(VARIANT)
 TOOLCHAIN=gcc
-- 
GitLab