diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2012-05-21 20:48:57 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2012-05-21 20:48:57 +0000 |
commit | 5ec9d04bcaa0f48098441f36dd6d048ff32ecb99 (patch) | |
tree | 0edbda5dabbd0fb6295b27aa7db12baa96438f7e | |
parent | 5f709e281eec223c5de9766a99bdd54339e149cb (diff) | |
parent | 55283475d3e1c8191b3569524d35066566ceb0e7 (diff) | |
download | lufa-5ec9d04bcaa0f48098441f36dd6d048ff32ecb99.tar.gz lufa-5ec9d04bcaa0f48098441f36dd6d048ff32ecb99.tar.bz2 lufa-5ec9d04bcaa0f48098441f36dd6d048ff32ecb99.zip |
AppConfigHeaders: Merge in latest trunk.
-rw-r--r-- | Bootloaders/CDC/BootloaderCDC.c | 6 | ||||
-rw-r--r-- | Bootloaders/DFU/BootloaderDFU.c | 11 | ||||
-rw-r--r-- | Projects/AVRISP-MKII/AVRISP-MKII.c | 8 | ||||
-rw-r--r-- | Projects/XPLAINBridge/XPLAINBridge.c | 5 |
4 files changed, 21 insertions, 9 deletions
diff --git a/Bootloaders/CDC/BootloaderCDC.c b/Bootloaders/CDC/BootloaderCDC.c index 211b054e3..7bff89994 100644 --- a/Bootloaders/CDC/BootloaderCDC.c +++ b/Bootloaders/CDC/BootloaderCDC.c @@ -73,7 +73,13 @@ void Application_Jump_Check(void) /* If the reset source was the bootloader and the key is correct, clear it and jump to the application */ if ((MCUSR & (1 << WDRF)) && (MagicBootKey == MAGIC_BOOT_KEY)) { + /* Turn off the watchdog */ + MCUSR &= ~(1<<WDRF); + wdt_disable(); + + /* Clear the boot key and jump to the user application */ MagicBootKey = 0; + // cppcheck-suppress constStatement ((void (*)(void))0x0000)(); } diff --git a/Bootloaders/DFU/BootloaderDFU.c b/Bootloaders/DFU/BootloaderDFU.c index 233e145ae..528e8cb0c 100644 --- a/Bootloaders/DFU/BootloaderDFU.c +++ b/Bootloaders/DFU/BootloaderDFU.c @@ -106,11 +106,18 @@ uint32_t MagicBootKey ATTR_NO_INIT; */ void Application_Jump_Check(void) { - // If the reset source was the bootloader and the key is correct, clear it and jump to the application + /* If the reset source was the bootloader and the key is correct, clear it and jump to the application */ if ((MCUSR & (1 << WDRF)) && (MagicBootKey == MAGIC_BOOT_KEY)) { + /* Turn off the watchdog */ + MCUSR &= ~(1<<WDRF); + wdt_disable(); + + /* Clear the boot key and jump to the user application */ MagicBootKey = 0; - AppStartPtr(); + + // cppcheck-suppress constStatement + ((void (*)(void))0x0000)(); } } diff --git a/Projects/AVRISP-MKII/AVRISP-MKII.c b/Projects/AVRISP-MKII/AVRISP-MKII.c index 71b6da7cd..c4623fd8e 100644 --- a/Projects/AVRISP-MKII/AVRISP-MKII.c +++ b/Projects/AVRISP-MKII/AVRISP-MKII.c @@ -97,12 +97,12 @@ void EVENT_USB_Device_ConfigurationChanged(void) { bool ConfigSuccess = true; - /* Setup AVRISP Data Endpoint(s) */ + /* Setup AVRISP Data OUT endpoint */ ConfigSuccess &= Endpoint_ConfigureEndpoint(AVRISP_DATA_OUT_EPADDR, EP_TYPE_BULK, AVRISP_DATA_EPSIZE, 1); - #if defined(LIBUSB_DRIVER_COMPAT) - ConfigSuccess &= Endpoint_ConfigureEndpoint(AVRISP_DATA_IN_EPADDR, EP_TYPE_BULK, AVRISP_DATA_EPSIZE, 1); - #endif + /* Setup AVRISP Data IN endpoint if it is using a physically different endpoint */ + if ((AVRISP_DATA_IN_EPADDR & ENDPOINT_EPNUM_MASK) != (AVRISP_DATA_OUT_EPADDR & ENDPOINT_EPNUM_MASK)) + ConfigSuccess &= Endpoint_ConfigureEndpoint(AVRISP_DATA_IN_EPADDR, EP_TYPE_BULK, AVRISP_DATA_EPSIZE, 1); /* Indicate endpoint configuration success or failure */ LEDs_SetAllLEDs(ConfigSuccess ? LEDMASK_USB_READY : LEDMASK_USB_ERROR); diff --git a/Projects/XPLAINBridge/XPLAINBridge.c b/Projects/XPLAINBridge/XPLAINBridge.c index 3bd1fbf55..7909cc45c 100644 --- a/Projects/XPLAINBridge/XPLAINBridge.c +++ b/Projects/XPLAINBridge/XPLAINBridge.c @@ -226,9 +226,8 @@ void EVENT_USB_Device_ConfigurationChanged(void) { ConfigSuccess &= Endpoint_ConfigureEndpoint(AVRISP_DATA_OUT_EPADDR, EP_TYPE_BULK, AVRISP_DATA_EPSIZE, 1); - #if defined(LIBUSB_DRIVER_COMPAT) - ConfigSuccess &= Endpoint_ConfigureEndpoint(AVRISP_DATA_IN_EPADDR, EP_TYPE_BULK, AVRISP_DATA_EPSIZE, 1); - #endif + if ((AVRISP_DATA_IN_EPADDR & ENDPOINT_EPNUM_MASK) != (AVRISP_DATA_OUT_EPADDR & ENDPOINT_EPNUM_MASK)) + ConfigSuccess &= Endpoint_ConfigureEndpoint(AVRISP_DATA_IN_EPADDR, EP_TYPE_BULK, AVRISP_DATA_EPSIZE, 1); /* Configure the V2 protocol packet handler */ V2Protocol_Init(); |