Skip to content

Commit 3972bc1

Browse files
committed
atmel-samd: Basic capacitive touch button support.
Currently only works on a single channel and is only enabled for boards with SPI flash. Only really designed for hardware testing at this point.
1 parent cd09726 commit 3972bc1

18 files changed

Lines changed: 4539 additions & 65 deletions

File tree

atmel-samd/Makefile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ endif
141141

142142
LIBGCC_FILE_NAME = $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
143143
LIBM_FILE_NAME = $(shell $(CC) $(CFLAGS) -print-file-name=libm.a)
144-
LDFLAGS = -Lasf/thirdparty/CMSIS/Lib/GCC/ -L $(dir $(LIBGCC_FILE_NAME)) -L $(dir $(LIBM_FILE_NAME)) -nostdlib -T $(LD_FILE) -Map=$@.map --cref --gc-sections
145-
LIBS = -larm_cortexM0l_math -lm -lgcc -lc
144+
LDFLAGS = -L asf/thirdparty/CMSIS/Lib/GCC/ -L QTouch/ -L $(dir $(LIBGCC_FILE_NAME)) -L $(dir $(LIBM_FILE_NAME)) -nostdlib -T $(LD_FILE) -Map=$@.map --cref --gc-sections
145+
LIBS = -larm_cortexM0l_math -lsamd21_qtouch_gcc -lm -lgcc -lc
146146

147147

148148
SRC_ASF = $(addprefix asf/sam0/,\
@@ -224,6 +224,16 @@ SRC_BINDINGS = \
224224
SRC_BINDINGS_EXPANDED = $(addprefix shared-bindings/, $(SRC_BINDINGS)) \
225225
$(addprefix common-hal/, $(SRC_BINDINGS))
226226

227+
# Handle touch support on its own since it only fits in the image when external
228+
# flash is used to store the file system.
229+
SRC_BINDINGS_EXPANDED += shared-bindings/nativeio/TouchIn.c
230+
231+
ifeq ($(FLASH_IMPL),internal_flash.c)
232+
SRC_BINDINGS_EXPANDED += common-hal/nativeio/TouchInStub.c
233+
else
234+
SRC_BINDINGS_EXPANDED += common-hal/nativeio/TouchIn.c
235+
endif
236+
227237
SRC_SHARED_MODULE = \
228238
bitbangio/__init__.c \
229239
bitbangio/I2C.c \

0 commit comments

Comments
 (0)