Main Page   Modules   Data Structures   File List   Globals  

time.h

Go to the documentation of this file.
00001 /*
00002 Copyright (c) 2002, 2003, Oliver Tscherwitschke
00003 All rights reserved.
00004 
00005 Redistribution and use in source and binary forms, with or without
00006 modification, are permitted provided that the following conditions are met:
00007 
00008 1. Redistributions of source code must retain the above copyright notice,
00009    this list of conditions and the following disclaimer.
00010 2. Redistributions in binary form must reproduce the above copyright notice,
00011    this list of conditions and the following disclaimer in the documentation
00012    and/or other materials provided with the distribution.
00013 3. The name of the author may not be used to endorse or promote products
00014    derived from this software without specific prior written permission.
00015 
00016 THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
00017 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
00018 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
00019 EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00020 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00021 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
00022 OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
00023 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
00024 OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
00025 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00026 */
00027 
00040 #ifndef TIME_H
00041 #define TIME_H
00042 
00043 
00044 /* 
00045  * constants
00046  */
00047 
00049 #define TICKS_PER_SEC   256
00050 
00051 #define MS10        (TICKS_PER_SEC / 100)
00052 #define MS20        (TICKS_PER_SEC / 50)
00053 #define MS50        (TICKS_PER_SEC / 20)
00054 #define MS100       (TICKS_PER_SEC / 10)
00055 #define MS125       (TICKS_PER_SEC / 8)
00056 #define MS200       (TICKS_PER_SEC / 5)
00057 #define MS250       (TICKS_PER_SEC / 4)
00058 #define MS500       (TICKS_PER_SEC / 2)
00059 #define MS1000       TICKS_PER_SEC
00060 
00061 #define SEC1         TICKS_PER_SEC
00062 #define SEC2        (TICKS_PER_SEC * 2)
00063 #define SEC5        (TICKS_PER_SEC * 5)
00064 #define SEC10       (TICKS_PER_SEC * 10)
00065 #define SEC20       (TICKS_PER_SEC * 20)
00066 #define SEC30       (TICKS_PER_SEC * 30)
00067 #define SEC40       (TICKS_PER_SEC * 40)
00068 #define SEC50       (TICKS_PER_SEC * 50)
00069 #define SEC60       (TICKS_PER_SEC * 60)
00070 
00071 #define MIN1        (TICKS_PER_SEC * 60)
00072 #define MIN2        (MIN1 * 2)
00073 #define MIN5        (MIN1 * 5)
00074 #define MIN10       (MIN1 * 10)
00075 
00076 #define INFINITE    0xffffffffL
00077 
00078 
00079 
00080 /*
00081  * function prototypes
00082  */
00083 
00084 inline uint32_t otosGetTicks(void);
00085 void            otosSleep(uint32_t ticks);
00086 void            otosDelay(uint32_t ticks);
00087 inline void     otosSetTickHook(void (*pFunc)(void));
00088 uint32_t        otosGetTickDiff(uint32_t earlier);
00089 
00090 #endif
00091 

Generated on Sat Jan 25 18:41:43 2003 for otOS by doxygen1.3-rc2