From ec00d4ab268624e8f4a81e78304864f8bf361dc5 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sun, 27 Jan 2013 17:47:24 +0000 Subject: upgraded avr utils from spreadspace git-svn-id: https://svn.spreadspace.org/mur.sat@662 7de4ea59-55d0-425e-a1af-a3118ea81d4c --- software/avr.defines.mk | 23 +++++++++++++- software/avr.include.mk | 2 +- software/avr.lib/led.c | 63 +++++++++++++++++++++++++++++++++----- software/avr.lib/led.h | 4 +++ software/avr.lib/util.c | 19 +++++++++++- software/avr.lufa.mk | 5 ++- software/hhd70dongle/Makefile | 2 ++ software/hhd70dongle/c1101lib.c | 2 +- software/hhd70dongle/hhd70dongle.c | 4 +++ 9 files changed, 109 insertions(+), 15 deletions(-) diff --git a/software/avr.defines.mk b/software/avr.defines.mk index 3924941..2524f0d 100644 --- a/software/avr.defines.mk +++ b/software/avr.defines.mk @@ -52,6 +52,26 @@ ifeq ($(BOARD_TYPE),teensy2pp) PROG := teensy LUFA_BOARD = TEENSY2 endif +ifeq ($(BOARD_TYPE),minimus) + MCU := at90usb162 + ARCH = AVR8 + F_CPU := 16000000 + F_USB = $(F_CPU) + PROG := DFU + LUFA_BOARD = MINIMUS + RESET_FUNC := ../tools/reset_minimus + RESET_PARAM = "03eb:2ffa" +endif +ifeq ($(BOARD_TYPE),minimus32) + MCU := atmega32u2 + ARCH = AVR8 + F_CPU := 16000000 + F_USB = $(F_CPU) + PROG := DFU + LUFA_BOARD = MINIMUS + RESET_FUNC := ../tools/reset_minimus + RESET_PARAM = "03eb:2ff0" +endif ifeq ($(BOARD_TYPE),hhd70dongle) MCU := atmega32u4 ARCH = AVR8 @@ -111,7 +131,7 @@ ifeq ($(BOARD_TYPE),arduinoNG) UPLOAD_RATE := 19200 PROG_TYPE := stk500v1 AVRDUDE_PORT := /dev/ttyUSB0 - RESET_FUNC := ../tools/dummy_reset + RESET_FUNC := ../tools/reset_dummy endif ifeq ($(BOARD_TYPE),AvrNetIo) MCU := atmega32 @@ -149,6 +169,7 @@ CFLAGS += -Wstrict-prototypes CFLAGS += -I$(LIB_DIR) CFLAGS += -DF_CPU=$(F_CPU)UL CFLAGS += -D__BOARD_$(BOARD_TYPE)__ +CFLAGS += -DARCH=ARCH_$(ARCH) CFLAGS += -std=c99 diff --git a/software/avr.include.mk b/software/avr.include.mk index 3950dd1..b3b5d4a 100644 --- a/software/avr.include.mk +++ b/software/avr.include.mk @@ -43,7 +43,7 @@ LDFLAGS += -L./ ifdef LUFA_PATH CFLAGS += -I$(LUFA_PATH) CFLAGS += -DF_USB=$(F_USB)UL -CFLAGS += -DBOARD=BOARD_$(LUFA_BOARD) -DARCH=ARCH_$(ARCH) +CFLAGS += -DBOARD=BOARD_$(LUFA_BOARD) CFLAGS += $(LUFA_OPTS) endif diff --git a/software/avr.lib/led.c b/software/avr.lib/led.c index ea5bcc3..d567cef 100644 --- a/software/avr.lib/led.c +++ b/software/avr.lib/led.c @@ -24,13 +24,17 @@ #include "led.h" -#if defined(__BOARD_arduinoUno__) || defined(__BOARD_AvrNetIo__) -#define HAS_LED 0 +#if defined(__BOARD_minimus__) || defined(__BOARD_minimus32__) +#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__) +#define NUM_LEDS 1 #else -#define HAS_LED 1 +#define NUM_LEDS 0 #endif -#if defined(__BOARD_teensy1__) || defined(__BOARD_teensy1pp__) +#if defined(__BOARD_teensy1__) || defined(__BOARD_teensy1pp__) || defined(__BOARD_minimus__) || defined(__BOARD_minimus32__) #define LED_DIR 0 #else #define LED_DIR 1 @@ -42,6 +46,16 @@ #define LED_PINNUM 6 #endif +#if defined(__BOARD_minimus__) || defined(__BOARD_minimus32__) +#define LED_PORT PORTD +#define LED_DDR DDRD +#define LED_PINNUM 5 + +#define LED2_PORT PORTD +#define LED2_DDR DDRD +#define LED2_PINNUM 6 +#endif + #if defined(__BOARD_hhd70dongle__) #define LED_PORT PORTE #define LED_DDR DDRE @@ -56,15 +70,18 @@ void led_init(void) { -#if HAS_LED == 1 +#if NUM_LEDS >= 1 led_off(); LED_DDR = 1<= 2 + LED2_DDR |= 1<= 1 #if LED_DIR == 1 LED_PORT |= 1<= 1 #if LED_DIR == 1 LED_PORT &= ~(1<= 1 LED_PORT ^= 1<= 2 +#if LED_DIR == 1 + LED2_PORT |= 1<= 2 +#if LED_DIR == 1 + LED2_PORT &= ~(1<= 2 + LED2_PORT ^= 1<