15 lines
237 B
C
15 lines
237 B
C
|
#include "timer.h"
|
||
|
|
||
|
volatile uint32_t timestamp;
|
||
|
volatile uint16_t milliseconds;
|
||
|
|
||
|
ISR(TIMER0_OVF_vect) {
|
||
|
TCNT0 = 6; //Preload for 250 ticks to overflow
|
||
|
|
||
|
milliseconds++;
|
||
|
if(milliseconds > 999) {
|
||
|
timestamp++;
|
||
|
milliseconds = 0;
|
||
|
}
|
||
|
}
|