Subversion Repositories HomeAutomation

Rev

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

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