forked from mirror/qmk_firmware
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.
This commit is contained in:
@@ -273,7 +273,7 @@ static void USB_Host_ResetDevice(void)
|
||||
break;
|
||||
}
|
||||
|
||||
_delay_ms(1);
|
||||
Delay_MS(1);
|
||||
}
|
||||
|
||||
if (HSOFIEnabled)
|
||||
|
||||
@@ -273,7 +273,7 @@ static void USB_Host_ResetDevice(void)
|
||||
break;
|
||||
}
|
||||
|
||||
_delay_ms(1);
|
||||
Delay_MS(1);
|
||||
}
|
||||
|
||||
if (HSOFIEnabled)
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user