summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2018-11-05 18:20:16 +0100
committerChristian Pointner <equinox@spreadspace.org>2018-11-05 18:20:19 +0100
commit2f2262229ec3c7559ef34f004e2a0946ad281b58 (patch)
tree0f4e5641d602ce8da870924f7b81317d488849b4
parentcall reset function @ run (diff)
added support for Adafruit Feather 32u4
-rw-r--r--defines.mk11
-rw-r--r--lib/led.c8
-rw-r--r--usb-led/Makefile6
3 files changed, 21 insertions, 4 deletions
diff --git a/defines.mk b/defines.mk
index 3ac16ac..947fe98 100644
--- a/defines.mk
+++ b/defines.mk
@@ -135,6 +135,17 @@ ifeq ($(BOARD_TYPE),rhmixxx)
PROG := DFU
LUFA_BOARD = NONE
endif
+ifeq ($(BOARD_TYPE),feather32u4)
+ MCU := atmega32u4
+ ARCH = AVR8
+ F_CPU := 8000000
+ F_USB = $(F_CPU)
+ PROG := avrdude
+ UPLOAD_RATE := 57600
+ PROG_TYPE := avr109
+ AVRDUDE_PORT := /dev/ttyACM0
+ LUFA_BOARD = NONE
+endif
ifeq ($(BOARD_TYPE),arduinoProMicro)
MCU := atmega32u4
ARCH = AVR8
diff --git a/lib/led.c b/lib/led.c
index 59cf28f..8db877d 100644
--- a/lib/led.c
+++ b/lib/led.c
@@ -29,7 +29,7 @@
#define NUM_LEDS 2
#elif defined(__BOARD_teensy1__) || defined(__BOARD_teensy1pp__) || defined(__BOARD_teensy2__) || defined(__BOARD_teensy2pp__) || \
defined(__BOARD_arduinoNano__) || defined(__BOARD_arduinoNG__) || defined(__BOARD_arduino2009v2__) || defined(__BOARD_arduino2009__) || \
- defined(__BOARD_arduino10000__) || defined(__BOARD_arduinoUno__) || \
+ defined(__BOARD_arduino10000__) || defined(__BOARD_arduinoUno__) || defined(__BOARD_feather32u4__) || \
defined(__BOARD_hhd70dongle__) || defined(__BOARD_rda1846dongle__) || defined(__BOARD_culV3__) || \
defined(__BOARD_slowpandongle1__) || defined(__BOARD_slowpandongle2__) || defined(__BOARD_teenstep__) || \
defined(__BOARD_rhmixxx__) || defined(__BOARD_digispark__) || defined(__BOARD_robotdynMega2560__)
@@ -62,6 +62,12 @@
#define LED2_PINNUM 6
#endif
+#if defined(__BOARD_feather32u4__)
+#define LED_PORT PORTC
+#define LED_DDR DDRC
+#define LED_PINNUM 7
+#endif
+
#if defined(__BOARD_arduinoProMicro__)
#define LED_PORT PORTD
#define LED_DDR DDRD
diff --git a/usb-led/Makefile b/usb-led/Makefile
index e0afd1e..28cdf3a 100644
--- a/usb-led/Makefile
+++ b/usb-led/Makefile
@@ -21,13 +21,13 @@
##
NAME := usb-led
-BOARD_TYPE := teensy2
+BOARD_TYPE := feather32u4
OBJ := $(NAME).o
LIBS := util led lufa-descriptor-usbserial usbio
EXTERNAL_LIBS := lufa
SPREADAVR_PATH := ..
-RESET_FUNC := $(SPREADAVR_PATH)/tools/reset_lufa_cdc
-RESET_PARAM := 'r'
+#RESET_FUNC := $(SPREADAVR_PATH)/tools/reset_lufa_cdc
+#RESET_PARAM := 'r'
LUFA_PATH := $(SPREADAVR_PATH)/contrib/lufa-LUFA-151115
LUFA_OPTS = -D USB_DEVICE_ONLY