Subversion Repositories HomeAutomation

Rev

Rev 73 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 73 Rev 97
1
/*********************************************************************
1
/*********************************************************************
2
 *
2
 *
3
 *                  Ticker header file
3
 *                  Ticker header file
4
 *
4
 *
5
 *********************************************************************
5
 *********************************************************************
6
 * FileName:        Tick.h
6
 * FileName:        $HeadURL: https://svn.auml.se/svn/HomeAutomation/trunk/EmbeddedSoftware/PIC/canToSerial/Include/Tick.h $
7
 *
-
 
8
 * Author               Date    Comment
7
 * Last changed:    $LastChangedDate: 2006-11-14 21:22:17 +0100 (Tue, 14 Nov 2006) $
9
 *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8
 * By:              $LastChangedBy: johboh $
10
 * Johan Böhlin     21-10-06    Original        (Rev 1.0)
9
 * Revision:        $Revision: 97 $
11
 ********************************************************************/
10
 ********************************************************************/
12
 
11
 
13
#ifndef TICK_H
12
#ifndef TICK_H
14
#define TICK_H
13
#define TICK_H
15
 
14
 
16
#include <stackTasks.h>
15
#include <stackTasks.h>
17
 
16
 
18
typedef unsigned long TICK;
17
typedef unsigned long TICK;
19
 
18
 
20
#if !defined(TICKS_PER_SECOND)
19
#if !defined(TICKS_PER_SECOND)
21
    #error TICKS_PER_SECOND must be defined.
20
    #error TICKS_PER_SECOND must be defined.
22
#endif
21
#endif
23
 
22
 
24
#if !defined(TICK_PRESCALE_VALUE)
23
#if !defined(TICK_PRESCALE_VALUE)
25
    #error TICK_PRESCALE_VALUE must be defined.
24
    #error TICK_PRESCALE_VALUE must be defined.
26
#endif
25
#endif
27
 
26
 
28
#define TICK_PERIOD_MS          10
27
#define TICK_PERIOD_MS          10
29
#define TICK_SECOND             ((TICK)TICKS_PER_SECOND)
28
#define TICK_SECOND             ((TICK)TICKS_PER_SECOND)
30
 
29
 
31
 
30
 
32
/*
31
/*
33
 * Only Tick.c defines TICK_INCLUDE and thus defines Seconds
32
 * Only Tick.c defines TICK_INCLUDE and thus defines Seconds
34
 * and TickValue storage.
33
 * and TickValue storage.
35
 */
34
 */
36
#ifndef TICK_INCLUDE
35
#ifndef TICK_INCLUDE
37
extern TICK TickCount;
36
extern TICK TickCount;
38
#endif
37
#endif
39
 
38
 
40
void tickInit(void);
39
void tickInit(void);
41
TICK tickGet(void);
40
TICK tickGet(void);
42
void tickUpdate(void);
41
void tickUpdate(void);
43
 
42
 
44
#endif
43
#endif
45
 
44