You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
405 B
25 lines
405 B
9 years ago
|
/* timer.h */
|
||
|
|
||
|
#ifndef _TIMER_H_
|
||
|
#define _TIMER_H_
|
||
|
|
||
|
#include "common.h"
|
||
|
|
||
|
#define CLOCK_FREQ 4000000
|
||
|
#define PRESCALER 256
|
||
|
#define TIMER_MAX 125
|
||
|
|
||
|
/* Careful to make this an integer */
|
||
|
#define TICKS_PER_SECOND (CLOCK_FREQ / (TIMER_MAX * PRESCALER))
|
||
|
|
||
|
extern uint8_t button;
|
||
|
|
||
|
extern volatile uint8_t output0;
|
||
|
extern volatile uint8_t output1;
|
||
|
|
||
|
extern volatile uint32_t seconds;
|
||
|
|
||
|
void timer_init(void);
|
||
|
|
||
|
#endif
|