diff --git a/hardware/arduino/sam/variants/arduino_due_u/build_gcc/gcc.mk b/hardware/arduino/sam/variants/arduino_due_u/build_gcc/gcc.mk index ebbf6d3c0..99d8969be 100644 --- a/hardware/arduino/sam/variants/arduino_due_u/build_gcc/gcc.mk +++ b/hardware/arduino/sam/variants/arduino_due_u/build_gcc/gcc.mk @@ -8,7 +8,7 @@ # # 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. +# 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 @@ -17,7 +17,6 @@ # # Tool suffix when cross-compiling -#CROSS_COMPILE = ../../../../tools/CodeSourcery_arm/bin/arm-none-eabi- CROSS_COMPILE = $(ARM_GCC_TOOLCHAIN)/arm-none-eabi- # Compilation tools @@ -25,11 +24,13 @@ AR = $(CROSS_COMPILE)ar CC = $(CROSS_COMPILE)gcc CXX = $(CROSS_COMPILE)g++ AS = $(CROSS_COMPILE)as -#LD = $(CROSS_COMPILE)ld -#SIZE = $(CROSS_COMPILE)size NM = $(CROSS_COMPILE)nm -#OBJCOPY = $(CROSS_COMPILE)objcopy +ifeq ($(OS),Windows_NT) RM=cs-rm -Rf +else +RM=rm -Rf +endif + SEP=\\ # --------------------------------------------------------------------------------------- @@ -49,7 +50,7 @@ CFLAGS += -Wcast-align #CFLAGS += -Wmissing-noreturn #CFLAGS += -Wconversion -CFLAGS += --param max-inline-insns-single=500 -mcpu=cortex-m3 -mthumb -mlong-calls -ffunction-sections -nostdlib +CFLAGS += --param max-inline-insns-single=500 -mcpu=cortex-m3 -mthumb -mlong-calls -ffunction-sections -nostdlib -std=c99 CFLAGS += $(OPTIMIZATION) $(INCLUDES) -D$(CHIP) -D$(VARIANT) # To reduce application size use only integer printf function. @@ -69,7 +70,7 @@ CPPFLAGS += -Wpacked -Wredundant-decls -Winline -Wlong-long #CPPFLAGS += -Wmissing-noreturn #CPPFLAGS += -Wconversion -CPPFLAGS += --param max-inline-insns-single=500 -mcpu=cortex-m3 -mthumb -mlong-calls -ffunction-sections -fno-rtti -fno-exceptions +CPPFLAGS += --param max-inline-insns-single=500 -mcpu=cortex-m3 -mthumb -mlong-calls -ffunction-sections -fno-rtti -fno-exceptions -std=c++98 CPPFLAGS += $(OPTIMIZATION) $(INCLUDES) -D$(CHIP) # To reduce application size use only integer printf function. diff --git a/hardware/arduino/sam/variants/arduino_due_u/variant.cpp b/hardware/arduino/sam/variants/arduino_due_u/variant.cpp index 5e531b9d8..a836a4e38 100644 --- a/hardware/arduino/sam/variants/arduino_due_u/variant.cpp +++ b/hardware/arduino/sam/variants/arduino_due_u/variant.cpp @@ -269,7 +269,7 @@ RingBuffer rx_buffer1 ; UARTClass Serial( UART, UART_IRQn, ID_UART, &rx_buffer1 ) ; // IT handlers -void UART_IrqHandler(void) +void UART_Handler(void) { Serial.IrqHandler() ; } @@ -287,17 +287,17 @@ USARTClass Serial3( USART1, USART1_IRQn, ID_USART1, &rx_buffer3 ) ; USARTClass Serial4( USART2, USART2_IRQn, ID_USART2, &rx_buffer4 ) ; // IT handlers -void USART0_IrqHandler( void ) +void USART0_Handler( void ) { Serial2.IrqHandler() ; } -void USART1_IrqHandler( void ) +void USART1_Handler( void ) { Serial3.IrqHandler() ; } -void USART2_IrqHandler( void ) +void USART2_Handler( void ) { Serial4.IrqHandler() ; } diff --git a/hardware/arduino/sam/variants/arduino_due_x/build_gcc/gcc.mk b/hardware/arduino/sam/variants/arduino_due_x/build_gcc/gcc.mk index ebbf6d3c0..99d8969be 100644 --- a/hardware/arduino/sam/variants/arduino_due_x/build_gcc/gcc.mk +++ b/hardware/arduino/sam/variants/arduino_due_x/build_gcc/gcc.mk @@ -8,7 +8,7 @@ # # 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. +# 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 @@ -17,7 +17,6 @@ # # Tool suffix when cross-compiling -#CROSS_COMPILE = ../../../../tools/CodeSourcery_arm/bin/arm-none-eabi- CROSS_COMPILE = $(ARM_GCC_TOOLCHAIN)/arm-none-eabi- # Compilation tools @@ -25,11 +24,13 @@ AR = $(CROSS_COMPILE)ar CC = $(CROSS_COMPILE)gcc CXX = $(CROSS_COMPILE)g++ AS = $(CROSS_COMPILE)as -#LD = $(CROSS_COMPILE)ld -#SIZE = $(CROSS_COMPILE)size NM = $(CROSS_COMPILE)nm -#OBJCOPY = $(CROSS_COMPILE)objcopy +ifeq ($(OS),Windows_NT) RM=cs-rm -Rf +else +RM=rm -Rf +endif + SEP=\\ # --------------------------------------------------------------------------------------- @@ -49,7 +50,7 @@ CFLAGS += -Wcast-align #CFLAGS += -Wmissing-noreturn #CFLAGS += -Wconversion -CFLAGS += --param max-inline-insns-single=500 -mcpu=cortex-m3 -mthumb -mlong-calls -ffunction-sections -nostdlib +CFLAGS += --param max-inline-insns-single=500 -mcpu=cortex-m3 -mthumb -mlong-calls -ffunction-sections -nostdlib -std=c99 CFLAGS += $(OPTIMIZATION) $(INCLUDES) -D$(CHIP) -D$(VARIANT) # To reduce application size use only integer printf function. @@ -69,7 +70,7 @@ CPPFLAGS += -Wpacked -Wredundant-decls -Winline -Wlong-long #CPPFLAGS += -Wmissing-noreturn #CPPFLAGS += -Wconversion -CPPFLAGS += --param max-inline-insns-single=500 -mcpu=cortex-m3 -mthumb -mlong-calls -ffunction-sections -fno-rtti -fno-exceptions +CPPFLAGS += --param max-inline-insns-single=500 -mcpu=cortex-m3 -mthumb -mlong-calls -ffunction-sections -fno-rtti -fno-exceptions -std=c++98 CPPFLAGS += $(OPTIMIZATION) $(INCLUDES) -D$(CHIP) # To reduce application size use only integer printf function. diff --git a/hardware/arduino/sam/variants/arduino_due_x/variant.cpp b/hardware/arduino/sam/variants/arduino_due_x/variant.cpp index e998796e3..362fad4a7 100644 --- a/hardware/arduino/sam/variants/arduino_due_x/variant.cpp +++ b/hardware/arduino/sam/variants/arduino_due_x/variant.cpp @@ -275,7 +275,7 @@ RingBuffer rx_buffer1 ; UARTClass Serial( UART, UART_IRQn, ID_UART, &rx_buffer1 ) ; // IT handlers -void UART_IrqHandler(void) +void UART_Handler(void) { Serial.IrqHandler() ; } @@ -293,17 +293,17 @@ USARTClass Serial3( USART1, USART1_IRQn, ID_USART1, &rx_buffer3 ) ; USARTClass Serial4( USART2, USART2_IRQn, ID_USART2, &rx_buffer4 ) ; // IT handlers -void USART0_IrqHandler( void ) +void USART0_Handler( void ) { Serial2.IrqHandler() ; } -void USART1_IrqHandler( void ) +void USART1_Handler( void ) { Serial3.IrqHandler() ; } -void USART2_IrqHandler( void ) +void USART2_Handler( void ) { Serial4.IrqHandler() ; } diff --git a/hardware/arduino/sam/variants/sam3s_ek/variant.cpp b/hardware/arduino/sam/variants/sam3s_ek/variant.cpp index 5352e089b..6defc1fb1 100644 --- a/hardware/arduino/sam/variants/sam3s_ek/variant.cpp +++ b/hardware/arduino/sam/variants/sam3s_ek/variant.cpp @@ -146,12 +146,12 @@ extern "C" { #endif // IT handlers -extern void UART0_IrqHandler( void ) +extern void UART0_Handler( void ) { Serial.IrqHandler() ; } -extern void UART1_IrqHandler( void ) +extern void UART1_Handler( void ) { Serial2.IrqHandler() ; } @@ -177,12 +177,12 @@ extern "C" { #endif // IT handlers -extern void USART0_IrqHandler( void ) +extern void USART0_Handler( void ) { Serial3.IrqHandler() ; } -extern void USART1_IrqHandler( void ) +extern void USART1_Handler( void ) { Serial4.IrqHandler() ; } diff --git a/hardware/arduino/sam/variants/sam3u_ek/variant.cpp b/hardware/arduino/sam/variants/sam3u_ek/variant.cpp index f2c160046..4c436e451 100644 --- a/hardware/arduino/sam/variants/sam3u_ek/variant.cpp +++ b/hardware/arduino/sam/variants/sam3u_ek/variant.cpp @@ -93,7 +93,7 @@ extern "C" { #endif // IT handlers -extern void UART_IrqHandler( void ) +extern void UART_Handler( void ) { Serial.IrqHandler() ; } @@ -119,12 +119,12 @@ extern "C" { #endif // IT handlers -extern void USART0_IrqHandler( void ) +extern void USART0_Handler( void ) { Serial2.IrqHandler() ; } -extern void USART1_IrqHandler( void ) +extern void USART1_Handler( void ) { Serial3.IrqHandler() ; }