summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/util.c17
-rw-r--r--usb-led/Makefile2
-rw-r--r--usb-led/usb-led.c1
3 files changed, 18 insertions, 2 deletions
diff --git a/lib/util.c b/lib/util.c
index 984d5c9..6624699 100644
--- a/lib/util.c
+++ b/lib/util.c
@@ -45,6 +45,10 @@ void cpu_init(void)
#define BOOTLOADER_VEC 0xFC00
#elif defined(__BOARD_teensy2pp__)
#define BOOTLOADER_VEC 0x1FC00
+#elif defined(__BOARD_minimus__)
+ #define BOOTLOADER_VEC 0x3000
+#elif defined(__BOARD_minimus32__)
+ #define BOOTLOADER_VEC 0x3800
#elif defined(__BOARD_hhd70dongle__)
#define BOOTLOADER_VEC 0x3800
#else
@@ -56,7 +60,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__)
+#if defined(__BOARD_teensy1__) || defined(__BOARD_teensy1pp__) || defined(__BOARD_teensy2__) || defined(__BOARD_teensy2pp__) || \
+ defined(__BOARD_hhd70dongle__) || defined(__BOARD_minimus__) || defined(__BOARD_minimus32__)
cli();
// disable watchdog, if enabled
// disable all peripherals
@@ -84,6 +89,16 @@ 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__)
+ EIMSK = 0; PCICR = 0; SPCR = 0; ACSR = 0; EECR = 0;
+ TIMSK0 = 0; TIMSK1 = 0; UCSR1B = 0;
+ DDRB = 0; DDRC = 0; DDRD = 0;
+ PORTB = 0; PORTC = 0; PORTD = 0;
+ #elif defined(__BOARD_minimus32__)
+ EIMSK = 0; PCICR = 0; SPCR = 0; ACSR = 0; EECR = 0;
+ TIMSK0 = 0; TIMSK1 = 0; UCSR1B = 0;
+ DDRB = 0; DDRC = 0; DDRD = 0;
+ PORTB = 0; PORTC = 0; PORTD = 0;
#elif defined(__BOARD_hhd70dongle__)
EIMSK = 0; PCICR = 0; SPCR = 0; ACSR = 0; EECR = 0; ADCSRA = 0;
TIMSK0 = 0; TIMSK1 = 0; TIMSK3 = 0; TIMSK4 = 0; UCSR1B = 0; TWCR = 0;
diff --git a/usb-led/Makefile b/usb-led/Makefile
index 020e38a..8e23877 100644
--- a/usb-led/Makefile
+++ b/usb-led/Makefile
@@ -21,7 +21,7 @@
##
NAME := usb-led
-BOARD_TYPE := teensy2
+BOARD_TYPE := minimus
OBJ := $(NAME).o
LIBS := util led lufa-descriptor-usbserial
EXTERNAL_LIBS := lufa
diff --git a/usb-led/usb-led.c b/usb-led/usb-led.c
index 5493ebc..a62a063 100644
--- a/usb-led/usb-led.c
+++ b/usb-led/usb-led.c
@@ -76,6 +76,7 @@ void handle_cmd(uint8_t cmd)
case '0': led_off(); break;
case '1': led_on(); break;
case 't': led_toggle(); break;
+ case 'r': reset2bootloader(); break;
default: CDC_Device_SendString(&VirtualSerial_CDC_Interface, "error\n"); return;
}
CDC_Device_SendString(&VirtualSerial_CDC_Interface, "ok\n");