summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2013-04-22 19:30:44 +0000
committerChristian Pointner <equinox@spreadspace.org>2013-04-22 19:30:44 +0000
commit75ca37c90da0f704441968cffe08cb6086dbc7e1 (patch)
tree9608d96724666b7f10d1c48675cffbaeface4d67
parentadded usb 1-wire project (diff)
added support for slowpandongle
git-svn-id: https://svn.spreadspace.org/avr/trunk@206 aa12f405-d877-488e-9caf-2d797e2a1cc7
-rw-r--r--defines.mk8
-rw-r--r--lib/led.c8
-rw-r--r--lib/util.c6
-rw-r--r--usb-led/Makefile2
4 files changed, 20 insertions, 4 deletions
diff --git a/defines.mk b/defines.mk
index b65e861..f506bbe 100644
--- a/defines.mk
+++ b/defines.mk
@@ -96,6 +96,14 @@ ifeq ($(BOARD_TYPE),culV3)
PROG := DFU
LUFA_BOARD = CULV3
endif
+ifeq ($(BOARD_TYPE),slowpandongle)
+ MCU := at90usb162
+ ARCH = AVR8
+ F_CPU := 16000000
+ F_USB = $(F_CPU)
+ PROG := DFU
+ LUFA_BOARD = NONE
+endif
ifeq ($(BOARD_TYPE),arduinoUno)
MCU := atmega328p
ARCH = AVR8
diff --git a/lib/led.c b/lib/led.c
index 4e08d6f..c34c538 100644
--- a/lib/led.c
+++ b/lib/led.c
@@ -28,7 +28,7 @@
#define NUM_LEDS 2
#elif defined(__BOARD_teensy1__) || defined(__BOARD_teensy1pp__) || defined(__BOARD_teensy2__) || defined(__BOARD_teensy2pp__) \
|| defined(__BOARD_arduinoNG__) || defined(__BOARD_arduino2009v2__) || defined(__BOARD_arduino2009__) || defined(__BOARD_arduino10000__) \
- || defined(__BOARD_hhd70dongle__) || defined(__BOARD_rda1846dongle__) || defined(__BOARD_culV3__)
+ || defined(__BOARD_hhd70dongle__) || defined(__BOARD_rda1846dongle__) || defined(__BOARD_culV3__) || defined(__BOARD_slowpandongle__)
#define NUM_LEDS 1
#else
#define NUM_LEDS 0
@@ -62,6 +62,12 @@
#define LED_PINNUM 6
#endif
+#if defined(__BOARD_slowpandongle__)
+#define LED_PORT PORTC
+#define LED_DDR DDRC
+#define LED_PINNUM 2
+#endif
+
#if defined(__BOARD_arduino2009v2__) || defined(__BOARD_arduino2009__) || defined(__BOARD_arduino10000__) || defined(__BOARD_arduinoNG__)
#define LED_PORT PORTB
#define LED_DDR DDRB
diff --git a/lib/util.c b/lib/util.c
index 3aa1a37..cf2d5c4 100644
--- a/lib/util.c
+++ b/lib/util.c
@@ -51,6 +51,8 @@ void cpu_init(void)
#define BOOTLOADER_VEC 0x3800
#elif defined(__BOARD_hhd70dongle__) || defined(__BOARD_rda1846dongle__) || defined(__BOARD_culV3__)
#define BOOTLOADER_VEC 0x3800
+#elif defined(__BOARD_slowpandongle__)
+ #define BOOTLOADER_VEC 0x3800
#else
#define BOOTLOADER_VEC 0x0000
#endif
@@ -61,7 +63,7 @@ f_ptr_type start_bootloader = (f_ptr_type)BOOTLOADER_VEC;
void reset2bootloader(void)
{
#if defined(__BOARD_teensy1__) || defined(__BOARD_teensy1pp__) || defined(__BOARD_teensy2__) || defined(__BOARD_teensy2pp__) || \
- defined(__BOARD_hhd70dongle__) || defined(__BOARD_rda1846dongle__) || defined(__BOARD_culV3__) || \
+ defined(__BOARD_hhd70dongle__) || defined(__BOARD_rda1846dongle__) || defined(__BOARD_culV3__) || defined(__BOARD_slowpandongle__) || \
defined(__BOARD_minimus__) || defined(__BOARD_minimus32__)
cli();
// disable watchdog, if enabled
@@ -90,7 +92,7 @@ void reset2bootloader(void)
TIMSK0 = 0; TIMSK1 = 0; TIMSK2 = 0; TIMSK3 = 0; UCSR1B = 0; TWCR = 0;
DDRA = 0; DDRB = 0; DDRC = 0; DDRD = 0; DDRE = 0; DDRF = 0;
PORTA = 0; PORTB = 0; PORTC = 0; PORTD = 0; PORTE = 0; PORTF = 0;
- #elif defined(__BOARD_minimus__)
+ #elif defined(__BOARD_minimus__) || defined(__BOARD_slowpandongle__)
EIMSK = 0; PCICR = 0; SPCR = 0; ACSR = 0; EECR = 0;
TIMSK0 = 0; TIMSK1 = 0; UCSR1B = 0;
DDRB = 0; DDRC = 0; DDRD = 0;
diff --git a/usb-led/Makefile b/usb-led/Makefile
index 1f3476a..d642743 100644
--- a/usb-led/Makefile
+++ b/usb-led/Makefile
@@ -21,7 +21,7 @@
##
NAME := usb-led
-BOARD_TYPE := rda1846dongle
+BOARD_TYPE := slowpandongle
OBJ := $(NAME).o
LIBS := util led lufa-descriptor-usbserial usbio
EXTERNAL_LIBS := lufa