1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-19 09:42:11 +03:00

[SAM] Added SAM3X_EK support for USB debug

This commit is contained in:
Thibault RICHARD
2012-04-28 17:36:57 +02:00
parent 9139b106ef
commit e034de5ea9
11 changed files with 97 additions and 68 deletions

View File

@ -1,6 +1,6 @@
ifeq ("$(VARIANTS)", "")
VARIANTS = arduino_due_x arduino_due_u
#VARIANTS = sam3u_ek sam3s_ek sam3x_ek
VARIANTS = arduino_due_x arduino_due_u sam3x_ek
#VARIANTS = sam3u_ek sam3s_ek
endif
SUBMAKE_OPTIONS=--no-builtin-rules --no-builtin-variables
@ -11,7 +11,7 @@ SUBMAKE_OPTIONS=--no-builtin-rules --no-builtin-variables
all: $(VARIANTS)
.PHONY: sam3s_ek
.PHONY: sam3s_ek
sam3s_ek:
@echo --- Making sam3s_ek
@$(MAKE) DEBUG=1 $(SUBMAKE_OPTIONS) -f libarduino_sam3s_ek.mk

View File

@ -39,7 +39,7 @@ 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)
VARIANT_PATH = ../../../../../atmel/sam/variants/$(VARIANT)
#-------------------------------------------------------------------------------
# Files

View File

@ -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
@ -23,18 +23,19 @@
ifeq ("$(VARIANT)", "")
#VARIANT=sam3s_ek
#VARIANT=sam3u_ek
VARIANT=arduino_due_x
VARIANT=sam3x_ek
#VARIANT=arduino_due_x
endif
ifeq ("$(VARIANT)", "sam3s_ek")
CHIP=__SAM3S4C__
VARIANT_PATH = ../../../../atmel/sam/variants/$(VARIANT)
VARIANT_PATH = ../../../../../../atmel/sam/variants/$(VARIANT)
else ifeq ("$(VARIANT)", "sam3u_ek")
CHIP=__SAM3U4E__
VARIANT_PATH = ../../../../atmel/sam/variants/$(VARIANT)
VARIANT_PATH = ../../../../../../atmel/sam/variants/$(VARIANT)
else ifeq ("$(VARIANT)", "sam3x_ek")
CHIP=__SAM3X8H__
VARIANT_PATH = ../../../../atmel/sam/variants/$(VARIANT)
VARIANT_PATH = ../../../../../../atmel/sam/variants/$(VARIANT)
else ifeq ("$(VARIANT)", "arduino_due_u")
CHIP=__SAM3U4E__
VARIANT_PATH = ../../../../variants/$(VARIANT)
@ -153,7 +154,7 @@ test: create_output libsam_$(CHIP_NAME)_$(TOOLCHAIN)_$(LIBS_POSTFIX).a libarduin
.PHONY: create_output
create_output:
@echo --- Preparing $(VARIANT) files in $(OUTPUT_PATH) $(OUTPUT_BIN)
@echo --- Preparing $(VARIANT) files in $(OUTPUT_PATH) $(OUTPUT_BIN)
# @echo -------------------------
# @echo *$(INCLUDES)
# @echo -------------------------
@ -190,11 +191,11 @@ $(OUTPUT_BIN): $(addprefix $(OUTPUT_PATH)/, $(C_OBJ)) $(addprefix $(OUTPUT_PATH)
clean:
@echo --- Cleaning test files
-@$(RM) $(OUTPUT_PATH) 1>NUL 2>&1
# -$(RM) $(OUTPUT_PATH)/test.o
# -$(RM) $(OUTPUT_PATH)/$(OUTPUT_BIN).elf
# -$(RM) $(OUTPUT_PATH)/$(OUTPUT_BIN).elf
# -$(RM) $(OUTPUT_PATH)/$(OUTPUT_BIN).elf.txt
# -$(RM) $(OUTPUT_PATH)/$(OUTPUT_BIN).bin
# -$(RM) $(OUTPUT_PATH)/$(OUTPUT_BIN).bin
# -$(RM) $(OUTPUT_PATH)/$(OUTPUT_BIN).map
debug: test

View File

@ -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
@ -18,6 +18,12 @@
#include "variant.h"
#ifdef _VARIANT_SAM3X_EK_
#define MAX_ANALOG A0
#elif _VARIANT_ARDUINO_DUE_X_
#define MAX_ANALOG A10
#endif
void setup( void )
{
// Initialize the digital pin as an output.
@ -80,7 +86,7 @@ void loop( void )
// Serial1.write( "test2" ) ; // send another string
Serial1.print("Analog ins: ");
for (int i=A0; i<A11; i++) {
for (int i=A0; i<=MAX_ANALOG; i++) {
int a = analogRead(i);
Serial1.print(a, DEC);
Serial1.print(" ");

View File

@ -107,7 +107,7 @@ uint32_t analogRead(uint32_t ulPin)
}
#endif
#if defined __SAM3X8E__
#if defined __SAM3X8E__ || defined __SAM3X8H__
switch ( g_APinDescription[ulPin].ulAnalogChannel )
{
// Handling ADC 10 bits channels

View File

@ -27,5 +27,7 @@ set *0x80004 = *0x80004 & 0xFFFFFFFE
mon reg pc=(0x80004)
info reg
break main
# end of 'reset' command
end

View File

@ -16,8 +16,8 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _VARIANT_ARDUINO_DUE_
#define _VARIANT_ARDUINO_DUE_
#ifndef _VARIANT_ARDUINO_DUE_X_
#define _VARIANT_ARDUINO_DUE_X_
/*----------------------------------------------------------------------------
* Headers
@ -182,5 +182,5 @@ extern USARTClass Serial4 ;
#endif
#endif /* _VARIANT_ARDUINO_DUE_ */
#endif /* _VARIANT_ARDUINO_DUE_X_ */