diff options
-rw-r--r-- | lib/usbio.c | 4 | ||||
-rw-r--r-- | lib/util.c | 2 | ||||
-rw-r--r-- | lib/util.h | 2 |
3 files changed, 8 insertions, 0 deletions
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(); } @@ -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 @@ -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 |