root / trunk / cardbox / timer.h @ 139
History | View | Annotate | Download (1.79 KB)
1 |
/********
|
---|---|
2 |
* This file is part of Tooltron.
|
3 |
*
|
4 |
* Tooltron is free software: you can redistribute it and/or modify
|
5 |
* it under the terms of the Lesser GNU General Public License as published by
|
6 |
* the Free Software Foundation, either version 3 of the License, or
|
7 |
* (at your option) any later version.
|
8 |
*
|
9 |
* Tooltron is distributed in the hope that it will be useful,
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12 |
* Lesser GNU General Public License for more details.
|
13 |
* You should have received a copy of the Lesser GNU General Public License
|
14 |
* along with Tooltron. If not, see <http://www.gnu.org/licenses/>.
|
15 |
*
|
16 |
* Copyright 2009 Kevin Woo <kwoo@2ndt.com>
|
17 |
*
|
18 |
********/
|
19 |
/** @file timer.h
|
20 |
*
|
21 |
* @breif Timer functions
|
22 |
*
|
23 |
* @author Kevin Woo (kwoo)
|
24 |
*/
|
25 |
|
26 |
#ifndef TIMER_H
|
27 |
#define TIMER_H
|
28 |
|
29 |
/** @brief Max time that we can wait for a full packet from the server before we timeout */
|
30 |
#define TIME_OUT 5 |
31 |
|
32 |
/** Globals **/
|
33 |
volatile char seconds; //Seconds elapsed |
34 |
volatile char minutes; //Minutes exlapsed |
35 |
char timeout_flag; //Indicates that timeout has occured |
36 |
|
37 |
/** @brief Seconds that have elapsed since the timer started */
|
38 |
//extern volatile char seconds;
|
39 |
/** @brief Minutes that have elapsed since the timer started */
|
40 |
//extern volatile char minutes;
|
41 |
//extern char timeout_flag;
|
42 |
|
43 |
/** @brief Sets the registers to use the timer for couting in real time */
|
44 |
void init_timer(void); |
45 |
/** @brief Starts the timer from last position*/
|
46 |
void start_timer(void); |
47 |
/** @brief Stops the timer from counting*/
|
48 |
void stop_timer(void); |
49 |
/** @brief Resets the values of the timer to 0*/
|
50 |
void reset_timer(void); |
51 |
/** @brief Resets the timeout flag to 0 */
|
52 |
void reset_timeout_flag(void); |
53 |
/** @brief Sets the timeout flag to 1 */
|
54 |
void set_timeout_flag(void); |
55 |
|
56 |
#endif
|