Skip to content
Snippets Groups Projects
Commit da5f68b4 authored by Thibaut VIARD's avatar Thibaut VIARD
Browse files

fixing compilation issue

parent 126ef661
No related branches found
No related tags found
No related merge requests found
......@@ -25,13 +25,13 @@ VARIANT=arduino_zero
endif
ifeq ("$(VARIANT)", "arduino_zero")
DEVICE=__SAMD21G18__
DEVICE=__SAMD21G18A__
endif
ifeq ($(DEVICE), __SAMD21G18__)
ifeq ($(DEVICE), __SAMD21G18A__)
DEVICE_NAME=samd21g18
DEVICE_SERIE=samd21
else ifeq ($(DEVICE), __SAMD21J18__)
else ifeq ($(DEVICE), __SAMD21J18A__)
DEVICE_NAME=samd21j18
DEVICE_SERIE=samd21
endif
......@@ -62,7 +62,7 @@ OUTPUT_PATH = debug_$(VARIANT)
# Files
#-------------------------------------------------------------------------------
vpath %.cpp $(PROJECT_BASE_PATH)
vpath %.cpp $(PROJECT_BASE_PATH) $(ARDUINO_CORE_PATH) $(VARIANT_PATH)
vpath %.c $(ARDUINO_CORE_PATH) $(VARIANT_PATH)
#VPATH+=$(PROJECT_BASE_PATH)
......@@ -72,7 +72,7 @@ INCLUDES += -I$(ARDUINO_USB_PATH)
INCLUDES += -I$(VARIANT_PATH)
INCLUDES += -I$(CMSIS_ARM_PATH)
INCLUDES += -I$(CMSIS_ATMEL_PATH)
INCLUDES += -I$(CMSIS_DEVICE_PATH)
#INCLUDES += -I$(CMSIS_DEVICE_PATH)
#-------------------------------------------------------------------------------
ifdef DEBUG
......@@ -109,9 +109,10 @@ LIB_PATH+=-L=/lib/thumb2
#-------------------------------------------------------------------------------
# C source files and objects
#-------------------------------------------------------------------------------
C_SRC=$(wildcard $(PROJECT_BASE_PATH)/*.c)
C_SRC+=$(wildcard $(ARDUINO_CORE_PATH)/*.c)
C_SRC+=$(wildcard $(VARIANT_PATH)/*.c)
C_SRC=
#C_SRC+=$(wildcard $(PROJECT_BASE_PATH)/*.c)
#C_SRC+=$(wildcard $(ARDUINO_CORE_PATH)/*.c)
#C_SRC+=$(wildcard $(VARIANT_PATH)/*.c)
C_OBJ_TEMP = $(patsubst %.c, %.o, $(notdir $(C_SRC)))
......@@ -182,14 +183,16 @@ create_output:
@echo ------------------------------------------------------------------------------------
$(addprefix $(OUTPUT_PATH)/,$(C_OBJ)): $(OUTPUT_PATH)/%.o: %.c
@echo Current folder is $(shell cd)
@echo Current folder is $(shell cd) - $@ $^
# @"$(CC)" -c $(CFLAGS) $< -o $@
"$(CC)" -v -c $(CFLAGS) $< -o $@
# "$(CC)" -v -c $(CFLAGS) $< -o $@
"$(CC)" -c $(CFLAGS) $< -o $@
$(addprefix $(OUTPUT_PATH)/,$(CPP_OBJ)): $(OUTPUT_PATH)/%.o: %.cpp
@echo Current folder is $(shell cd)
@echo Current folder is $(shell cd) - $@ $^
# @"$(CXX)" -c $(CPPFLAGS) $< -o $@
"$(CXX)" -v -c $(CPPFLAGS) $< -o $@
# "$(CXX)" -v -c $(CPPFLAGS) $< -o $@
"$(CXX)" -c $(CPPFLAGS) $< -o $@
$(OUTPUT_BIN): $(addprefix $(OUTPUT_PATH)/, $(C_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(CPP_OBJ)) $(addprefix $(OUTPUT_PATH)/, $(A_OBJ))
@"$(CC)" $(LIB_PATH) $(LDFLAGS) -T"$(VARIANT_PATH)/linker_scripts/gcc/flash.ld" -Wl,-Map,$(OUTPUT_PATH)/$@.map -o $(OUTPUT_PATH)/$@.elf $^ $(LIBS)
......
......@@ -18,6 +18,7 @@
#include "Arduino.h"
/*
#ifdef _VARIANT_SAM3X_EK_
#define MAX_ANALOG A0
#elif defined _VARIANT_ARDUINO_DUE_X_
......@@ -25,9 +26,11 @@
#elif defined _VARIANT_ADK2_
#define MAX_ANALOG A9
#endif
*/
void setup( void )
{
/*
// Initialize the digital pin as an output.
// Pin PIN_LED has a LED connected on most Arduino boards:
pinMode( PIN_LED, OUTPUT ) ;
......@@ -38,46 +41,26 @@ void setup( void )
digitalWrite( PIN_LED2, HIGH ) ;
Serial1.begin( 115200 ) ;
*/
}
/*
static void led_step1( void )
{
#if defined sam3s_ek
digitalWrite( PIN_LED, HIGH ) ; // set the LED on
digitalWrite( PIN_LED2, LOW ) ; // set the red LED off
#endif /* sam3s_ek */
#if defined sam3u_ek
digitalWrite( PIN_LED, HIGH ) ; // set the LED on
digitalWrite( PIN_LED2, LOW ) ; // set the red LED off
#endif /* sam3u_ek */
#if defined arduino_due_x
digitalWrite( PIN_LED, LOW ) ; // set the LED on
digitalWrite( PIN_LED2, LOW ) ; // set the red LED off
#endif /* arduino_due_x */
}
static void led_step2( void )
{
#if defined sam3s_ek
digitalWrite( PIN_LED, LOW ) ; // set the LED off
digitalWrite( PIN_LED2, HIGH ) ; // set the red LED on
#endif /* sam3s_ek */
#if defined sam3u_ek
digitalWrite( PIN_LED, LOW ) ; // set the LED off
digitalWrite( PIN_LED2, HIGH ) ; // set the red LED on
#endif /* sam3u_ek */
#if defined arduino_due_x
digitalWrite( PIN_LED, HIGH ) ; // set the LED off
digitalWrite( PIN_LED2, HIGH ) ; // set the red LED on
#endif /* arduino_due_x */
}
*/
void loop( void )
{
/*
led_step1() ;
delay( 1000 ) ; // wait for a second
led_step2() ;
......@@ -95,4 +78,5 @@ void loop( void )
}
Serial1.println();
delay(100);
*/
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment