aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Scheduler/Scheduler.c
diff options
context:
space:
mode:
Diffstat (limited to 'LUFA/Scheduler/Scheduler.c')
-rw-r--r--LUFA/Scheduler/Scheduler.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/LUFA/Scheduler/Scheduler.c b/LUFA/Scheduler/Scheduler.c
index 4e71d4d87..87a21491d 100644
--- a/LUFA/Scheduler/Scheduler.c
+++ b/LUFA/Scheduler/Scheduler.c
@@ -39,10 +39,12 @@ bool Scheduler_HasDelayElapsed(const uint_least16_t Delay,
SchedulerDelayCounter_t CurrentTickValue_LCL;
SchedulerDelayCounter_t DelayCounter_LCL;
- ATOMIC_BLOCK(ATOMIC_RESTORESTATE)
- {
- CurrentTickValue_LCL = Scheduler_TickCounter;
- }
+ uint_reg_t CurrentGlobalInt = USB_INT_GetGlobalEnableState();
+ USB_INT_GlobalDisable();
+
+ CurrentTickValue_LCL = Scheduler_TickCounter;
+
+ USB_INT_SetGlobalEnableState(CurrentGlobalInt);
DelayCounter_LCL = *DelayCounter;