]> rtime.felk.cvut.cz Git - arc.git/blob - include/sleep.h
Merge branch 'mikulka' of git@rtime.felk.cvut.cz:arc into mikulka
[arc.git] / include / sleep.h
1 /* -------------------------------- Arctic Core ------------------------------\r
2  * Arctic Core - the open source AUTOSAR platform http://arccore.com\r
3  *\r
4  * Copyright (C) 2009  ArcCore AB <contact@arccore.com>\r
5  *\r
6  * This source code is free software; you can redistribute it and/or modify it\r
7  * under the terms of the GNU General Public License version 2 as published by the\r
8  * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.\r
9  *\r
10  * This program is distributed in the hope that it will be useful, but\r
11  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
12  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License\r
13  * for more details.\r
14  * -------------------------------- Arctic Core ------------------------------*/\r
15 \r
16 #ifndef SLEEP_H_\r
17 #define SLEEP_H_\r
18 \r
19 #include "Os.h"\r
20 \r
21 #define SLEEP(_x_) \\r
22 do{ \\r
23         TaskType task; \\r
24         GetTaskID(&task); \\r
25         Sleep(_x_, task, EVENT_MASK_SLEEP_ALARM ); \\r
26         WaitEvent(EVENT_MASK_SLEEP_ALARM); \\r
27         ClearEvent(EVENT_MASK_SLEEP_ALARM); \\r
28 }while(0);\r
29 \r
30 void Sleep(uint32_t nofTicks, TaskType TaskID, EventMaskType Mask );\r
31 void SleepInit();\r
32 \r
33 #endif /* SLEEP_H_ */\r