diff --git a/hardware/sam/cores/sam/Arduino.h b/hardware/sam/cores/sam/Arduino.h index 413d246fa..f345e0c97 100644 --- a/hardware/sam/cores/sam/Arduino.h +++ b/hardware/sam/cores/sam/Arduino.h @@ -79,32 +79,12 @@ typedef unsigned int word; typedef uint8_t boolean ; typedef uint8_t byte ; +#include "wiring.h" +#include "wiring_digital.h" +#include "wiring_analog.h" +#include "wiring_shift.h" -// wiring_digital.c -extern void pinMode( uint32_t dwPin, uint32_t dwMode ) ; -extern void digitalWrite( uint32_t dwPin, uint32_t dwVal ) ; -extern int digitalRead( uint32_t dwPin ) ; - -// wiring_analog.c -extern int analogRead( uint8_t ) ; -extern void analogReference( uint8_t mode ) ; -extern void analogWrite( uint8_t, int ) ; - -// wiring.c -extern void init( void ) ; -extern uint32_t millis( void ) ; -extern uint32_t micros( void ) ; -extern void delay( uint32_t dwMs ) ; -extern void delayMicroseconds( uint32_t dwUs ) ; - -// wiring_shift.c -extern void shiftOut( uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t val ) ; -extern uint8_t shiftIn( uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder ) ; - -extern void attachInterrupt( uint8_t, void (*)(void), int mode ) ; -extern void detachInterrupt( uint8_t ) ; - -// sketch +/* sketch */ extern void setup( void ) ; extern void loop( void ) ; @@ -127,31 +107,24 @@ extern void loop( void ) ; #define NOT_ON_TIMER 0 #define TIMER0 1 - #ifdef __cplusplus } // extern "C" #endif // __cplusplus + + #ifdef __cplusplus -# include "WCharacter.h" -# include "WString.h" -# include "HardwareSerial.h" +#include "WCharacter.h" +#include "WString.h" +#include "HardwareSerial.h" uint16_t makeWord( uint16_t w ) ; uint16_t makeWord( byte h, byte l ) ; #define word(...) makeWord(__VA_ARGS__) -extern uint32_t pulseIn( uint32_t pin, uint32_t state, uint32_t timeout = 1000000L ) ; - -extern void tone( uint32_t dwPin, uint32_t dwFrequency, uint32_t dwDuration = 0 ) ; -extern void noTone( uint32_t dwPin ) ; - -// WMath prototypes -extern long random( long ) ; -extern long random( long, long ) ; -extern void randomSeed( uint32_t dwSeed ) ; -extern long map( long, long, long, long, long ) ; +#include "Tone.h" +#include "WMath.h" #endif // __cplusplus @@ -194,4 +167,4 @@ typedef struct _PinDescription #include "pins_arduino.h" -#endif // Arduino_h \ No newline at end of file +#endif // Arduino_h diff --git a/hardware/sam/cores/sam/HardwareSerial.h b/hardware/sam/cores/sam/HardwareSerial.h index 677bce248..2a4644fc5 100644 --- a/hardware/sam/cores/sam/HardwareSerial.h +++ b/hardware/sam/cores/sam/HardwareSerial.h @@ -32,7 +32,9 @@ class HardwareSerial : public Stream virtual void flush( void ) =0 ; virtual void write( const uint8_t c ) =0 ; - using Print::write ; // pull in write(str) and write(buf, size) from Print + virtual void write( const char *str ) ; + virtual void write( const uint8_t *buffer, size_t size ) ; +// using Print::write ; // pull in write(str) and write(buf, size) from Print } ; // Complementary API diff --git a/hardware/sam/cores/sam/Print.h b/hardware/sam/cores/sam/Print.h index c09063660..7885617ed 100644 --- a/hardware/sam/cores/sam/Print.h +++ b/hardware/sam/cores/sam/Print.h @@ -39,7 +39,7 @@ class Print virtual void write(uint8_t) = 0; virtual void write(const char *str); virtual void write(const uint8_t *buffer, size_t size); - + void print(const String &); void print(const char[]); void print(char); diff --git a/hardware/sam/cores/sam/UART.h b/hardware/sam/cores/sam/UART.h index 075a83f49..d6adc5271 100644 --- a/hardware/sam/cores/sam/UART.h +++ b/hardware/sam/cores/sam/UART.h @@ -26,7 +26,9 @@ class UARTClass : public HardwareSerial void IrqHandler( void ) ; - using Print::write ; // pull in write(str) and write(buf, size) from Print + virtual void write( const char *str ) ; + virtual void write( const uint8_t *buffer, size_t size ) ; +// using Print::write ; // pull in write(str) and write(buf, size) from Print }; #endif // _UART_ diff --git a/hardware/sam/cores/sam/USART.h b/hardware/sam/cores/sam/USART.h index cc9983db4..00aecc245 100644 --- a/hardware/sam/cores/sam/USART.h +++ b/hardware/sam/cores/sam/USART.h @@ -26,7 +26,9 @@ class USARTClass : public HardwareSerial void IrqHandler( void ) ; - using Print::write ; // pull in write(str) and write(buf, size) from Print + void write( const char *str ) ; + void write( const uint8_t *buffer, size_t size ) ; +// using Print::write ; // pull in write(str) and write(buf, size) from Print }; #endif // _USART_ diff --git a/hardware/sam/cores/sam/WCharacter.h b/hardware/sam/cores/sam/WCharacter.h index 79733b50a..e84b34857 100644 --- a/hardware/sam/cores/sam/WCharacter.h +++ b/hardware/sam/cores/sam/WCharacter.h @@ -1,17 +1,17 @@ /* WCharacter.h - Character utility functions for Wiring & Arduino Copyright (c) 2010 Hernando Barragan. 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 @@ -22,7 +22,12 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + // WCharacter.h prototypes +#if defined ( __GNUC__ ) inline boolean isAlphaNumeric(int c) __attribute__((always_inline)); inline boolean isAlpha(int c) __attribute__((always_inline)); inline boolean isAscii(int c) __attribute__((always_inline)); @@ -39,17 +44,18 @@ inline boolean isHexadecimalDigit(int c) __attribute__((always_inline)); inline int toAscii(int c) __attribute__((always_inline)); inline int toLowerCase(int c) __attribute__((always_inline)); inline int toUpperCase(int c)__attribute__((always_inline)); +#elif defined ( __ICCARM__ ) +#endif - -// Checks for an alphanumeric character. +// Checks for an alphanumeric character. // It is equivalent to (isalpha(c) || isdigit(c)). -inline boolean isAlphaNumeric(int c) +inline boolean isAlphaNumeric(int c) { return ( isalnum(c) == 0 ? false : true); } -// Checks for an alphabetic character. +// Checks for an alphabetic character. // It is equivalent to (isupper(c) || islower(c)). inline boolean isAlpha(int c) { @@ -57,11 +63,12 @@ inline boolean isAlpha(int c) } -// Checks whether c is a 7-bit unsigned char value +// Checks whether c is a 7-bit unsigned char value // that fits into the ASCII character set. inline boolean isAscii(int c) { - return ( isascii (c) == 0 ? false : true); +/* return ( isascii(c) == 0 ? false : true); */ + return ( (c & ~0x7f) != 0 ? false : true); } @@ -107,7 +114,7 @@ inline boolean isPrintable(int c) } -// Checks for any printable character which is not a space +// Checks for any printable character which is not a space // or an alphanumeric character. inline boolean isPunct(int c) { @@ -115,8 +122,8 @@ inline boolean isPunct(int c) } -// Checks for white-space characters. For the avr-libc library, -// these are: space, formfeed ('\f'), newline ('\n'), carriage +// Checks for white-space characters. For the avr-libc library, +// these are: space, formfeed ('\f'), newline ('\n'), carriage // return ('\r'), horizontal tab ('\t'), and vertical tab ('\v'). inline boolean isSpace(int c) { @@ -131,7 +138,7 @@ inline boolean isUpperCase(int c) } -// Checks for a hexadecimal digits, i.e. one of 0 1 2 3 4 5 6 7 +// Checks for a hexadecimal digits, i.e. one of 0 1 2 3 4 5 6 7 // 8 9 a b c d e f A B C D E F. inline boolean isHexadecimalDigit(int c) { @@ -139,17 +146,18 @@ inline boolean isHexadecimalDigit(int c) } -// Converts c to a 7-bit unsigned char value that fits into the +// Converts c to a 7-bit unsigned char value that fits into the // ASCII character set, by clearing the high-order bits. inline int toAscii(int c) { - return toascii (c); +/* return toascii (c); */ + return (c & 0x7f); } // Warning: -// Many people will be unhappy if you use this function. -// This function will convert accented letters into random +// Many people will be unhappy if you use this function. +// This function will convert accented letters into random // characters. // Converts the letter c to lower case, if possible. @@ -165,4 +173,8 @@ inline int toUpperCase(int c) return toupper (c); } -#endif \ No newline at end of file +#ifdef __cplusplus +} +#endif + +#endif diff --git a/hardware/sam/cores/sam/WInterrupts.c b/hardware/sam/cores/sam/WInterrupts.c index 3b81e8638..3400e591d 100644 --- a/hardware/sam/cores/sam/WInterrupts.c +++ b/hardware/sam/cores/sam/WInterrupts.c @@ -3,19 +3,4 @@ #include "wiring_private.h" -volatile static voidFuncPtr intFunc[EXTERNAL_NUM_INTERRUPTS]; -void attachInterrupt(uint8_t interruptNum, void (*userFunc)(void), int mode) { - if(interruptNum < EXTERNAL_NUM_INTERRUPTS) - { - intFunc[interruptNum] = userFunc; - } -} - -void detachInterrupt( uint8_t interruptNum ) -{ - if(interruptNum < EXTERNAL_NUM_INTERRUPTS) - { - intFunc[interruptNum] = 0; - } -} diff --git a/hardware/sam/cores/sam/WMath.cpp b/hardware/sam/cores/sam/WMath.cpp index febf085b9..8aeb8b9ff 100644 --- a/hardware/sam/cores/sam/WMath.cpp +++ b/hardware/sam/cores/sam/WMath.cpp @@ -4,7 +4,7 @@ Part of the Wiring project - http://wiring.org.co Copyright (c) 2004-06 Hernando Barragan Modified 13 August 2006, David A. Mellis for Arduino - http://www.arduino.cc/ - + 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 @@ -19,7 +19,7 @@ Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - + $Id$ */ @@ -64,11 +64,11 @@ long map(long x, long in_min, long in_max, long out_min, long out_max) } uint32_t makeWord( uint32_t w ) -{ +{ return w ; } uint32_t makeWord( uint8_t h, uint8_t l ) -{ +{ return (h << 8) | l ; } diff --git a/hardware/sam/cores/sam/board_cstartup_gnu_sam3.c b/hardware/sam/cores/sam/board_cstartup_gnu_sam3.c deleted file mode 100644 index 67c4a990d..000000000 --- a/hardware/sam/cores/sam/board_cstartup_gnu_sam3.c +++ /dev/null @@ -1,171 +0,0 @@ -/* ---------------------------------------------------------------------------- - * ATMEL Microcontroller Software Support - * ---------------------------------------------------------------------------- - * Copyright (c) 2010, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/*---------------------------------------------------------------------------- - * Headers - *----------------------------------------------------------------------------*/ - -#include "Arduino.h" - -/*---------------------------------------------------------------------------- - * Exported variables - *----------------------------------------------------------------------------*/ - -/* Stack Configuration */ -#define STACK_SIZE 0x900 /** Stack size (in DWords) */ -__attribute__ ((aligned(8),section(".stack"))) -uint32_t pdwStack[STACK_SIZE] ; - -/* Initialize segments */ -extern uint32_t _sfixed; -extern uint32_t _efixed; -extern uint32_t _etext; -extern uint32_t _srelocate; -extern uint32_t _erelocate; -extern uint32_t _szero; -extern uint32_t _ezero; - - -/*---------------------------------------------------------------------------- - * Prototypes - *----------------------------------------------------------------------------*/ - -/** \cond DOXYGEN_SHOULD_SKIP_THIS */ -extern int main( void ) ; -/** \endcond */ -void Reset_Handler( void ) ; -extern void __libc_init_array( void ) ; - -/*------------------------------------------------------------------------------ - * Exception Table - *------------------------------------------------------------------------------*/ - -void* vector_table[] __attribute__ ((section(".vectors"))) = { - /* Configure Initial Stack Pointer, using linker-generated symbols */ - (IntFunc)(&pdwStack[STACK_SIZE-1]), - Reset_Handler, - - NMI_Handler, - HardFault_Handler, - MemManage_Handler, - BusFault_Handler, - UsageFault_Handler, - 0, 0, 0, 0, /* Reserved */ - SVC_Handler, - DebugMon_Handler, - 0, /* Reserved */ - PendSV_Handler, - SysTick_Handler, - - /* Configurable interrupts */ - SUPC_IrqHandler, /* 0 Supply Controller */ - RSTC_IrqHandler, /* 1 Reset Controller */ - RTC_IrqHandler, /* 2 Real Time Clock */ - RTT_IrqHandler, /* 3 Real Time Timer */ - WDT_IrqHandler, /* 4 Watchdog Timer */ - PMC_IrqHandler, /* 5 PMC */ - EEFC_IrqHandler, /* 6 EEFC */ - Dummy_Handler, /* 7 Reserved */ - UART0_IrqHandler, /* 8 UART0 */ - UART1_IrqHandler, /* 9 UART1 */ - SMC_IrqHandler, /* 10 SMC */ - PIOA_IrqHandler, /* 11 Parallel IO Controller A */ - PIOB_IrqHandler, /* 12 Parallel IO Controller B */ - PIOC_IrqHandler, /* 13 Parallel IO Controller C */ - USART0_IrqHandler, /* 14 USART 0 */ - USART1_IrqHandler, /* 15 USART 1 */ - Dummy_Handler, /* 16 Reserved */ - Dummy_Handler, /* 17 Reserved */ - MCI_IrqHandler, /* 18 MCI */ - TWI0_IrqHandler, /* 19 TWI 0 */ - TWI1_IrqHandler, /* 20 TWI 1 */ - SPI_IrqHandler, /* 21 SPI */ - SSC_IrqHandler, /* 22 SSC */ - TC0_IrqHandler, /* 23 Timer Counter 0 */ - TC1_IrqHandler, /* 24 Timer Counter 1 */ - TC2_IrqHandler, /* 25 Timer Counter 2 */ - TC3_IrqHandler, /* 26 Timer Counter 3 */ - TC4_IrqHandler, /* 27 Timer Counter 4 */ - TC5_IrqHandler, /* 28 Timer Counter 5 */ - ADC_IrqHandler, /* 29 ADC controller */ - DAC_IrqHandler, /* 30 DAC controller */ - PWM_IrqHandler, /* 31 PWM */ - CRCCU_IrqHandler, /* 32 CRC Calculation Unit */ - ACC_IrqHandler, /* 33 Analog Comparator */ - USBD_IrqHandler, /* 34 USB Device Port */ - Dummy_Handler /* 35 not used */ -}; - -/** - * \brief This is the code that gets called on processor reset. - * To initialize the device, and call the main() routine. - */ -void Reset_Handler( void ) -{ - uint32_t *pSrc, *pDest ; - - /* Arduino board Low level Initialization */ - init() ; - - /* Initialize the relocate segment */ - pSrc = &_etext ; - pDest = &_srelocate ; - - if ( pSrc != pDest ) - { - for ( ; pDest < &_erelocate ; ) - { - *pDest++ = *pSrc++ ; - } - } - - /* Clear the zero segment */ - for ( pDest = &_szero ; pDest < &_ezero ; ) - { - *pDest++ = 0; - } - - /* Set the vector table base address */ - pSrc = (uint32_t *)&_sfixed; - SCB->VTOR = ( (uint32_t)pSrc & SCB_VTOR_TBLOFF_Msk ) ; - - if ( ((uint32_t)pSrc >= IRAM_ADDR) && ((uint32_t)pSrc < IRAM_ADDR+IRAM_SIZE) ) - { - SCB->VTOR |= 1 << SCB_VTOR_TBLBASE_Pos ; - } - - /* Initialize the C library */ - __libc_init_array() ; - - /* Branch to main function */ - main() ; - - /* Infinite loop */ - while ( 1 ) ; -} diff --git a/hardware/sam/cores/sam/board_cstartup_iar_sam3.c b/hardware/sam/cores/sam/board_cstartup_iar_sam3.c deleted file mode 100644 index caee3ccba..000000000 --- a/hardware/sam/cores/sam/board_cstartup_iar_sam3.c +++ /dev/null @@ -1,148 +0,0 @@ -/* ---------------------------------------------------------------------------- - * ATMEL Microcontroller Software Support - * ---------------------------------------------------------------------------- - * Copyright (c) 2010, Atmel Corporation - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the disclaimer below. - * - * Atmel's name may not be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE - * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * ---------------------------------------------------------------------------- - */ - -/*---------------------------------------------------------------------------- - * Headers - *----------------------------------------------------------------------------*/ - -#include "Arduino.h" - -/*---------------------------------------------------------------------------- - * Exported variables - *----------------------------------------------------------------------------*/ - -/*---------------------------------------------------------------------------- - * Definitions - *----------------------------------------------------------------------------*/ - -/*------------------------------------------------------------------------------ - * Types - *------------------------------------------------------------------------------*/ -typedef union { IntFunc __fun; void * __ptr; } IntVector; - -/*------------------------------------------------------------------------------ - * ProtoTypes - *------------------------------------------------------------------------------*/ -extern void __iar_program_start( void ) ; - -extern int __low_level_init( void ) ; - -/*------------------------------------------------------------------------------ - * Exception Table - *------------------------------------------------------------------------------*/ -#pragma language=extended -#pragma segment="CSTACK" - -/* The name "__vector_table" has special meaning for C-SPY: */ -/* it is where the SP start value is found, and the NVIC vector */ -/* table register (VTOR) is initialized to this address if != 0. */ - -#pragma section = ".vectors" -#pragma location = ".vectors" -const IntVector __vector_table[] = -{ - { .__ptr = __sfe( "CSTACK" ) }, - __iar_program_start, - - NMI_Handler, - HardFault_Handler, - MemManage_Handler, - BusFault_Handler, - UsageFault_Handler, - 0, 0, 0, 0, /* Reserved */ - SVC_Handler, - DebugMon_Handler, - 0, /* Reserved */ - PendSV_Handler, - SysTick_Handler, - -#if defined sam3s4c - /* Configurable interrupts */ - SUPC_IrqHandler, /* 0 Supply Controller */ - RSTC_IrqHandler, /* 1 Reset Controller */ - RTC_IrqHandler, /* 2 Real Time Clock */ - RTT_IrqHandler, /* 3 Real Time Timer */ - WDT_IrqHandler, /* 4 Watchdog Timer */ - PMC_IrqHandler, /* 5 PMC */ - EEFC_IrqHandler, /* 6 EEFC */ - Dummy_Handler, /* 7 Reserved */ - UART0_IrqHandler, /* 8 UART0 */ - UART1_IrqHandler, /* 9 UART1 */ - SMC_IrqHandler, /* 10 SMC */ - PIOA_IrqHandler, /* 11 Parallel IO Controller A */ - PIOB_IrqHandler, /* 12 Parallel IO Controller B */ - PIOC_IrqHandler, /* 13 Parallel IO Controller C */ - USART0_IrqHandler, /* 14 USART 0 */ - USART1_IrqHandler, /* 15 USART 1 */ - Dummy_Handler, /* 16 Reserved */ - Dummy_Handler, /* 17 Reserved */ - MCI_IrqHandler, /* 18 MCI */ - TWI0_IrqHandler, /* 19 TWI 0 */ - TWI1_IrqHandler, /* 20 TWI 1 */ - SPI_IrqHandler, /* 21 SPI */ - SSC_IrqHandler, /* 22 SSC */ - TC0_IrqHandler, /* 23 Timer Counter 0 */ - TC1_IrqHandler, /* 24 Timer Counter 1 */ - TC2_IrqHandler, /* 25 Timer Counter 2 */ - TC3_IrqHandler, /* 26 Timer Counter 3 */ - TC4_IrqHandler, /* 27 Timer Counter 4 */ - TC5_IrqHandler, /* 28 Timer Counter 5 */ - ADC_IrqHandler, /* 29 ADC controller */ - DAC_IrqHandler, /* 30 DAC controller */ - PWM_IrqHandler, /* 31 PWM */ - CRCCU_IrqHandler, /* 32 CRC Calculation Unit */ - ACC_IrqHandler, /* 33 Analog Comparator */ - USBD_IrqHandler, /* 34 USB Device Port */ - Dummy_Handler /* 35 not used */ -#endif /* defined sam3s4c */ - -#if defined sam3u4e -#endif /* defined sam3u4e */ -}; - -/**------------------------------------------------------------------------------ - * This is the code that gets called on processor reset. To initialize the - * device. - *------------------------------------------------------------------------------*/ -extern int __low_level_init( void ) -{ - uint32_t* pSrc = (uint32_t*)__section_begin( ".vectors" ) ; - - /* Low level Initialize */ - LowLevelInit() ; - - SCB->VTOR = ( (uint32_t)pSrc & SCB_VTOR_TBLOFF_Msk ) ; - - if ( ((uint32_t)pSrc >= IRAM0_ADDR) && ((uint32_t)pSrc < NFC_RAM_ADDR) ) - { - SCB->VTOR |= 1 << SCB_VTOR_TBLBASE_Pos ; - } - - return 1 ; /* if return 0, the data sections will not be initialized. */ -} diff --git a/hardware/sam/cores/sam/build_gcc/arduino_sam3s_ek.mk b/hardware/sam/cores/sam/build_gcc/arduino_sam3s_ek.mk index 85fac3172..2baab287e 100644 --- a/hardware/sam/cores/sam/build_gcc/arduino_sam3s_ek.mk +++ b/hardware/sam/cores/sam/build_gcc/arduino_sam3s_ek.mk @@ -1,7 +1,7 @@ # Makefile for compiling libArduino .SUFFIXES: .o .a .c .s -CHIP=sam3s4 +CHIP=__SAM3S4C__ VARIANT=sam3s_ek LIBNAME=libarduino_$(VARIANT) TOOLCHAIN=gcc @@ -16,7 +16,7 @@ OUTPUT_BIN = ../lib # Libraries PROJECT_BASE_PATH = .. SYSTEM_PATH = ../../../system -CMSIS_PATH = $(SYSTEM_PATH)/CMSIS/CM3/CoreSupport +CMSIS_PATH = $(SYSTEM_PATH)/CMSIS/Include VARIANT_PATH = ../../../variants/sam3s-ek #------------------------------------------------------------------------------- diff --git a/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/HardwareSerial.o b/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/HardwareSerial.o deleted file mode 100644 index 16bb800dd..000000000 Binary files a/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/HardwareSerial.o and /dev/null differ diff --git a/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/Print.o b/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/Print.o deleted file mode 100644 index 5b9c3e630..000000000 Binary files a/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/Print.o and /dev/null differ diff --git a/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/UART.o b/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/UART.o deleted file mode 100644 index b835049db..000000000 Binary files a/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/UART.o and /dev/null differ diff --git a/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/USART.o b/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/USART.o deleted file mode 100644 index 204930240..000000000 Binary files a/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/USART.o and /dev/null differ diff --git a/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/WInterrupts.o b/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/WInterrupts.o index 42ed4aec2..ce252e787 100644 Binary files a/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/WInterrupts.o and b/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/WInterrupts.o differ diff --git a/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/WMath.o b/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/WMath.o deleted file mode 100644 index a3d192127..000000000 Binary files a/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/WMath.o and /dev/null differ diff --git a/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/WString.o b/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/WString.o deleted file mode 100644 index aac762667..000000000 Binary files a/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/WString.o and /dev/null differ diff --git a/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/board_cstartup_gnu_sam3.o b/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/board_cstartup_gnu_sam3.o deleted file mode 100644 index a26e0b88e..000000000 Binary files a/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/board_cstartup_gnu_sam3.o and /dev/null differ diff --git a/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/cxxabi-compat.o b/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/cxxabi-compat.o deleted file mode 100644 index 5c7e6d942..000000000 Binary files a/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/cxxabi-compat.o and /dev/null differ diff --git a/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/itoa.o b/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/itoa.o index 216c052b3..4ba59270f 100644 Binary files a/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/itoa.o and b/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/itoa.o differ diff --git a/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/main.o b/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/main.o deleted file mode 100644 index 1f239a64a..000000000 Binary files a/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/main.o and /dev/null differ diff --git a/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/syscalls_sam3.o b/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/syscalls_sam3.o index 053d588b3..2352bdf2a 100644 Binary files a/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/syscalls_sam3.o and b/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/syscalls_sam3.o differ diff --git a/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/variant.o b/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/variant.o deleted file mode 100644 index ba2271836..000000000 Binary files a/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/variant.o and /dev/null differ diff --git a/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/wiring.o b/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/wiring.o deleted file mode 100644 index 1e770c51a..000000000 Binary files a/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/wiring.o and /dev/null differ diff --git a/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/wiring_digital.o b/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/wiring_digital.o deleted file mode 100644 index d780122dc..000000000 Binary files a/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/wiring_digital.o and /dev/null differ diff --git a/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/wiring_shift.o b/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/wiring_shift.o deleted file mode 100644 index 3a34c5251..000000000 Binary files a/hardware/sam/cores/sam/build_gcc/debug_sam3s_ek/wiring_shift.o and /dev/null differ diff --git a/hardware/sam/cores/sam/build_iar/libarduino.ewp b/hardware/sam/cores/sam/build_iar/libarduino.ewp index 8d2cb44bc..f5a85e920 100644 --- a/hardware/sam/cores/sam/build_iar/libarduino.ewp +++ b/hardware/sam/cores/sam/build_iar/libarduino.ewp @@ -103,7 +103,7 @@ @@ -660,35 +660,35 @@