diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2011-04-08 05:05:05 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2011-04-08 05:05:05 +0000 |
commit | de9bd767dc8578a45a195fb1e37dd4ff26ae9567 (patch) | |
tree | 6fceed835501d02bdb8a0449fb8e7e035329e39b /LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.h | |
parent | 70284d390f524e84e0539ad1e869366aaf94cf24 (diff) | |
download | lufa-de9bd767dc8578a45a195fb1e37dd4ff26ae9567.tar.gz lufa-de9bd767dc8578a45a195fb1e37dd4ff26ae9567.tar.bz2 lufa-de9bd767dc8578a45a195fb1e37dd4ff26ae9567.zip |
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.
Diffstat (limited to 'LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.h')
-rw-r--r-- | LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.h b/LUFA/Drivers/USB/Core/UC3/USBInterrupt_UC3.h index 95a85cf69..a9ad56611 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();
}
|