summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2013-02-27 14:39:44 +0000
committerChristian Pointner <equinox@spreadspace.org>2013-02-27 14:39:44 +0000
commitb85d500785e3c6e841d957e45a0be1244fbc3bb2 (patch)
treed6182a2d08f900754360ee5dd4e68c313036a9fc
parentusb-adc example for sharp dustsensor (diff)
fixed culV3 reset2bootloader
added Board rda1846dongle git-svn-id: https://svn.spreadspace.org/avr/trunk@201 aa12f405-d877-488e-9caf-2d797e2a1cc7
-rw-r--r--defines.mk7
-rw-r--r--lib/led.c4
-rw-r--r--lib/util.c7
-rw-r--r--usb-led/Makefile2
4 files changed, 14 insertions, 6 deletions
diff --git a/defines.mk b/defines.mk
index 1980c38..40081a9 100644
--- a/defines.mk
+++ b/defines.mk
@@ -79,6 +79,13 @@ ifeq ($(BOARD_TYPE),hhd70dongle)
F_USB = $(F_CPU)
PROG := DFU
endif
+ifeq ($(BOARD_TYPE),rda1846dongle)
+ MCU := atmega32u4
+ ARCH = AVR8
+ F_CPU := 16000000
+ F_USB = $(F_CPU)
+ PROG := DFU
+endif
ifeq ($(BOARD_TYPE),culV3)
MCU := atmega32u4
ARCH = AVR8
diff --git a/lib/led.c b/lib/led.c
index 7305c00..4e08d6f 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_culV3__)
+ || defined(__BOARD_hhd70dongle__) || defined(__BOARD_rda1846dongle__) || defined(__BOARD_culV3__)
#define NUM_LEDS 1
#else
#define NUM_LEDS 0
@@ -56,7 +56,7 @@
#define LED2_PINNUM 6
#endif
-#if defined(__BOARD_hhd70dongle__) || defined(__BOARD_culV3__)
+#if defined(__BOARD_hhd70dongle__) || defined(__BOARD_rda1846dongle__) || defined(__BOARD_culV3__)
#define LED_PORT PORTE
#define LED_DDR DDRE
#define LED_PINNUM 6
diff --git a/lib/util.c b/lib/util.c
index 3de042e..3aa1a37 100644
--- a/lib/util.c
+++ b/lib/util.c
@@ -49,7 +49,7 @@ void cpu_init(void)
#define BOOTLOADER_VEC 0x3000
#elif defined(__BOARD_minimus32__)
#define BOOTLOADER_VEC 0x3800
-#elif defined(__BOARD_hhd70dongle__) || defined(__BOARD_culV3__)
+#elif defined(__BOARD_hhd70dongle__) || defined(__BOARD_rda1846dongle__) || defined(__BOARD_culV3__)
#define BOOTLOADER_VEC 0x3800
#else
#define BOOTLOADER_VEC 0x0000
@@ -61,7 +61,8 @@ 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_culV3__) || defined(__BOARD_minimus__) || defined(__BOARD_minimus32__)
+ defined(__BOARD_hhd70dongle__) || defined(__BOARD_rda1846dongle__) || defined(__BOARD_culV3__) || \
+ defined(__BOARD_minimus__) || defined(__BOARD_minimus32__)
cli();
// disable watchdog, if enabled
// disable all peripherals
@@ -99,7 +100,7 @@ void reset2bootloader(void)
TIMSK0 = 0; TIMSK1 = 0; UCSR1B = 0;
DDRB = 0; DDRC = 0; DDRD = 0;
PORTB = 0; PORTC = 0; PORTD = 0;
- #elif defined(__BOARD_hhd70dongle__) || defined(__culV3__)
+ #elif defined(__BOARD_hhd70dongle__) || defined(__BOARD_rda1846dongle__) || defined(__BOARD_culV3__)
EIMSK = 0; PCICR = 0; SPCR = 0; ACSR = 0; EECR = 0; ADCSRA = 0;
TIMSK0 = 0; TIMSK1 = 0; TIMSK3 = 0; TIMSK4 = 0; UCSR1B = 0; TWCR = 0;
DDRB = 0; DDRC = 0; DDRD = 0; DDRE = 0; DDRF = 0; TWCR = 0;
diff --git a/usb-led/Makefile b/usb-led/Makefile
index a353ba7..1f3476a 100644
--- a/usb-led/Makefile
+++ b/usb-led/Makefile
@@ -21,7 +21,7 @@
##
NAME := usb-led
-BOARD_TYPE := teensy2
+BOARD_TYPE := rda1846dongle
OBJ := $(NAME).o
LIBS := util led lufa-descriptor-usbserial usbio
EXTERNAL_LIBS := lufa