From ae6994cfd6bae1b17487827ad46a184ef45e8cd1 Mon Sep 17 00:00:00 2001 From: Bernhard Tittelbach Date: Sat, 5 Oct 2013 15:06:06 +0000 Subject: make it work with minimus and co git-svn-id: https://svn.spreadspace.org/avr/trunk@231 aa12f405-d877-488e-9caf-2d797e2a1cc7 --- lib/usbio.c | 4 ++++ lib/util.c | 2 ++ lib/util.h | 2 ++ 3 files changed, 8 insertions(+) diff --git a/lib/usbio.c b/lib/usbio.c index 6a7f76e..72151bc 100644 --- a/lib/usbio.c +++ b/lib/usbio.c @@ -83,7 +83,11 @@ void usbio_init(void) void usbio_task(void) { +#if defined(USB_SERIES_4_AVR) || defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR) if(USB_DeviceState == DEVICE_STATE_Unattached && USB_VBUS_GetStatus()) { +#else + if(USB_DeviceState == DEVICE_STATE_Unattached) { +#endif USB_Disable(); USB_Init(); } diff --git a/lib/util.c b/lib/util.c index 8b74dfb..104f2b6 100644 --- a/lib/util.c +++ b/lib/util.c @@ -37,6 +37,7 @@ void cpu_init(void) CPU_PRESCALE(0); } +#if defined JTD void jtag_disable(void) { uint8_t tempreg; @@ -47,6 +48,7 @@ void jtag_disable(void) : [tempreg] "=d" (tempreg) : [mcucr] "I" (_SFR_IO_ADDR(MCUCR)), [jtd] "M" (_BV(JTD))); } +#endif #if defined(__BOARD_teensy1__) #define BOOTLOADER_VEC 0x3E00 diff --git a/lib/util.h b/lib/util.h index 18c1eca..bdd2968 100644 --- a/lib/util.h +++ b/lib/util.h @@ -24,7 +24,9 @@ #define SPREADAVR_util_h_INCLUDED void cpu_init(void); +#if defined JTD void jtag_disable(void); +#endif void reset2bootloader(void); #endif -- cgit v1.2.3