Pull out common options in the StaticAnalysisTest build test makefile into a seperate...
[pub/USBasp.git] / LUFA / Scheduler / Scheduler.h
index 35f165f..630fbff 100644 (file)
@@ -1,13 +1,13 @@
 /*
              LUFA Library
 /*
              LUFA Library
-     Copyright (C) Dean Camera, 2011.
+     Copyright (C) Dean Camera, 2012.
 
   dean [at] fourwalledcubicle [dot] com
            www.lufa-lib.org
 */
 
 /*
 
   dean [at] fourwalledcubicle [dot] com
            www.lufa-lib.org
 */
 
 /*
-  Copyright 2011  Dean Camera (dean [at] fourwalledcubicle [dot] com)
+  Copyright 2012  Dean Camera (dean [at] fourwalledcubicle [dot] com)
 
   Permission to use, copy, modify, distribute, and sell this
   software and its documentation for any purpose is hereby granted
 
   Permission to use, copy, modify, distribute, and sell this
   software and its documentation for any purpose is hereby granted
@@ -38,6 +38,7 @@
  */
 
 /** \defgroup Group_Scheduler Simple Task Scheduler - LUFA/Scheduler/Scheduler.h
  */
 
 /** \defgroup Group_Scheduler Simple Task Scheduler - LUFA/Scheduler/Scheduler.h
+ *  \brief Simple round-robbin pseudo-task scheduler.
  *
  *  \deprecated This module is deprecated and will be removed in a future library release.
  *
  *
  *  \deprecated This module is deprecated and will be removed in a future library release.
  *
                        /** Contains the total number of tasks in the task list, irrespective of if the task's status is set to
                         *  \ref TASK_RUN or \ref TASK_STOP.
                         *
                        /** Contains the total number of tasks in the task list, irrespective of if the task's status is set to
                         *  \ref TASK_RUN or \ref TASK_STOP.
                         *
-                        *  \note This value should be treated as read-only, and never altered in user-code.
+                        *  \warning This value should be treated as read-only, and never altered in user-application code.
                         */
                        extern volatile uint_least8_t Scheduler_TotalTasks;
 
                         */
                        extern volatile uint_least8_t Scheduler_TotalTasks;
 
                                                                ATTR_NON_NULL_PTR_ARG(1) ATTR_ALWAYS_INLINE;
                        static inline void Scheduler_ResetDelay(SchedulerDelayCounter_t* const DelayCounter)
                        {
                                                                ATTR_NON_NULL_PTR_ARG(1) ATTR_ALWAYS_INLINE;
                        static inline void Scheduler_ResetDelay(SchedulerDelayCounter_t* const DelayCounter)
                        {
-                               ATOMIC_BLOCK(ATOMIC_RESTORESTATE)
-                               {
-                                       *DelayCounter = Scheduler_TickCounter;
-                               }
+                               uint_reg_t CurrentGlobalInt = GetGlobalInterruptMask();
+                               GlobalInterruptDisable();
+
+                               *DelayCounter = Scheduler_TickCounter;
+
+                               SetGlobalInterruptMask(CurrentGlobalInt);
                        }
 
                /* Function Prototypes: */
                        }
 
                /* Function Prototypes: */