EE445M RTOS
Taken at the University of Texas Spring 2015
timekit.h
Go to the documentation of this file.
1 #ifndef __TIMEKIT__
2 #define __TIMEKIT__
3 
4 #define TK_MAX_PRINTBUFFER_LEN 20
5 
6 #define TK_PRINT_MODE_HOURS_MINUTES 0
7 #define TK_PRINT_MODE_HOURS_MINUTES_SECONDS 1
8 #define TK_PRINT_MODE_HOURS_MINUTES_SECONDS_MS 2
9 
10 #define TK_TIME_VALID 0
11 #define TK_TIME_INVALID_HOURS 1
12 #define TK_TIME_INVALID_MINUTES 2
13 #define TK_TIME_INVALID_SECONDS 3
14 #define TK_TIME_INVALID_MS 4
15 
16 #define TK_NUM_HOURS 24
17 #define TK_NUM_MINUTES 60
18 #define TK_NUM_SECONDS 60
19 #define TK_NUM_MS 1000
20 
21 typedef struct clocktime {
22  short hours;
23  short minutes;
24  short seconds;
25  short ms;
26  char mode;
28 } clocktime;
29 
30 clocktime* TKCreateTimeHandle(char mode);
32 void TKDestroy(clocktime* tm);
33 char* TKToString(clocktime* tm);
34 void TKIncrementHours(clocktime* tm, short hours);
35 void TKIncrementMinutes(clocktime* tm, short minutes);
36 void TKIncrementSeconds(clocktime* tm, short seconds);
37 void TKIncrementMS(clocktime* tm, short ms);
38 short TKValidateTime(clocktime* tm);
39 void TKCleanupTime(clocktime* tm);
40 
41 #endif /* __TIMEKIT__ */
void TKIncrementSeconds(clocktime *tm, short seconds)
Definition: timekit.c:89
clocktime * TKCreateTimeHandle(char mode)
Definition: timekit.c:14
void TKIncrementMinutes(clocktime *tm, short minutes)
Definition: timekit.c:69
char mode
Definition: timekit.h:26
#define TK_MAX_PRINTBUFFER_LEN
Definition: timekit.h:4
short seconds
Definition: timekit.h:24
clocktime * TKDuplicateTimeHandle(clocktime *th)
Definition: timekit.c:170
char printBuffer[20]
Definition: timekit.h:27
void TKIncrementMS(clocktime *tm, short ms)
Definition: timekit.c:109
void TKIncrementHours(clocktime *tm, short hours)
Definition: timekit.c:55
struct clocktime clocktime
void TKDestroy(clocktime *tm)
Definition: timekit.c:24
void TKCleanupTime(clocktime *tm)
Definition: timekit.c:147
short TKValidateTime(clocktime *tm)
Definition: timekit.c:131
short minutes
Definition: timekit.h:23
short hours
Definition: timekit.h:22
char * TKToString(clocktime *tm)
Definition: timekit.c:31
short ms
Definition: timekit.h:25