Correct UC3 global interrupt functions.
[pub/USBasp.git] / LUFA / Drivers / USB / Core / UC3 / USBInterrupt_UC3.h
index 95a85cf..a9ad566 100644 (file)
                        static inline uint_reg_t USB_INT_GetGlobalEnableState(void)\r
                        {\r
                                GCC_MEMORY_BARRIER();\r
-                               return (__builtin_mfsr(AVR32_SR) & AVR32_SR_GM);\r
+                               return __builtin_mfsr(AVR32_SR);\r
                        }\r
 \r
                        static inline void USB_INT_SetGlobalEnableState(uint_reg_t GlobalIntState) ATTR_ALWAYS_INLINE;\r
                        static inline void USB_INT_SetGlobalEnableState(uint_reg_t GlobalIntState)\r
                        {\r
                                GCC_MEMORY_BARRIER();\r
-                               __builtin_ssrf(AVR32_SR_GM_OFFSET, GlobalIntState);\r
+                               if (GlobalIntState & AVR32_SR_GM)\r
+                                 __builtin_ssrf(AVR32_SR_GM_OFFSET);\r
                                GCC_MEMORY_BARRIER();\r
                        }\r
                \r