diff options
| author | Dean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28> | 2011-04-08 05:05:05 +0000 |
|---|---|---|
| committer | Dean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28> | 2011-04-08 05:05:05 +0000 |
| commit | 5f7811e9d902b03c6af11f2820cf11b9c0bac154 (patch) | |
| tree | 6fceed835501d02bdb8a0449fb8e7e035329e39b /LUFA/Drivers/USB/Core/UC3 | |
| parent | 6d221c9c8267a84329271dfe5f04886978eb58a8 (diff) | |
Correct UC3 global interrupt functions.
Replace all calls and references to _delay_ms() in the code with the architecture-agnostic Delay_MS() function.
Improve code generation for the Delay_MS() function on the AVR8 architecture when called with a constant input.
git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1730 d5102386-fcda-11dd-9fdb-3debd5008f28
Diffstat (limited to 'LUFA/Drivers/USB/Core/UC3')
| -rw-r--r-- | LUFA/Drivers/USB/Core/UC3/Host_UC3.c | 2 | ||||
| -rw-r--r-- | LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.h | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/LUFA/Drivers/USB/Core/UC3/Host_UC3.c b/LUFA/Drivers/USB/Core/UC3/Host_UC3.c index b557ff0e..88a7df5c 100644 --- a/LUFA/Drivers/USB/Core/UC3/Host_UC3.c +++ b/LUFA/Drivers/USB/Core/UC3/Host_UC3.c @@ -273,7 +273,7 @@ static void USB_Host_ResetDevice(void) break;
}
- _delay_ms(1);
+ Delay_MS(1);
}
if (HSOFIEnabled)
diff --git a/LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.h b/LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.h index 95a85cf6..a9ad5661 100644 --- a/LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.h +++ b/LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.h @@ -87,14 +87,15 @@ static inline uint_reg_t USB_INT_GetGlobalEnableState(void)
{
GCC_MEMORY_BARRIER();
- return (__builtin_mfsr(AVR32_SR) & AVR32_SR_GM);
+ return __builtin_mfsr(AVR32_SR);
}
static inline void USB_INT_SetGlobalEnableState(uint_reg_t GlobalIntState) ATTR_ALWAYS_INLINE;
static inline void USB_INT_SetGlobalEnableState(uint_reg_t GlobalIntState)
{
GCC_MEMORY_BARRIER();
- __builtin_ssrf(AVR32_SR_GM_OFFSET, GlobalIntState);
+ if (GlobalIntState & AVR32_SR_GM)
+ __builtin_ssrf(AVR32_SR_GM_OFFSET);
GCC_MEMORY_BARRIER();
}
|
