]> rtime.felk.cvut.cz Git - orte.git/blob - orte/liborte/ORTEMisc.c
36c0d3ca0e9ec4865433f757272622938371f33e
[orte.git] / orte / liborte / ORTEMisc.c
1 /*
2  *  $Id: ORTEMisc.c,v 0.0.0.1           2004/01/27 
3  *
4  *  DEBUG:  section 34                  miscellaneous functions
5  *
6  *  -------------------------------------------------------------------  
7  *                                ORTE                                 
8  *                      Open Real-Time Ethernet                       
9  *                                                                    
10  *                      Copyright (C) 2001-2006                       
11  *  Department of Control Engineering FEE CTU Prague, Czech Republic  
12  *                      http://dce.felk.cvut.cz                       
13  *                      http://www.ocera.org                          
14  *                                                                    
15  *  Author:              Petr Smolik    petr.smolik@wo.cz             
16  *  Advisor:             Pavel Pisa                                   
17  *  Project Responsible: Zdenek Hanzalek                              
18  *  --------------------------------------------------------------------
19  *
20  *  This program is free software; you can redistribute it and/or modify
21  *  it under the terms of the GNU General Public License as published by
22  *  the Free Software Foundation; either version 2 of the License, or
23  *  (at your option) any later version.
24  *  
25  *  This program is distributed in the hope that it will be useful,
26  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
27  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
28  *  GNU General Public License for more details.
29  *  
30  */ 
31  
32 #include "orte_all.h"
33
34 inline void 
35 ORTESleepMs(unsigned int ms) {
36   #if defined(CONFIG_ORTE_UNIX) && defined (HAVE_UNISTD_H)
37     usleep(ms*1000);
38   #elif defined CONFIG_ORTE_RTL 
39     usleep(ms*1000);
40   #elif defined CONFIG_ORTE_WIN 
41     Sleep(ms);
42   #elif defined CONFIG_ORTE_RTAI
43     rt_sleep(nano2count(ms*1000000));
44   #else
45     #error "NOT DEFINED SLEEP FUNCTION!"
46   #endif
47 }