1 |
/* mija 2009 clock |
1 |
/* mija 2009 clock |
2 |
usage: |
2 |
usage: |
3 |
1. declare Clock_t clock |
3 |
1. declare Clock_t clock |
4 |
2. define TIKOFSEC - tiks per sec in any timers interrupts proderude |
4 |
2. define TIKOFSEC - tiks per sec in any timers interrupts proderude |
5 |
3. periodicaly polling ProsecClock(), for precisions 1 of TIKOFSEC |
5 |
3. periodicaly polling ProsecClock(), for precisions 1 of TIKOFSEC |
6 |
|
6 |
|
7 |
ver.: 0.0 - start |
7 |
ver.: 0.0 - start |
8 |
*/ |
8 |
*/ |
9 |
|
9 |
|
10 |
|
10 |
|
11 |
#ifndef __clock_h_included__ |
11 |
#ifndef __clock_h_included__ |
12 |
#define __clock_h_included__ |
12 |
#define __clock_h_included__ |
13 |
|
13 |
|
14 |
#define TIKSOFSEC 125 |
14 |
#define TIKSOFSEC 125 |
15 |
|
15 |
|
16 |
typedef struct Clockt{ |
16 |
typedef struct Clockt{ |
17 |
uint8_t hour; |
17 |
uint8_t hour; |
18 |
uint8_t min; |
18 |
uint8_t min; |
19 |
uint8_t sec; |
19 |
uint8_t sec; |
20 |
}Clockt_t; |
20 |
}Clockt_t; |
21 |
|
21 |
|
22 |
void ProcesClock(uint8_t *tik,Clockt_t *clock); |
22 |
void ProcesClock(uint8_t *tik,Clockt_t *clock); |
23 |
void ClockInit(uint8_t hour,uint8_t min,uint8_t sec,Clockt_t *clock); |
23 |
void ClockInit(uint8_t hour,uint8_t min,uint8_t sec,Clockt_t *clock); |
24 |
|
24 |
|
25 |
#endif /* __clock_h_included__ */ |
25 |
#endif /* __clock_h_included__ */ |