\section{aversive\_\-10-03-12/modules/base/scheduler/scheduler\_\-interrupt.c File Reference}
\label{scheduler__interrupt_8c}\index{aversive\_\-10-03-12/modules/base/scheduler/scheduler\_\-interrupt.c@{aversive\_\-10-03-12/modules/base/scheduler/scheduler\_\-interrupt.c}}
{\tt \#include $<$stdlib.h$>$}\par
{\tt \#include $<$aversive.h$>$}\par
{\tt \#include $<$scheduler\_\-config.h$>$}\par
{\tt \#include $<$scheduler\_\-private.h$>$}\par
\subsection*{Functions}
\begin{CompactItemize}
\item 
uint8\_\-t {\bf scheduler\_\-disable\_\-save} (void)
\item 
void {\bf scheduler\_\-enable\_\-restore} (uint8\_\-t old\_\-prio)
\item 
void {\bf scheduler\_\-interrupt} (void)
\end{CompactItemize}


\subsection{Function Documentation}
\index{scheduler\_\-interrupt.c@{scheduler\_\-interrupt.c}!scheduler\_\-disable\_\-save@{scheduler\_\-disable\_\-save}}
\index{scheduler\_\-disable\_\-save@{scheduler\_\-disable\_\-save}!scheduler_interrupt.c@{scheduler\_\-interrupt.c}}
\subsubsection[scheduler\_\-disable\_\-save]{\setlength{\rightskip}{0pt plus 5cm}uint8\_\-t scheduler\_\-disable\_\-save (void)}\label{scheduler__interrupt_8c_ce0425932a743d3fab7b1dee1b1f4eba}


Temporarily disable scheduler events. You may loose precision in events schedule. It returns the current priority of the scheduler. 

Definition at line 34 of file scheduler\_\-interrupt.c.

Referenced by AX12\_\-send().\index{scheduler\_\-interrupt.c@{scheduler\_\-interrupt.c}!scheduler\_\-enable\_\-restore@{scheduler\_\-enable\_\-restore}}
\index{scheduler\_\-enable\_\-restore@{scheduler\_\-enable\_\-restore}!scheduler_interrupt.c@{scheduler\_\-interrupt.c}}
\subsubsection[scheduler\_\-enable\_\-restore]{\setlength{\rightskip}{0pt plus 5cm}void scheduler\_\-enable\_\-restore (uint8\_\-t {\em old\_\-prio})}\label{scheduler__interrupt_8c_b377e2aac32c7ffaa5705276dbed698a}


Re-enable scheduler after a call to \doxyref{scheduler\_\-disable\_\-save()}{p.}{scheduler_8h_ce0425932a743d3fab7b1dee1b1f4eba}. 

Definition at line 42 of file scheduler\_\-interrupt.c.

Referenced by AX12\_\-send().\index{scheduler\_\-interrupt.c@{scheduler\_\-interrupt.c}!scheduler\_\-interrupt@{scheduler\_\-interrupt}}
\index{scheduler\_\-interrupt@{scheduler\_\-interrupt}!scheduler_interrupt.c@{scheduler\_\-interrupt.c}}
\subsubsection[scheduler\_\-interrupt]{\setlength{\rightskip}{0pt plus 5cm}void scheduler\_\-interrupt (void)}\label{scheduler__interrupt_8c_7253eb381f3f978df771b01964ec6fcd}


this function is called from a timer interruption. If an event has to be scheduled, it will execute the fonction (IRQ are allowed during the execution of the function). This interruption can be interrupted by itself too, in this case only events with a higher priority can be scheduled.

We assume that this function is called from a \doxyref{SIGNAL()}{p.}{i2c_8c_76216358046f104b52928cb3841a144e}, with global interrupt flag disabled --$>$ that's why we can use \doxyref{cli()}{p.}{aversive_8h_68c330e94fe121eba993e5a5973c3162} and \doxyref{sei()}{p.}{aversive_8h_ad5ebd34cb344c26ac87594f79b06b73} instead of \doxyref{IRQ\_\-LOCK(flags)}{p.}{irq__lock_8h_56988e8d5a77d00c601fa2ec150da1b4}. 

Definition at line 59 of file scheduler\_\-interrupt.c.

References cli, event\_\-t::current\_\-time, event\_\-t::data, DUMP\_\-EVENTS, event\_\-t::f, g\_\-tab\_\-event, i, event\_\-t::period, event\_\-t::priority, SCHEDULER\_\-EVENT\_\-ACTIVE, SCHEDULER\_\-EVENT\_\-DELETING, SCHEDULER\_\-EVENT\_\-FREE, SCHEDULER\_\-EVENT\_\-SCHEDULED, sei, SLIST\_\-FIRST, SLIST\_\-FOREACH, SLIST\_\-HEAD, SLIST\_\-INIT, SLIST\_\-INSERT\_\-AFTER, SLIST\_\-INSERT\_\-HEAD, SLIST\_\-NEXT, and event\_\-t::state.